generated from t3-oss/create-t3-turbo
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Tipagem e ajustes no package/db
- Loading branch information
1 parent
c878ff3
commit 26facc0
Showing
15 changed files
with
119 additions
and
112 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { Config } from "drizzle-kit"; | ||
|
||
import { connectionStr } from "./src/client"; | ||
|
||
export default { | ||
schema: "./src/schema", | ||
dialect: "postgresql", | ||
dbCredentials: { url: connectionStr.href }, | ||
tablesFilter: ["ponto_*"], | ||
} satisfies Config; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* eslint-disable no-restricted-properties */ | ||
|
||
import { createEnv } from "@t3-oss/env-core"; | ||
import { z } from "zod"; | ||
|
||
export const env = createEnv({ | ||
server: { | ||
DB_HOST: z.string(), | ||
DB_NAME: z.string(), | ||
DB_USERNAME: z.string(), | ||
DB_PASSWORD: z.string(), | ||
}, | ||
runtimeEnv: process.env, | ||
emptyStringAsUndefined: true, | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import baseConfig from "@acme/eslint-config/base"; | ||
import baseConfig, { restrictEnvAccess } from "@acme/eslint-config/base"; | ||
|
||
/** @type {import('typescript-eslint').Config} */ | ||
export default [ | ||
{ | ||
ignores: ["dist/**"], | ||
}, | ||
...baseConfig, | ||
...restrictEnvAccess, | ||
]; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { neon } from "@neondatabase/serverless"; | ||
import { drizzle } from "drizzle-orm/neon-http"; | ||
|
||
import { schema } from "."; | ||
import { env } from "../env"; | ||
|
||
export const connectionStr = new URL( | ||
`postgresql://${env.DB_HOST}/${env.DB_NAME}`, | ||
); | ||
connectionStr.username = env.DB_USERNAME; | ||
connectionStr.password = env.DB_PASSWORD; | ||
connectionStr.searchParams.set("sslmode", "require"); | ||
|
||
const neonClient = neon(connectionStr.href); | ||
export const db = drizzle(neonClient, { schema }); |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
import { neon } from "@neondatabase/serverless"; | ||
import { drizzle } from "drizzle-orm/neon-http"; | ||
|
||
import { connectionStr } from "./config"; | ||
import * as auth from "./schema/auth"; | ||
import * as team from "./schema/team"; | ||
|
||
export { alias } from "drizzle-orm/pg-core"; | ||
export * from "drizzle-orm/sql"; | ||
|
||
export const schema = { ...auth, ...team }; | ||
|
||
const neonClient = neon(connectionStr.href); | ||
export const db = drizzle(neonClient, { schema }); |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.