Skip to content

Commit

Permalink
Stop escaping table names with a schema defined (#1237)
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper authored Oct 31, 2023
1 parent e0c54c8 commit 4236f00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .auri/$9ry8sulh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
package: "@lucia-auth/adapter-postgresql" # package name
type: "patch" # "major", "minor", "patch"
---

Stop escaping table names with a schema defined
2 changes: 1 addition & 1 deletion packages/adapter-postgresql/src/drivers/postgres.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export async function get<_Schema extends {}>(
export async function getAll<_Schema extends {}>(
queryPromise: PendingQuery<_Schema[]>
) {
return await queryPromise;
return Array.from(await queryPromise);
}

function processException(e: any) {
Expand Down
1 change: 1 addition & 0 deletions packages/adapter-postgresql/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const createPreparedStatementHelper = (
const ESCAPE_CHAR = `"`;

export const escapeName = (val: string) => {
if (val.includes(".")) return val;
return `${ESCAPE_CHAR}${val}${ESCAPE_CHAR}`;
};

Expand Down

0 comments on commit 4236f00

Please sign in to comment.