This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Converts a character to a value between 0 and 25 | |
function toIndex(char) { | |
return (char.charCodeAt(0) + 26 - 97) % 26; | |
} | |
// Converts a number from 0 to 25 back into a character | |
function fromIndex(idx) { | |
return String.fromCharCode(((idx + 26) % 26) + 97); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PrismaClient } from '@prisma/client'; | |
import type { User } from '@prisma/client'; | |
import { createPool, sql } from 'slonik'; | |
export const buildBaseConnectionURL = (config) => { | |
return ( | |
'postgresql://' + | |
config.DB_USER + | |
':' + | |
config.DB_PASS + |