mirror of
https://github.com/withastro/astro.git
synced 2025-01-13 22:11:20 -05:00
refactor: use FieldsConfig for Table generic
This commit is contained in:
parent
49f8fab4bf
commit
1a1589d9ce
1 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
import type { ColumnDataType, ColumnBaseConfig, SQLChunk } from 'drizzle-orm';
|
import type { ColumnDataType, ColumnBaseConfig } from 'drizzle-orm';
|
||||||
import type { SQLiteColumn, SQLiteTableWithColumns } from 'drizzle-orm/sqlite-core';
|
import type { SQLiteColumn, SQLiteTableWithColumns } from 'drizzle-orm/sqlite-core';
|
||||||
import type { DBField } from '../core/types.js';
|
import type { DBField, FieldsConfig } from '../core/types.js';
|
||||||
|
|
||||||
type GeneratedConfig<T extends ColumnDataType = ColumnDataType> = Pick<
|
type GeneratedConfig<T extends ColumnDataType = ColumnDataType> = Pick<
|
||||||
ColumnBaseConfig<T, string>,
|
ColumnBaseConfig<T, string>,
|
||||||
|
@ -76,7 +76,7 @@ export type Column<T extends DBField['type'], S extends GeneratedConfig> = T ext
|
||||||
|
|
||||||
export type Table<
|
export type Table<
|
||||||
TTableName extends string,
|
TTableName extends string,
|
||||||
TFields extends Record<string, Pick<DBField, 'type' | 'schema'>>,
|
TFields extends FieldsConfig,
|
||||||
> = SQLiteTableWithColumns<{
|
> = SQLiteTableWithColumns<{
|
||||||
name: TTableName;
|
name: TTableName;
|
||||||
schema: undefined;
|
schema: undefined;
|
||||||
|
|
Loading…
Add table
Reference in a new issue