fix(db): type the move's value conversion and client for the server's compiler

Formats the two files the format gate listed.
This commit is contained in:
Maurice
2026-11-17 15:15:48 +01:00
parent 0e911608af
commit cf9172f9e7
4 changed files with 8 additions and 4 deletions
@@ -167,7 +167,8 @@ export async function copyTable(
const values: PostgresValue[] = [];
spec.columns.forEach((column, index) => {
const converted = convertValue(raw[index] as SqliteValue, column.kind);
if (converted.ok) {
// Narrowed by `in`: the server compiles without strictNullChecks, where `ok` does not narrow the union.
if (!('reason' in converted)) {
values.push(converted.value);
if (column.kind === 'integer' && beyondSafeInteger(converted.value)) result.unsafeIntegers++;
return;
@@ -25,6 +25,7 @@ import {
resolveIdentitySequences,
type PluginPlan,
} from './plugin-data';
import type { AbstractSqlConnection } from '@mikro-orm/sql';
import type { Kysely } from 'kysely';
@@ -281,7 +282,7 @@ export async function moveSqliteToPostgres(options: MoveOptions): Promise<MoveSu
warnings: [],
seconds: 0,
};
const db = options.orm.em.getConnection().getClient<object>();
const db = (options.orm.em.getConnection() as AbstractSqlConnection).getClient<object>();
let source: SqliteSource;
try {
source = SqliteSource.open(options.sqliteFile);