import type { ColumnType } from 'kysely'; /** Kysely column type for millisecond epoch timestamps stored as integers. */ export type Timestamp = ColumnType; /** Kysely column type for binary blobs accepting Buffer or Uint8Array on insert. */ export type BlobColumn = ColumnType; /** * One row per (resource_id, public_key). Each publicKey owns a slot within a shared resource. */ export interface ResourceDataTable { /** Shared resource identifier grouping related instances. */ resource_id: string; /** Owner identity for this instance slot within the resource. */ public_key: string; /** Opaque serialized resource payload. */ blob: BlobColumn; /** Millisecond timestamp of the last write. */ timestamp: Timestamp; } /** Complete Kysely schema mapping for the sync server database. */ export interface DatabaseTables { resource_data: ResourceDataTable; }