Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALTER command #48

Merged
merged 15 commits into from
Dec 11, 2015
Merged

ALTER command #48

merged 15 commits into from
Dec 11, 2015

Conversation

eugene-bulkin
Copy link

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 added 15 commits November 13, 2015 11:51
Also added a bare-bones AlterCommand class for handling parsed input. It
currently just prints out what the ALTER command would do. Next, this will be
deferred to the storage manager.
Also added a bare-bones AlterCommand class for handling parsed input. It
currently just prints out what the ALTER command would do. Next, this will be
deferred to the storage manager.
Includes tests for adding properties to nodes and relations, including
relations with empty schemas. This currently only supports appending properties
to the schema; perhaps functionality to specify exactly where to put the
property can be added later.
Conflicts:
	graphene/commands/alter_command.py
	graphene/storage/storage_manager.py
	tests/storage/intermediate/test_storage_manager.py
@eugene-bulkin eugene-bulkin added this to the CS 81 milestone Dec 6, 2015
eugene-bulkin pushed a commit that referenced this pull request Dec 11, 2015
@eugene-bulkin eugene-bulkin merged commit 779436e into master Dec 11, 2015
@eugene-bulkin eugene-bulkin deleted the alter branch December 11, 2015 11:12
@eugene-bulkin
Copy link
Author

This fixed issue #14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants