Skip to content

Commit

Permalink
fix typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienZ committed Sep 14, 2024
1 parent 76a692f commit f5048f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { ConnectorName, Database } from "db0";
import z from "zod";
import consola from "consola";
import { SqliteTableChecker } from "./lib/sqlite-table-checker";
import { SQLiteTable } from "drizzle-orm/sqlite-core";

export type supportedConnectors = Extract<
ConnectorName,
Expand Down Expand Up @@ -52,7 +53,8 @@ export function createChecker(
const tableChecker: SqliteTableChecker = new SqliteTableChecker(database);

const checkTableWithSchema = async (tableName: string, schema: unknown) => {
const isTableOk = await tableChecker.checkTable(tableName, schema);
// TODO: remove casting when supporting non-sqlite connectors
const isTableOk = await tableChecker.checkTable(tableName, schema as SQLiteTable);
consola.success(`Table "${tableName}" exists and has a valid schema`);

return isTableOk;
Expand Down

0 comments on commit f5048f4

Please sign in to comment.