• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / storage / 30076416950

24 Jul 2026 07:43AM UTC coverage: 80.268% (-0.1%) from 80.395%
30076416950

Pull #1230

github

web-flow
Merge 71d199328 into e845f9989
Pull Request #1230: feat: Added separate Database application.

5862 of 7870 branches covered (74.49%)

Branch coverage included in aggregate %.

527 of 634 new or added lines in 22 files covered. (83.12%)

11235 of 13430 relevant lines covered (83.66%)

420.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.1
/src/internal/database/postgres/sql.ts
1
import { DatabaseStatement } from '../connection'
2

3
const POSTGRES_IDENTIFIER_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/
144✔
4

5
export function quoteIdentifier(identifier: string): string {
6
  if (!POSTGRES_IDENTIFIER_PATTERN.test(identifier)) {
20,416✔
7
    throw new Error(`Invalid PostgreSQL identifier: ${identifier}`)
3✔
8
  }
9

10
  return `"${identifier}"`
20,413✔
11
}
12

13
export function quoteQualifiedIdentifier(tableName: string): string {
14
  const [schema, name, ...rest] = tableName.split('.')
24✔
15

16
  if (!schema || !name || rest.length > 0) {
24✔
17
    throw new Error(`Invalid PostgreSQL table name: ${tableName}`)
2✔
18
  }
19

20
  return `${quoteIdentifier(schema)}.${quoteIdentifier(name)}`
22✔
21
}
22

23
export function normalizeStatement(
24
  statement: string | DatabaseStatement,
25
  values?: unknown[]
26
): DatabaseStatement {
27
  if (typeof statement === 'string') {
19,287✔
28
    return { text: statement, values }
8,167✔
29
  }
30

31
  return statement
11,120✔
32
}
33

34
export function normalizeIsolationLevel(isolation?: string): string | undefined {
35
  switch (isolation?.toLowerCase()) {
3,709!
36
    case 'read committed':
NEW
37
      return 'READ COMMITTED'
×
38
    case 'repeatable read':
39
      return 'REPEATABLE READ'
1✔
40
    case 'serializable':
41
      return 'SERIALIZABLE'
1✔
42
    default:
43
      return undefined
3,707✔
44
  }
45
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc