PHB-CS123 / graphene

CS123 Graph Database Project
Apache License 2.0
0 stars 0 forks source link

ALTER command #48

Closed eugene-bulkin closed 8 years ago

eugene-bulkin commented 8 years ago

This PR implements the ALTER command. We can use ALTER to rename schema properties, change their types, add or remove them. For example:

// Add a property named foo with type int[]
ALTER TYPE Person ADD PROPERTY foo int[];
// Removes the property named foo, if it exists
ALTER TYPE Person DROP PROPERTY foo;
// Changes the type of the property named foo to the new type, converting all values if applicable
ALTER TYPE Person CHANGE PROPERTY foo float[];
// Renames the property named foo to be named bar
ALTER TYPE Person RENAME PROPERTY foo bar;

CHANGE PROPERTY will convert types in a reasonable manner; if there is a way to convert values that makes sense, it does that conversion; otherwise, Graphene will simply choose the default value for the new type.

cc @Davidpena

eugene-bulkin commented 8 years ago

This fixed issue #14.