import type { Generated, Insertable, Selectable, Updateable } from "kysely"; import type { AccountTable, ActiveAccountTable } from "../account/database-schema.js"; import type { KeyValueTable } from "../key-value/database-schema.js"; import type { MutationLogTable } from "./mutation-log/database-schema.js"; export type LixDatabaseSchema = { account: AccountTable; active_account: ActiveAccountTable; snapshot: SnapshotTable; label: LabelTable; file: LixFileTable; file_queue: FileQueueTable; change: ChangeTable; change_edge: ChangeEdgeTable; change_author: ChangeAuthorTable; change_set: ChangeSetTable; change_set_element: ChangeSetElementTable; change_set_label: ChangeSetLabelTable; key_value: KeyValueTable; discussion: DiscussionTable; comment: CommentTable; current_version: CurrentVersionTable; version: VersionTable; version_change: VersionChangeTable; version_change_conflict: VersionChangeConflictTable; change_conflict: ChangeConflictTable; change_conflict_resolution: ChangeConflictResolutionTable; mutation_log: MutationLogTable; }; export type FileQueueEntry = Selectable; export type NewFileQueueEntry = Insertable; export type FileQueueEntryUpdate = Updateable; type FileQueueTable = { id: Generated; file_id: string; path_before: string | null; path_after: string | null; data_before: Uint8Array | null; data_after: Uint8Array | null; metadata_before: Record | null; metadata_after: Record | null; }; export type LixFile = Selectable; export type NewLixFile = Insertable; export type LixFileUpdate = Updateable; type LixFileTable = { id: Generated; /** * The path of the file. * * The path is currently defined as a subset of RFC 3986. * Any path can be tested with the `isValidFilePath()` function. * * @example * - `/path/to/file.txt` */ path: string; data: Uint8Array; metadata: Record | null; }; export type Change = Selectable; export type NewChange = Insertable; type ChangeTable = { id: Generated; /** * The entity the change refers to. */ entity_id: string; file_id: string; /** * The plugin key that contributed the change. * * Exists to ease querying for changes by plugin, * in case the user changes the plugin configuration. */ plugin_key: string; /** * The schema key that the change refers to. */ schema_key: string; snapshot_id: string; /** * The time the change was created. */ created_at: Generated; }; export type ChangeEdge = Selectable; export type NewChangeEdge = Insertable; type ChangeEdgeTable = { parent_id: string; child_id: string; }; export type ChangeAuthor = Selectable; export type NewChangeAuthor = Insertable; type ChangeAuthorTable = { change_id: string; account_id: string; }; export type Snapshot = Selectable; export type NewSnapshot = Insertable; type SnapshotTable = { id: Generated; /** * The value of the change. * * Lix interprets an undefined value as delete operation. * * @example * - For a csv cell change, the value would be the new cell value. * - For an inlang message change, the value would be the new message. */ content: Record | null; }; export type ChangeSet = Selectable; export type NewChangeSet = Insertable; export type ChangeSetUpdate = Updateable; type ChangeSetTable = { id: Generated; }; export type ChangeSetElement = Selectable; export type NewChangeSetElement = Insertable; export type ChangeSetElementUpdate = Updateable; type ChangeSetElementTable = { change_set_id: string; change_id: string; }; export type Discussion = Selectable; export type NewDiscussion = Insertable; export type DiscussionUpdate = Updateable; type DiscussionTable = { id: Generated; change_set_id: string; }; export type Comment = Selectable; export type NewComment = Insertable; export type CommentUpdate = Updateable; type CommentTable = { id: Generated; parent_id: string | null; discussion_id: string; content: string; }; export type Label = Selectable; export type NewLabel = Insertable; export type LabelUpdate = Updateable; type LabelTable = { id: Generated; name: string; }; export type ChangeSetLabel = Selectable; export type NewChangeSetLabel = Insertable; export type ChangeSetLabelUpdate = Updateable; type ChangeSetLabelTable = { change_set_id: string; label_id: string; }; export type Version = Selectable; export type Newversion = Insertable; export type VersionUpdate = Updateable; type VersionTable = { id: Generated; name: Generated; }; export type VersionChange = Selectable; export type NewVersionChange = Insertable; export type VersionChangeUpdate = Updateable; type VersionChangeTable = { version_id: string; change_id: string; entity_id: string; file_id: string; schema_key: string; }; export type VersionChangeConflict = Selectable; export type NewversionChangeConflict = Insertable; export type VersionChangeConflictUpdate = Updateable; type VersionChangeConflictTable = { version_id: string; change_conflict_id: string; }; export type CurrentVersion = Selectable; export type NewCurrentVersion = Insertable; export type CurrentVersionUpdate = Updateable; type CurrentVersionTable = { id: string; }; export type ChangeConflict = Selectable; export type NewChangeConflict = Insertable; export type ChangeConflictUpdate = Updateable; type ChangeConflictTable = { id: Generated; /** * The key is used to identify the conflict. * * The key should be unique for the plugin and the conflict * to avoid duplicate conflict reports. * * @example * - `csv-row-order-changed` * - `inlang-message-bundle-foreign-key-violation` */ key: string; change_set_id: string; }; export type ChangeConflictResolution = Selectable; export type NewChangeConflictResolution = Insertable; export type ChangeConflictResolutionUpdate = Updateable; type ChangeConflictResolutionTable = { change_conflict_id: string; resolved_change_id: string; }; export {}; //# sourceMappingURL=schema.d.ts.map