Skip to content

Commit 3af2d37

Browse files
committed
wip
1 parent 73fdf90 commit 3af2d37

File tree

7 files changed

+25
-141
lines changed

7 files changed

+25
-141
lines changed

.claude/settings.local.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(rm:*)"
5+
],
6+
"deny": []
7+
}
8+
}

packages/cli/src/commands/deploy.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
getSpawnEnvWithPg,
1212
} from 'pg-env';
1313

14-
import { deployFast, deployWithOptions } from '@launchql/core';
14+
import { deploy, deployWithOptions } from '@launchql/core';
1515
import { Logger } from '@launchql/logger';
1616
import { execSync } from 'child_process';
1717
import { getTargetDatabase } from '../utils';
@@ -83,26 +83,21 @@ export default async (
8383
log.info(`Selected project: ${projectName}`);
8484
}
8585

86-
// Handle fast deploy separately as it uses a different API
86+
// Handle fast deploy using the unified deploy function
8787
if (argv.fast && recursive) {
8888
const options: LaunchQLOptions = getEnvOptions({
8989
pg: {
9090
database
9191
}
9292
});
9393

94-
// Fast deploy needs the module path, so we need to get it
95-
// This is a limitation of the current fast deploy API
9694
const { LaunchQLProject } = await import('@launchql/core');
9795
const project = new LaunchQLProject(cwd);
9896
const modules = project.getModuleMap();
9997
const modulePath = modules[projectName!].path;
10098

101-
await deployFast({
102-
opts: options,
103-
database,
104-
dir: modulePath,
105-
name: projectName!,
99+
await deploy(options, projectName!, database, modulePath, {
100+
fast: true,
106101
usePlan: true,
107102
cache: false
108103
});

packages/core/src/deploy-fast.ts

Lines changed: 0 additions & 119 deletions
This file was deleted.

packages/core/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export * from './class/launchql';
2-
export * from './deploy-fast';
32
export * from './deps';
43
export * from './export-meta';
54
export * from './export-migrations';

packages/core/src/sqitch/deploy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export const deploy = async (
3939
/**
4040
* If true, use the fast deployment strategy
4141
* This will skip the sqitch deployment and new migration system and simply deploy the packaged sql
42+
* Defaults to true for launchql
4243
*/
4344
fast?: boolean;
4445
/**
@@ -80,7 +81,7 @@ export const deploy = async (
8081
log.info(`📂 Deploying local module: ${extension}`);
8182
log.debug(`→ Path: ${modulePath}`);
8283

83-
if (options?.fast) {
84+
if (options?.fast ?? true) {
8485
// Use fast deployment strategy
8586
const localProject = new LaunchQLProject(modulePath);
8687
const cacheKey = getCacheKey(opts.pg, extension, database);
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { SeedAdapter, SeedContext } from './types';
22
import { getEnvOptions } from '@launchql/types';
3-
import { LaunchQLProject, deployFast } from '@launchql/core';
3+
import { LaunchQLProject, deploy } from '@launchql/core';
44

55
export function launchql(cwd?: string, cache: boolean = false): SeedAdapter {
66
return {
@@ -10,14 +10,11 @@ export function launchql(cwd?: string, cache: boolean = false): SeedAdapter {
1010

1111
const opts = getEnvOptions({ pg: ctx.config });
1212

13-
await deployFast({
14-
opts,
15-
name: proj.getModuleName(),
16-
database: ctx.config.database,
17-
dir: proj.modulePath,
18-
usePlan: true,
19-
cache
20-
});
13+
await deploy(opts, proj.getModuleName(), ctx.config.database, proj.modulePath, {
14+
fast: true,
15+
usePlan: true,
16+
cache
17+
});
2118
}
2219
};
2320
}

packages/pgsql-test/src/seed/sqitch.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ import { LaunchQLProject, deploy } from '@launchql/core';
55
export function sqitch(cwd?: string): SeedAdapter {
66
return {
77
async seed(ctx: SeedContext) {
8-
const proj = new LaunchQLProject(cwd ?? ctx.connect.cwd);
8+
const proj = new LaunchQLProject(cwd ?? ctx.connect.cwd);
99
if (!proj.isInModule()) return;
1010
const opts = getEnvOptions({ pg: ctx.config });
11-
await deploy(opts, proj.getModuleName(), ctx.config.database, proj.modulePath);
11+
await deploy(opts, proj.getModuleName(), ctx.config.database, proj.modulePath, {
12+
useSqitch: true,
13+
fast: false
14+
});
1215
}
1316
};
1417
}

0 commit comments

Comments
 (0)