feat: sql-tools overrides (#19796)

This commit is contained in:
Jason Rasmussen
2025-07-08 08:17:40 -04:00
committed by GitHub
parent 1f9813a28e
commit df4a27e8a7
114 changed files with 775 additions and 289 deletions
@@ -1,6 +1,6 @@
import { DatabaseReader } from 'src/sql-tools/types';
import { Reader } from 'src/sql-tools/types';
export const readComments: DatabaseReader = async (schema, db) => {
export const readComments: Reader = async (ctx, db) => {
const comments = await db
.selectFrom('pg_description as d')
.innerJoin('pg_class as c', 'd.objoid', 'c.oid')
@@ -20,7 +20,7 @@ export const readComments: DatabaseReader = async (schema, db) => {
for (const comment of comments) {
if (comment.object_type === 'r') {
const table = schema.tables.find((table) => table.name === comment.object_name);
const table = ctx.getTableByName(comment.object_name);
if (!table) {
continue;
}