Cannot read properties of undefined (reading 'columns')

I'm using turso, trying to push with Drizzle Kit, but unfortunately getting this error:
> drizzle-kit push:sqlite

No config path provided, using default path
Reading config file 'x\drizzle.config.ts'
drizzle-kit: v0.20.14
drizzle-orm: v0.29.3

TypeError: Cannot read properties of undefined (reading 'columns')
at _moveDataStatements (x\drizzle-kit\bin.cjs:62603:61)
at logSuggestionsAndReturn2 (x\drizzle-kit\bin.cjs:62828:39)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Command.<anonymous> (x\drizzle-kit\bin.cjs:63311:11)
> drizzle-kit push:sqlite

No config path provided, using default path
Reading config file 'x\drizzle.config.ts'
drizzle-kit: v0.20.14
drizzle-orm: v0.29.3

TypeError: Cannot read properties of undefined (reading 'columns')
at _moveDataStatements (x\drizzle-kit\bin.cjs:62603:61)
at logSuggestionsAndReturn2 (x\drizzle-kit\bin.cjs:62828:39)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Command.<anonymous> (x\drizzle-kit\bin.cjs:63311:11)
2 Replies
makaron pelnoziarnisty
// Database Client
// db.ts
import { drizzle } from "drizzle-orm/libsql";
import { createClient } from "@libsql/client";
import * as users from "./schemas/users";

const databaseURL = process.env.DB_URL;
if (!databaseURL) {
throw new Error("DB_URL is not set");
}

const client = createClient({
url: databaseURL,
authToken: process.env.DB_TOKEN,
});

const db = drizzle(client, {
schema: { ...users },
});

export default db;
// Database Client
// db.ts
import { drizzle } from "drizzle-orm/libsql";
import { createClient } from "@libsql/client";
import * as users from "./schemas/users";

const databaseURL = process.env.DB_URL;
if (!databaseURL) {
throw new Error("DB_URL is not set");
}

const client = createClient({
url: databaseURL,
authToken: process.env.DB_TOKEN,
});

const db = drizzle(client, {
schema: { ...users },
});

export default db;
// drizzle.config.ts
import type { Config } from "drizzle-kit";

export default {
schema: "./app/lib/db/schemas/*",
out: "./app/lib/db/migrations",
driver: "turso",
dbCredentials: {
url: DB_URL,
authToken: DB_TOKEN,
},
verbose: true,
strict: true,
} satisfies Config;
// drizzle.config.ts
import type { Config } from "drizzle-kit";

export default {
schema: "./app/lib/db/schemas/*",
out: "./app/lib/db/migrations",
driver: "turso",
dbCredentials: {
url: DB_URL,
authToken: DB_TOKEN,
},
verbose: true,
strict: true,
} satisfies Config;
Seems to work after switching to local database server, so its fine for now, although I'd love it to work with Turso db server
Liam
Liam8mo ago
Hey did you ever wind up finding a fix for this? beyond using the local server
Want results from more Discord servers?
Add your server