(channel: string, operation: string)
| 23 | const channelNameEncoder = new TextEncoder() |
| 24 | |
| 25 | export const validateChannelName = (channel: string, operation: string): SqlError | undefined => { |
| 26 | if (channelNameEncoder.encode(channel).byteLength <= 63) return undefined |
| 27 | const message = "PostgreSQL channel names must not exceed 63 UTF-8 bytes" |
| 28 | return new SqlError({ reason: new UnknownError({ cause: new Error(message), message, operation }) }) |
| 29 | } |
| 30 | |
| 31 | const normalizeConstraint = (constraint: unknown): string => { |
| 32 | if (typeof constraint !== "string") return "unknown" |
no test coverage detected