File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -98,11 +98,14 @@ export default class PostgresMetaColumns {
98
98
} ) : Promise < PostgresMetaResult < PostgresColumn [ ] > > {
99
99
if ( ids && ids . length > 0 ) {
100
100
const regexp = / ^ ( \d + ) \. ( \d + ) $ /
101
+
102
+ const invalidId = ids . find ( ( id ) => ! regexp . test ( id ) )
103
+ if ( invalidId ) {
104
+ return { data : null , error : { message : `Invalid format for column ID: ${ invalidId } ` } }
105
+ }
106
+
101
107
const filteringClauses = ids
102
108
. map ( ( id ) => {
103
- if ( ! regexp . test ( id ) ) {
104
- return { data : null , error : { message : 'Invalid format for column ID' } }
105
- }
106
109
const matches = id . match ( regexp ) as RegExpMatchArray
107
110
const [ tableId , ordinalPos ] = matches . slice ( 1 ) . map ( Number )
108
111
return `(c.oid = ${ tableId } AND a.attnum = ${ ordinalPos } )`
You can’t perform that action at this time.
0 commit comments