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

any non-constant as expresion as default in SQLite requires parenthesis #4474

Closed
pax0r opened this issue Jan 30, 2019 · 3 comments
Closed

any non-constant as expresion as default in SQLite requires parenthesis #4474

pax0r opened this issue Jan 30, 2019 · 3 comments
Labels
schema things related to the DDL related objects like Table, Column, CreateIndex, etc. sqlite
Milestone

Comments

@pax0r
Copy link
Contributor

pax0r commented Jan 30, 2019

Acording to https://www.sqlite.org/lang_createtable.html expression as default for columns requires brackets in SQLite.

SQLAlchemy renders this without them which causes SYNTAX ERROR.

pax0r added a commit to pax0r/sqlalchemy that referenced this issue Jan 30, 2019
@zzzeek zzzeek added schema things related to the DDL related objects like Table, Column, CreateIndex, etc. sqlite labels Jan 30, 2019
@zzzeek zzzeek added this to the 1.2.x milestone Jan 30, 2019
pax0r added a commit to pax0r/sqlalchemy that referenced this issue Jan 31, 2019
…res brackets

This pull request fixes sqlalchemy#4474

Closes: sqlalchemy#4475
Pull-request: sqlalchemy#4475
Pull-request-sha: 05a8f82

Change-Id: I888c69bfba5a5ab8ffa420f512557ac311a36b31
@zzzeek zzzeek changed the title Function as default in SQLite requires brackets any non-constant as expresion as default in SQLite requires parenthesis Feb 2, 2019
@zzzeek
Copy link
Member

zzzeek commented Feb 2, 2019

had to do a lot more to make this work

@sqla-tester
Copy link
Collaborator

Bartlomiej Biernacki has proposed a fix for this issue in the master branch:

Render parenthesis around sqlite expression defaults https://gerrit.sqlalchemy.org/1123

@sqla-tester
Copy link
Collaborator

Bartlomiej Biernacki has proposed a fix for this issue in the rel_1_2 branch:

Render parenthesis around sqlite expression defaults https://gerrit.sqlalchemy.org/1121

sqlalchemy-bot pushed a commit that referenced this issue Feb 2, 2019
Fixed bug in SQLite DDL where using an expression as a server side default
required that it be contained within parenthesis to be accepted by the
sqlite parser.  Pull request courtesy Bartlomiej Biernacki.

Fixes: #4474
Closes: #4475
Pull-request: #4475
Pull-request-sha: 0af3238

Change-Id: I888c69bfba5a5ab8ffa420f512557ac311a36b31
(cherry picked from commit f7ce37e9dd493d4b60b3156f08ef4c98fd63904d)
(cherry picked from commit 620bfde)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
schema things related to the DDL related objects like Table, Column, CreateIndex, etc. sqlite
Projects
None yet
Development

No branches or pull requests

3 participants