Comments (3)
same here and i investigated. it must have something to do with the sqlite version.
$ sqlite3 --version
3.19.3 2017-06-27 16:48:08 2b0954060fe10d6de6d479287dd88890f1bef6cc1beca11bc6cdb79f72e2377b
the test case expects the dump to contain the following:
spec/unit/hanami/model/migrator/sqlite.rb:285
expect(actual).to include %(INSERT INTO "schema_migrations" VALUES('20160831073534_create_reviews.rb');)
but the .dump
command with the above sqlite version actually produces an insert statement without quoted table name:
$ sqlite3 tmp/create-259db92730853c0725162b4845c9a57c.sqlite3 .dump
[...]
INSERT INTO schema_migrations VALUES('20160831073534_create_reviews.rb');
[...]
the test suite does not fail on the ci. so, it would be interesting what sqlite version is running there.
unrelated but interesting:
i also found that if you rename a table, .dump
suddenly produces a create table
statement with an if not exists
condition. i get the feeling that sqlite is a mess.
from model.
sqlite versions seem to be the following:
- travis: 3.8 (by way of the ubuntu trusty package)
- circle: 3.16 (by way of the debian stretch package)
from model.
ok. i stumbled upon the sqlite commit that changed the quoting behavior in drumroll version 3.18.
mackyle/sqlite@31866aa (original source: that commit) adds a quoting algorithm that dynamically decides whether to quote an identifier or not. it also contains test case where the quotes around table names got removed.
Attempt to determine if identifier zName needs to be quoted, either
because it contains non-alphanumeric characters, or because it is an
SQLite keyword. Be conservative in this estimate: When in doubt assume
that quoting is required.
summary
- the test suite is successful on ci because ci runs sqlite < 3.18
- sqlite 3.18 introduced different quoting behavior
- @PWx21 and I have versions of sqlite > 3.18, thus the test suite does not run through
suggestion
update the test case to to regexp matching when looking for specific queries in the dump to stay back-/forward-compatible.
from model.
Related Issues (20)
- Date with BC note in PostgreSQL parsed incorrectly
- Optimistic Locking HOT 2
- Repository #find_or_create_by HOT 2
- Database column defaults are not replacing empty string or nil values HOT 4
- Private method 'Array' in hanami entity HOT 2
- Extra query with assoc and that make app slow HOT 1
- NoMethodError: undefined method `one' for #<Hanami::Model::Associations::HasMany> HOT 4
- Associations don't seem to work well with as: aliases. HOT 3
- What's the recommend way to use transactions? HOT 3
- BigDecimal.new error with Postgres HOT 16
- Can't prepare testing PostgreSQL database HOT 5
- #to_hash and implicit conversion HOT 4
- Error
- db prepare raises Postgres createdb error HOT 14
- Unable to control production DB log HOT 1
- [QUESTION] There is a "How to" guide for the test/development process? HOT 2
- Use original error in case role is missing for Postgres HOT 1
- Change default dataset configured in ROM HOT 1
- Outdated dependencies HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from model.