Skip to content

Commit

Permalink
keeping DrizzleConfig Mode type
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodriguespn committed Sep 20, 2024
1 parent 55fdb45 commit ba61b82
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
5 changes: 2 additions & 3 deletions drizzle-orm/src/monodriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,8 @@ export async function drizzle<
: TClient extends 'neon-serverless' ? DrizzleConfig<TSchema> & {
ws?: any;
}
:
TClient extends 'singlestore' ? SingleStoreDriverDrizzleConfig<TSchema> :
DrizzleConfig<TSchema>),
: TClient extends 'singlestore' ? SingleStoreDriverDrizzleConfig<TSchema>
: DrizzleConfig<TSchema>),
): Promise<DetermineClient<TClient, TSchema>> {
const { connection, ws, ...drizzleConfig } = params as typeof params & {
ws?: any;
Expand Down
6 changes: 3 additions & 3 deletions drizzle-orm/src/monomigrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type { NeonDatabase } from './neon-serverless/index.ts';
import type { NodePgDatabase } from './node-postgres/index.ts';
import type { PlanetScaleDatabase } from './planetscale-serverless/index.ts';
import type { PostgresJsDatabase } from './postgres-js/index.ts';
import type { SingleStore2Database } from './singlestore/driver.ts';
import type { SingleStoreDriverDatabase } from './singlestore/driver.ts';
import type { TiDBServerlessDatabase } from './tidb-serverless/index.ts';
import type { VercelPgDatabase } from './vercel-postgres/index.ts';

Expand All @@ -31,7 +31,7 @@ export async function migrate(
| PostgresJsDatabase<any>
| VercelPgDatabase<any>
| TiDBServerlessDatabase<any>
| SingleStore2Database<any>,
| SingleStoreDriverDatabase<any>,
config:
| string
| MigrationConfig,
Expand Down Expand Up @@ -105,7 +105,7 @@ export async function migrate(
case 'SingleStore2Database': {
const { migrate } = await import('./singlestore/migrator');

return migrate(db as SingleStore2Database, config as MigrationConfig);
return migrate(db as SingleStoreDriverDatabase, config as MigrationConfig);
}
}
}
2 changes: 1 addition & 1 deletion drizzle-orm/src/singlestore/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { SingleStoreDatabase } from '~/singlestore-core/db.ts';
import { SingleStoreDialect } from '~/singlestore-core/dialect.ts';
import type { DrizzleConfig } from '~/utils.ts';
import type {
Mode,
SingleStoreDriverClient,
SingleStoreDriverPreparedQueryHKT,
SingleStoreDriverQueryResultHKT,
Expand Down Expand Up @@ -45,7 +46,6 @@ export type SingleStoreDriverDatabase<
TSchema extends Record<string, unknown> = Record<string, never>,
> = SingleStoreDatabase<SingleStoreDriverQueryResultHKT, SingleStoreDriverPreparedQueryHKT, TSchema>;


export type SingleStoreDriverDrizzleConfig<TSchema extends Record<string, unknown> = Record<string, never>> =
& Omit<DrizzleConfig<TSchema>, 'schema'>
& ({ schema: TSchema; mode: Mode } | { schema?: undefined; mode?: Mode });
Expand Down
1 change: 1 addition & 0 deletions drizzle-orm/src/singlestore/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { fillPlaceholders, sql } from '~/sql/sql.ts';
import type { Query, SQL } from '~/sql/sql.ts';
import { type Assume, mapResultRow } from '~/utils.ts';

// must keep this type here for compatibility with DrizzleConfig
export type Mode = 'default';

export type SingleStoreDriverClient = Pool | Connection;
Expand Down

0 comments on commit ba61b82

Please sign in to comment.