Fix bugs, improve schema gen

This commit is contained in:
2026-10-14 01:47:55 +01:00
parent 2ddf450b9f
commit 155263a79f
25 changed files with 571 additions and 172 deletions
+27
View File
@@ -206,7 +206,15 @@ export type BUN_MARIADB_FieldSchemaType = {
patternFlags?: string;
onUpdate?: string;
onUpdateLiteral?: string;
/**
* @deprecated Use `foreignKey.onDelete`. Still honored as the foreign
* key's ON DELETE action when `foreignKey.onDelete` is not set.
*/
onDelete?: string;
/**
* @deprecated Use `foreignKey.onDelete`. Still honored as the foreign
* key's ON DELETE action when `foreignKey.onDelete` is not set.
*/
onDeleteLiteral?: string;
cssFiles?: string[];
/**
@@ -224,13 +232,32 @@ export type BUN_MARIADB_FieldSchemaType = {
/**
* Defines a foreign key relationship from one field to another table column.
*/
export declare const BUN_MARIADB_ForeignKeyRules: readonly ["CASCADE", "SET NULL", "RESTRICT", "NO ACTION"];
export type BUN_MARIADB_ForeignKeyRule = (typeof BUN_MARIADB_ForeignKeyRules)[number];
export interface BUN_MARIADB_ForeignKeyType {
foreignKeyName?: string;
destinationTableName?: string;
destinationTableColumnName?: string;
destinationTableColumnType?: string;
/**
* Shorthand for `onDelete: "CASCADE"`. Ignored when `onDelete` is set.
*/
cascadeDelete?: boolean;
/**
* Shorthand for `onUpdate: "CASCADE"`. Ignored when `onUpdate` is set.
*/
cascadeUpdate?: boolean;
/**
* Referential action when the referenced row is deleted.
* Defaults to `CASCADE` when `cascadeDelete` is true, else `RESTRICT`.
* `SET NULL` requires a nullable column.
*/
onDelete?: BUN_MARIADB_ForeignKeyRule;
/**
* Referential action when the referenced key is updated.
* Defaults to `CASCADE` when `cascadeUpdate` is true, else `RESTRICT`.
*/
onUpdate?: BUN_MARIADB_ForeignKeyRule;
}
export declare const MariaDBIndexTypes: readonly ["BTREE", "HASH", "FULLTEXT", "SPATIAL", "VECTOR"];
export type MariaDBIndexType = (typeof MariaDBIndexTypes)[number];