You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Drizzle community,
First off, loving Drizzle ORM! I'm currently integrating it with EdgeDB using the Gel dialect and have run into a couple of roadblocks regarding schema generation with Drizzle Kit. I'm hoping to get some clarification on the intended workflow.
My goal is to generate Drizzle schema definitions (like a schema.ts file) based on my existing EdgeDB schema defined in .gel files within my dbschema directory.
Setup:
My drizzle.config.ts looks like this
`// drizzle.config.ts
import { defineConfig } from 'drizzle-kit';
export default defineConfig({
dialect: 'gel',
schema: './dbschema', // Contains my .gel files (e.g., identity.gel)
out: './migrations',
dbCredentials: { // Added to handle connection during pull
host: 'localhost', // Connecting to local EdgeDB instance
port: 5657, // My local EdgeDB port
user: 'admin',
password: 'xxxxxxxx',
database: 'server-infra-a',
tlsSecurity: 'insecure' // Using insecure for local dev with self-signed cert
}
});`
My EdgeDB schema exists in files like dbschema/identity.gel and defines modules and types (e.g., module identity { type User { ... } }).
My runtime connection using the gel client in my application code (src/db.ts) works correctly.
Issues Encountered:
npx drizzle-kit pull: When I run this command, expecting it to introspect the EdgeDB schema, I get the following error: Pulling from ['public'] list of schemas [info] 0 tables fetching ... (other fetching lines) TypeError: Cannot read properties of undefined (reading 'querySQL') at Object.query (...) at fromDatabase5 (...) at introspectGel (...) ...
npx drizzle-kit generate: Based on the documentation/common usage for other dialects, I tried this, but received an expected error for Gel: Error You can't use 'generate' command with Gel dialect
Expected Behavior:
I expected drizzle-kit pull to connect to my EdgeDB instance, read the schema defined in my .gel files, and generate corresponding Drizzle schema definitions (TypeScript objects/tables) in a file (e.g., drizzle/schema.ts), similar to how it works with PostgreSQL or other dialects.
Questions:
Is drizzle-kit pull expected to work with the Gel dialect to generate a Drizzle schema (schema.ts) from existing .gel files at this time?
Is the TypeError: Cannot read properties of undefined (reading 'querySQL') encountered during pull a known issue, a configuration error on my part, or an indication that this feature isn't fully implemented for Gel yet?
Given generate is explicitly disallowed for Gel, what is the intended Drizzle Kit workflow for managing/generating schema definitions when using the EdgeDB/Gel dialect if pull is also not functional?
Are there plans to enhance drizzle-kit pull or introduce an alternative mechanism for generating Drizzle schema definitions from EdgeDB schemas?
Environment:
drizzle-orm
drizzle-kit
EdgeDB/gel (In docker container)
Node.js
Thanks in advance for any insights or guidance the community can provide!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Drizzle community,
First off, loving Drizzle ORM! I'm currently integrating it with EdgeDB using the Gel dialect and have run into a couple of roadblocks regarding schema generation with Drizzle Kit. I'm hoping to get some clarification on the intended workflow.
My goal is to generate Drizzle schema definitions (like a schema.ts file) based on my existing EdgeDB schema defined in .gel files within my dbschema directory.
Setup:
My drizzle.config.ts looks like this
`// drizzle.config.ts
import { defineConfig } from 'drizzle-kit';
export default defineConfig({
dialect: 'gel',
schema: './dbschema', // Contains my .gel files (e.g., identity.gel)
out: './migrations',
dbCredentials: { // Added to handle connection during pull
host: 'localhost', // Connecting to local EdgeDB instance
port: 5657, // My local EdgeDB port
user: 'admin',
password: 'xxxxxxxx',
database: 'server-infra-a',
tlsSecurity: 'insecure' // Using insecure for local dev with self-signed cert
}
});`
My EdgeDB schema exists in files like dbschema/identity.gel and defines modules and types (e.g., module identity { type User { ... } }).
My runtime connection using the gel client in my application code (src/db.ts) works correctly.
Issues Encountered:
npx drizzle-kit pull: When I run this command, expecting it to introspect the EdgeDB schema, I get the following error:
Pulling from ['public'] list of schemas [info] 0 tables fetching ... (other fetching lines) TypeError: Cannot read properties of undefined (reading 'querySQL') at Object.query (...) at fromDatabase5 (...) at introspectGel (...) ...
npx drizzle-kit generate: Based on the documentation/common usage for other dialects, I tried this, but received an expected error for Gel:
Error You can't use 'generate' command with Gel dialect
Expected Behavior:
I expected drizzle-kit pull to connect to my EdgeDB instance, read the schema defined in my .gel files, and generate corresponding Drizzle schema definitions (TypeScript objects/tables) in a file (e.g., drizzle/schema.ts), similar to how it works with PostgreSQL or other dialects.
Questions:
Environment:
Thanks in advance for any insights or guidance the community can provide!
Beta Was this translation helpful? Give feedback.
All reactions