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 {
9898 } ) : Promise < PostgresMetaResult < PostgresColumn [ ] > > {
9999 if ( ids && ids . length > 0 ) {
100100 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+
101107 const filteringClauses = ids
102108 . map ( ( id ) => {
103- if ( ! regexp . test ( id ) ) {
104- return { data : null , error : { message : 'Invalid format for column ID' } }
105- }
106109 const matches = id . match ( regexp ) as RegExpMatchArray
107110 const [ tableId , ordinalPos ] = matches . slice ( 1 ) . map ( Number )
108111 return `(c.oid = ${ tableId } AND a.attnum = ${ ordinalPos } )`
You can’t perform that action at this time.
0 commit comments