Skip to content

Commit db78d39

Browse files
committed
test(cli): the pre-18 store testkit imports the driver lazily, as src/ requires
Claude-Session: https://claude.ai/code/session_018EszgtA3V2KXBX5tf59Hi4 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 382851c commit db78d39

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/cli/src/utils/pre-18-store.testkit.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
22

3-
import { SqlDriver } from '@objectstack/driver-sql';
4-
53
/**
64
* Return a SQLite file this release built to the shape an EARLIER release's
75
* database has: every tenant column (`organization_id`) nullable.
@@ -15,6 +13,9 @@ import { SqlDriver } from '@objectstack/driver-sql';
1513
* (`relax_not_null`, the SQLite table rebuild), never a hand `ALTER`.
1614
*/
1715
export async function relaxTenantColumnsOnFile(file: string, column = 'organization_id'): Promise<string[]> {
16+
// A dynamic import: this file lives under `src/`, where a static driver import
17+
// is refused (`schema-migrate.lazy-driver-import.test.ts`).
18+
const { SqlDriver } = await import('@objectstack/driver-sql');
1819
const driver = new SqlDriver({ client: 'better-sqlite3', connection: { filename: file }, useNullAsDefault: true });
1920
const relaxed: string[] = [];
2021
try {

0 commit comments

Comments
 (0)