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

parsing error near unique not null #21

Closed
dfong opened this issue May 8, 2017 · 4 comments
Closed

parsing error near unique not null #21

dfong opened this issue May 8, 2017 · 4 comments

Comments

@dfong
Copy link

dfong commented May 8, 2017

with ramsql i get the above error on this statement,

create table tables(name text unique not null)

which works fine if i use the sqlite3 driver instead.

@proullon
Copy link
Owner

proullon commented May 9, 2017

yes unique is not implemented (it's #15 )
I'll see what I can do this week

@proullon
Copy link
Owner

proullon commented May 9, 2017

done

@proullon proullon closed this as completed May 9, 2017
@dfong
Copy link
Author

dfong commented May 9, 2017

thanks for rapidly fixing these bugs.

@fabulias
Copy link

fabulias commented Jun 8, 2018

But UNIQUE only works as a column constraint, I try with table constraint and the output is an error.

I want:
CREATE TABLE IF NOT EXISTS sample_table (id SERIAL PRIMARY KEY, name TEXT, UNIQUE(name));
I got:
ERROR : cannot execute : Syntax error near , unique (

If I try with this:
CREATE TABLE IF NOT EXISTS sample_table (id SERIAL PRIMARY KEY, name TEXT UNIQUE);
I got:
Query OK. 1 rows affected

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

No branches or pull requests

3 participants