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

create table with custom primary_id #27

Merged
merged 3 commits into from
Sep 18, 2013
Merged

create table with custom primary_id #27

merged 3 commits into from
Sep 18, 2013

Conversation

dnatag
Copy link
Contributor

@dnatag dnatag commented Sep 8, 2013

Add an option to create a table with custom primary_id instead of mandatory automatic 'id'. the type of custom primary_id can be a string (i.e. VARCHAR(255)) by default or an integer via integer flag. The caller will be responsible for the uniqueness of manually specified primary_id.

This custom id feature is only available via direct create_table call.

@pudo
Copy link
Owner

pudo commented Sep 9, 2013

Wow, thanks - this looks excellent! I was wondering whether an even nicer approach might be to set default values for the arguments, i.e.: primary_id='id', primary_type=Integer - this way the type of the primary key can be set freely and you don't need the branches in the code later on. I'm also thinking that we may want to make these arguments available in get_table, which calls create_table for non-existing relations.

What do you think?

@dnatag
Copy link
Contributor Author

dnatag commented Sep 9, 2013

Great. I like your suggestions and will make the changes.

On 9/9/2013 7:47 AM, Friedrich Lindenberg wrote:

Wow, thanks - this looks excellent! I was wondering whether an even
nicer approach might be to set default values for the arguments, i.e.:
primary_id='id', primary_type=Integer - this way the type of the
primary key can be set freely and you don't need the branches in the
code later on. I'm also thinking that we may want to make these
arguments available in get_table, which calls create_table for
non-existing relations.

What do you think?


Reply to this email directly or view it on GitHub
#27 (comment).

@dnatag
Copy link
Contributor Author

dnatag commented Sep 15, 2013

I take your suggestions and update the code. I also add an option for short-hand format of create/load table, so that users can intentionally create a new table with custom id and type passed-in as a tuple. If the table already exists, those id and type will be ignored.

pudo added a commit that referenced this pull request Sep 18, 2013
create table with custom primary_id
@pudo pudo merged commit 4ca0b4f into pudo:master Sep 18, 2013
@pudo
Copy link
Owner

pudo commented Sep 18, 2013

Thanks @dnatag, I've pushed a new version to pypi! This is a cool feature.

@dnatag
Copy link
Contributor Author

dnatag commented Sep 18, 2013

Glad you like it. I am really grateful for your creation of dataset. It makes my life easier, so this is my part of thanks ;-}

On Wednesday, September 18, 2013 at 6:55 AM, Friedrich Lindenberg wrote:

Thanks @dnatag (https://github.com/dnatag), I've pushed a new version to pypi! This is a cool feature.


Reply to this email directly or view it on GitHub (#27 (comment)).

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

Successfully merging this pull request may close these issues.

None yet

2 participants