Open RiyeUK opened 6 months ago
What version of the ORM are you using? Do you know if this worked in a previous version?
Hey @L-Mario564 i had this issue too Wanted it fast so i changed your index.cjs to use this
var Columns = Symbol.for("drizzle:Columns");
const pkColumns = wrapColumns(Object.values(index.table[Columns]), this.buildQueryConfig.escapeName);
Also the references are missing the schema's name which you can do it like this
sourceTable: `${relation.sourceTable[Schema]}.${relation.sourceTable[TableName]}`,
foreignTable: `${relation.sourceTable[Schema]}.${relation.referencedTableName}`,
your escapeSpaces
function will introduce quotes to {schema}.{tableName} after adding the schema
so i changed the regex to /\s/
didn't open a PR because i just tested for my own situation but it may help you to handle this
currently using "drizzle-orm": "^0.30.4"
this version for drizzle-orm
With a table defined in the schema as so:
The generated
.dbml
doesn't include anyrefs
for this table:I need to add these lines to the resulting
.dbml
: