@@ -25,8 +25,7 @@ Promise<{ data: Interfaces.Schema[]; error: null | Error }> {
25
25
try {
26
26
let query = SQL `` . append ( allSchemasSql )
27
27
if ( ! include_system_schemas ) {
28
- query . append ( ` and schema_name not in (${ defaultSchemasList } )` )
29
- console . log ( 'query' , query )
28
+ query . append ( ` and n.nspname not in (${ defaultSchemasList } )` )
30
29
}
31
30
const { data, error } = await RunQuery < Interfaces . Schema > ( connection , query )
32
31
if ( error ) throw error
@@ -48,7 +47,7 @@ export async function byId(
48
47
) : /** Returns a single schemas */
49
48
Promise < { data : Interfaces . Schema ; error : null | Error } > {
50
49
try {
51
- const query = SQL `` . append ( allSchemasSql ) . append ( SQL ` where nsp.oid = ${ id } ` )
50
+ const query = SQL `` . append ( allSchemasSql ) . append ( SQL ` and nsp.oid = ${ id } ` )
52
51
const { data } = await RunQuery < Interfaces . Schema > ( connection , query )
53
52
return { data : data [ 0 ] , error : null }
54
53
} catch ( error ) {
@@ -68,7 +67,7 @@ export async function byName(
68
67
) : /** Returns a single schemas */
69
68
Promise < { data : Interfaces . Schema ; error : null | Error } > {
70
69
try {
71
- const query = SQL `` . append ( allSchemasSql ) . append ( SQL ` where schema_name = ${ name } ` )
70
+ const query = SQL `` . append ( allSchemasSql ) . append ( SQL ` and n.nspname = ${ name } ` )
72
71
const { data } = await RunQuery < Interfaces . Schema > ( connection , query )
73
72
return { data : data [ 0 ] , error : null }
74
73
} catch ( error ) {
0 commit comments