Comments (8)
There are similar but but not identical concepts in GRDB. The similarities are about running upgrading code when needed, in order to upgrade the database to its latest scheme version. The differences are in the support for database assets: GRDB has none, or more specifically: it lets the resources/documents management to the application developer.
So.
If your application has a bundled database that may be modified by the user or later versions of your application, you need to know the difference between an application resource (immutable), and other mutable files. Check how to copy a database resource into the documents folder, and understand what this sentence means.
Next, versioning. SQLite comes with the user_version pragma, which you can simply query with let version = Int.fetchOne(db, "PRAGMA user_version")!
, and set with db.execute("PRAGMA user_version 42")
.
GRDB also comes with another versioning tool that has my personal preference over user_version, called migrations. Check them out, you may like it.
OK now. I hope this first answer has some food for you!
from grdb.swift.
Looks like db.execute("PRAGMA user_version = 42)
is working instead of db.execute("PRAGMA user_version 42")
from grdb.swift.
Hello @gitton. I'm not sure I understand the scope of your question. Is it about GRDB, about SQLite, or about the architecture of your application?
from grdb.swift.
This is about GRDB. I am new to swift, from android background. In android there is library called android-sqlite-asset-helper (https://github.com/jgilfelt/android-sqlite-asset-helper) in that there is a concept called database upgrade version (https://github.com/jgilfelt/android-sqlite-asset-helper#database-upgrades) i am looking to do similar in GRDB.
Thanks for this library so far this is really cool 👍
from grdb.swift.
Hello @gitton. Did you find your way in this maze?
from grdb.swift.
OK. I'm closing this issue since it does not look like it is still relevant to you. Please open a new one if you have another question.
from grdb.swift.
Sorry for the late response .it Works
Thank you 👍
from grdb.swift.
Great! Happy GRDB!
from grdb.swift.
Related Issues (20)
- GRDB migrator and previous FMDB database HOT 3
- GRDB called a `Not implemented` function while inserting. HOT 2
- Issue with having in fetch query HOT 5
- `databaseDateEncodingStrategy` not wok when update a existing record HOT 1
- Throwing subscript Row value HOT 4
- Linker error when building for watchOS with Address Sanitizer enabled HOT 7
- Conflicting Database.logError ? HOT 3
- “database disk image is malformed” when deleting some datas HOT 1
- Setting a default value for a date time column HOT 3
- Pool.get got "priority inversions" warnings in concurrent visit. HOT 6
- Debugging no longer possible after installing Custom SQLite build HOT 3
- Privacy manifest file HOT 11
- Xcode "Hang Risk" warning due to "itemsSemaphore.wait()" priority inversion. HOT 2
- Recommend the IMMEDIATE transaction type in the Sharing a Database guide
- @CodedBy and ValueCoder Issues HOT 3
- Reconsider sync/async overloads? HOT 4
- Privacy Manifest HOT 4
- Add date time column with default as current date HOT 2
- GRDB/Spatialite ? HOT 8
- Fatal Error with Spatialite: could not decode String from database value NULL HOT 4
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 grdb.swift.