import { ForeignKeyDefinition, IndexDefinition, defineSchema } from "@toiroakr/lines-db"; //#region src/seed/index.d.ts type ValidateSeedDataOptions = { /** Resolved absolute path to a data directory or a .jsonl file */ path: string; /** Show verbose error output */ verbose?: boolean; }; type ValidateSeedResult = { valid: true; output: string; } | { valid: false; output: string; error: string; /** Where the first reported error sits, for tooling that links to source. */ location?: { file: string; line?: number; }; }; /** * A JSONL seed file that received values. */ type FilledSeedFile = { /** Name of the seeded table, matching the JSONL file name */ table: string; /** Absolute path to the updated JSONL file */ file: string; /** Fields that were written back to the file */ fields: string[]; /** How many rows were missing at least one of those fields */ count: number; }; type FillSeedDataOptions = { /** Resolved absolute path to a data directory or a .jsonl file */ path: string; /** Fields to fill. Defaults to `id`. */ fields?: readonly string[]; }; type FillSeedDataResult = { output: string; filled: FilledSeedFile[]; }; /** * Validate JSONL seed data against schema definitions. * Resolves the given path (directory or `.jsonl` file), validates the rows it * holds, and returns formatted output and error messages. * @param options - Validation options including path and verbose flag * @returns Validation result with output messages and optional error details */ export declare function validateSeedData(options: ValidateSeedDataOptions): Promise; /** * Fill in the values a record gets on create for the JSONL seed data rows that * are missing them, so a row can be referenced by `id` or carry a timestamp * before it is ever seeded. * * The values come from the table's own create-time behavior — its `id`, its field * defaults, and its create hooks — applied to each row on its own. Nothing is * validated, so a row can be filled while the data around it is still * incomplete: that is what lets you get the ids you need in order to write the * rows that reference them. Run `validateSeedData` when the data is ready. * * Only the named fields are written, and only into a row that has no value for * them, so a value already in the file is never replaced. A line that gains * nothing is written back exactly as it was, byte for byte; a line that does get * a value is re-serialized with its keys in the order the table declares its * fields, so a filled-in `id` lands at the front. A field the table gives no * value to — one it does not declare, or one the platform assigns such as a * serial field — is skipped, so one field list covers a whole data directory. * * The values are read from the schema files generated next to the data, and all * of them are read before anything is written: a file that predates the current * generator stops the run with nothing filled in anywhere. * @param options - Fill options including path and fields * @returns Which files received which fields */ export declare function fillSeedData(options: FillSeedDataOptions): Promise; //#endregion export { type ForeignKeyDefinition, type IndexDefinition, defineSchema };