Skip to content

Commit

Permalink
graphql: Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tbantle22 committed Jun 5, 2024
1 parent 4015d5f commit c0686f7
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions graphql-server/src/queryFactory/doltgres/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ export class DoltgresQueryFactory
isDolt = true;

async getTablePKColumns(args: t.TableArgs): Promise<string[]> {
console.log(args, this.ds);
// const res: t.RawRows = await this.query(
// qh.tableColsQuery,
// [args.tableName],
// args.databaseName,
// args.refName,
// );
// return res.filter(c => c.Key === "PRI").map(c => c.Field);
return [];
return this.queryQR(async qr => {
const table = await qr.getTable(`${args.databaseName}.${args.tableName}`);
if (!table) return [];
return table.columns.filter(c => c.isPrimary).map(c => c.name);
}, args.databaseName);
}

async getSchemas(args: t.RefArgs, type?: SchemaType): Promise<SchemaItem[]> {
Expand Down

0 comments on commit c0686f7

Please sign in to comment.