mirror of
https://ghproxy.cflmy.top/https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-11-29 08:39:35 +08:00
The schema and every static statement of the SQLite Session store were string literals in TypeScript, and the upgrade step from the frame layout executed whatever the current schema constant held. They now live under resources/sql: schema/vN.sql is the whole schema of one version and is not edited once released, upgrade/A-to-B holds the statements of one upgrade step, and store/ and derived/ hold the statements of the store and of the derived-table runtime. src/sql.ts is their only reader. Two internal views, segment_extents and session_heads, replace the SQL fragments the store shared by string interpolation. Transaction control, connection pragmas and the DDL generated from a derivation stay inline.
13 lines
578 B
TypeScript
13 lines
578 B
TypeScript
/**
|
|
* Identity of the Segment store's current schema. The schema itself is SQL in
|
|
* `resources/sql/schema/`, one file per version; opening and upgrading a
|
|
* database belongs to `migrations/`. @module
|
|
*/
|
|
|
|
/** Segment storage schema version, monotonic; each increase has a step in `migrations/`. */
|
|
export const SCHEMA_VERSION = 2
|
|
/** SQLite `application_id` of a Segment store. */
|
|
export const APPLICATION_ID = 0x44535043
|
|
/** Tables every current database holds; a database missing one is refused. */
|
|
export const TABLES = ['events', 'segment_paths', 'segments', 'sessions']
|