Skip to content

uql-migrate against libsql+sqld will fail #87

@suau

Description

@suau

This is separate issue from #86,
When migrating against libsql running sqld (over http instead of local file)
The generate (and here manually fixed escapes for testing):

import type { SqlQuerier } from "uql-orm/migrate";

/**
 * Migration: schema
 * Created: 2026-04-04T11:44:01.078Z
 * Generated from entity definitions
 */
export default {
  async up(querier: SqlQuerier): Promise<void> {
    await querier.run(`CREATE TABLE \`Article\` (
  \`id\` INTEGER PRIMARY KEY AUTOINCREMENT,
  \`title\` TEXT,
  \`content\` TEXT
);
CREATE INDEX \`idx_Article_title\` ON \`Article\` (\`title\`);`);
  },

  async down(querier: SqlQuerier): Promise<void> {
    await querier.run(`DROP TABLE IF EXISTS \`Article\`;`);
  },
};

This will fail, because sqld does not support multiple statements.
breaking it up with multiple await querier.run() does fix the issue

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions