(ns: string)
| 426 | if (namespace !== "primary" && !config.allowNamespace!(namespace)) { |
| 427 | throw new Error(`Namespace ${namespace} not allowed!`) |
| 428 | } |
| 429 | return namespace |
| 430 | })) |
| 431 | |
| 432 | const toRow = (e: PM) => { |
| 433 | const newE = makeETag(e) |
| 434 | const id = newE[idKey] as string |
| 435 | const { _etag, [idKey]: _id, ...rest } = newE as any |
| 436 | const data = JSON.stringify(rest) |
| 437 | return { id, _etag: newE._etag!, data, item: newE } |
| 438 | } |
| 439 | |
| 440 | const exec = (ns: string, query: string, params?: readonly unknown[]) => |
| 441 | withNsSql(ns, (sql) => sql.unsafe(query, params as any).pipe(Effect.mapError(toDatabaseError))) |
| 442 | |
| 443 | const ensureTable = (ns: string) => |
| 444 | withNsSql(ns, (sql) => |
| 445 | sql |
no test coverage detected
searching dependent graphs…