mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-20 19:16:08 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user