Prisma pull/push not working with PrismaPg adapter

I'm trying to use Prisma with GCP Cloud SQL so I have custom prisma.config.ts which uses PrismaPg and to make the connection. However on every push/pull command I get this error:
Error: Column type 'name' could not be deserialized from the database.
0: sql_schema_connector::flavour::postgres::describe_schema_with
with circumstances=BitFlags<Circumstances>(0b100, CanPartitionTables) preview_features=BitFlags<PreviewFeature>(0b0) namespaces=None schema="public"
at schema-engine/connectors/sql-schema-connector/src/flavour/postgres.rs:601
1: schema_commands::commands::schema_push::Calculate from database
at schema-engine/commands/src/commands/schema_push.rs:34
2: schema_engine_wasm::wasm::engine::SchemaPush
at schema-engine/schema-engine-wasm/src/wasm/engine.rs:467
Error: Column type 'name' could not be deserialized from the database.
0: sql_schema_connector::flavour::postgres::describe_schema_with
with circumstances=BitFlags<Circumstances>(0b100, CanPartitionTables) preview_features=BitFlags<PreviewFeature>(0b0) namespaces=None schema="public"
at schema-engine/connectors/sql-schema-connector/src/flavour/postgres.rs:601
1: schema_commands::commands::schema_push::Calculate from database
at schema-engine/commands/src/commands/schema_push.rs:34
2: schema_engine_wasm::wasm::engine::SchemaPush
at schema-engine/schema-engine-wasm/src/wasm/engine.rs:467
Does anyone have any ideas of the cause? The db is empty and I've tried to delete+recreate the public schema but the issue persists. The push works fine if I don't use the custom configuration, but then I have to start the SQL proxy manually.
3 Replies
Prisma AI Help
Prisma AI Help6mo ago
You're in no rush, so we'll let a dev step in. Enjoy your coffee, or drop into #ask-ai if you get antsy for a second opinion!
FINDarkside
FINDarksideOP6mo ago
This is my prisma.config.ts in case it give any ideas:
import { config as dot } from "dotenv";
import { defineConfig } from "prisma/config";
import { Connector } from "@google-cloud/cloud-sql-connector";
import { PrismaPg } from "@prisma/adapter-pg";
import { join } from "node:path";

dot({ path: join(__dirname, ".env") });
dot({ path: join(__dirname, ".env.local"), override: true });

export default defineConfig({
earlyAccess: true,
migrate: {
adapter: async () => {
const c = new Connector();
const opts = await c.getOptions({
instanceConnectionName: process.env.INSTANCE_CONNECTION_NAME!,
});

// Parse DATABASE_URL to extract connection details
const dbUrl = new URL(process.env.DATABASE_URL!);
const user = dbUrl.username;
const password = dbUrl.password;
const database = dbUrl.pathname.slice(1); // remove leading slash
console.log(`Connecting to database: ${database} as user: ${user}`);

return new PrismaPg({
...opts,
max: 10,
user,
password,
database,
});
},
},
});
import { config as dot } from "dotenv";
import { defineConfig } from "prisma/config";
import { Connector } from "@google-cloud/cloud-sql-connector";
import { PrismaPg } from "@prisma/adapter-pg";
import { join } from "node:path";

dot({ path: join(__dirname, ".env") });
dot({ path: join(__dirname, ".env.local"), override: true });

export default defineConfig({
earlyAccess: true,
migrate: {
adapter: async () => {
const c = new Connector();
const opts = await c.getOptions({
instanceConnectionName: process.env.INSTANCE_CONNECTION_NAME!,
});

// Parse DATABASE_URL to extract connection details
const dbUrl = new URL(process.env.DATABASE_URL!);
const user = dbUrl.username;
const password = dbUrl.password;
const database = dbUrl.pathname.slice(1); // remove leading slash
console.log(`Connecting to database: ${database} as user: ${user}`);

return new PrismaPg({
...opts,
max: 10,
user,
password,
database,
});
},
},
});
Nurul
Nurul6mo ago
Hmm, this is strange. Does this happen on latest prisma version 6.9.0 as well?

Did you find this page helpful?