[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#32121] [PATCH 3/5] database: Add support for database upgrades.
From: |
Ludovic Courtès |
Subject: |
[bug#32121] [PATCH 3/5] database: Add support for database upgrades. |
Date: |
Mon, 16 Jul 2018 15:17:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Hello,
Clément Lassieur <address@hidden> skribis:
> Clément Lassieur <address@hidden> writes:
>
>> +(define (db-get-version db)
>> + (if (pair? (sqlite-exec db "SELECT name FROM sqlite_master WHERE \
>> +type='table' AND name='SchemaVersion';"))
>> + (vector-ref
>> + (car (sqlite-exec db "SELECT MAX(version) FROM SchemaVersion;")) 0)
>> + 0))
>> +
>> +(define (db-set-version db version)
>> + (sqlite-exec db "INSERT INTO SchemaVersion (version) VALUES (" version
>> + ");"))
>
> Actually, there is:
>
> PRAGMA schema.user_version;
> PRAGMA schema.user_version = integer ;
>
> The user_version pragma will to get or set the value of the user-version
> integer at offset 60 in the database header. The user-version is an
> integer that is available to applications to use however they
> want. SQLite makes no use of the user-version itself.
>
> Better use them than creating an ad-hoc table I guess, WDYT?
Sounds good, yes.
Thanks,
Ludo’.
[bug#32121] [PATCH 4/5] database: Call a specification 'jobset' instead of 'project'., Clément Lassieur, 2018/07/10
- [bug#32121] [PATCH 4/5] database: Call a specification 'jobset' instead of 'project'., Ludovic Courtès, 2018/07/13
- [bug#32121] [PATCH 4/5] database: Call a specification 'jobset' instead of 'project'., Clément Lassieur, 2018/07/13
- [bug#32121] [PATCH 4/5] database: Call a specification 'jobset' instead of 'project'., Clément Lassieur, 2018/07/13
- [bug#32121] [PATCH 4/5] database: Call a specification 'jobset' instead of 'project'., Ludovic Courtès, 2018/07/13
- [bug#32121] [PATCH 4/5] database: Call a specification 'jobset' instead of 'project'., Clément Lassieur, 2018/07/14
[bug#32121] [PATCH 5/5] Add support for multiple inputs., Clément Lassieur, 2018/07/10