Skip to content

Commit

Permalink
fixing cloudflare test
Browse files Browse the repository at this point in the history
  • Loading branch information
invisal committed Oct 22, 2024
1 parent ced0ee1 commit 7e79982
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/connections/sqlite/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,15 @@ export class CloudflareD1Connection extends SqliteBaseConnection {
schema: table.schema,
tableName: table.name,
type: 'FOREIGN KEY',
referenceSchema: table.schema,
referenceTableName: fkConstraintData[0].table,
columns: [],
};

fkConstraintData.forEach((fkConstraint) => {
const currentConstraint: ConstraintColumn = {
columnName: fkConstraint.from,
referenceColumnName: fkConstraint.to,
};
fkConstraints.columns.push(currentConstraint);
});
Expand Down
6 changes: 5 additions & 1 deletion tests/connections/connection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ describe('Database Connection', () => {
expect(actualSchema).toEqual(expectedSchema);

// Check teams and persons table reference
if (!['bigquery', 'mongodb'].includes(process.env.CONNECTION_TYPE!)) {
if (
!['bigquery', 'mongodb', 'motherduck'].includes(
process.env.CONNECTION_TYPE!
)
) {
expect(
schemas[DEFAULT_SCHEMA].persons!.columns!.find(
(c) => c.name === 'team_id'
Expand Down

0 comments on commit 7e79982

Please sign in to comment.