chore: fix module import | add extension
requires extension because no bundler in this package
This commit is contained in:
parent
90cfaca2d8
commit
7d4b49a0e5
6 changed files with 13 additions and 9 deletions
|
|
@ -14,7 +14,11 @@ try {
|
||||||
console.warn("Failed to decode DATABASE_URL, using as is.");
|
console.warn("Failed to decode DATABASE_URL, using as is.");
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Connecting to database URL:", db_url);
|
const maskedUrl = db_url.replace(
|
||||||
|
/(postgresql:\/\/[^:]+:)[^@]+(@[^\/]+)/,
|
||||||
|
'$1***$2'
|
||||||
|
);
|
||||||
|
console.log("Connecting to database URL:", maskedUrl);
|
||||||
|
|
||||||
const client = postgres(db_url!);
|
const client = postgres(db_url!);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
export * from "./queries/users";
|
export * from "./queries/users.ts";
|
||||||
export * from "./queries/products";
|
export * from "./queries/products.ts";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
import { db } from "../database.ts";
|
||||||
|
import { type InsertProduct, products } from "../schema/products.ts";
|
||||||
import { count, desc } from "drizzle-orm";
|
import { count, desc } from "drizzle-orm";
|
||||||
import { db } from "../database";
|
|
||||||
import { InsertProduct, products } from "../schema/products";
|
|
||||||
|
|
||||||
export async function createProduct(data: InsertProduct) {
|
export async function createProduct(data: InsertProduct) {
|
||||||
await db.insert(products).values(data);
|
await db.insert(products).values(data);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { db } from "../database";
|
import { db } from "../database.ts";
|
||||||
import { InsertUser, users } from "../schema/users";
|
import { type InsertUser, users } from "../schema/users.ts";
|
||||||
import { eq } from "drizzle-orm";
|
import { eq } from "drizzle-orm";
|
||||||
|
|
||||||
export async function createUser(data: InsertUser) {
|
export async function createUser(data: InsertUser) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { pgTable, serial, text, numeric, boolean } from "drizzle-orm/pg-core";
|
import { pgTable, serial, text, numeric, boolean } from "drizzle-orm/pg-core";
|
||||||
import { timestamps } from "./column.helpers";
|
import { timestamps } from "./column.helpers.ts";
|
||||||
|
|
||||||
export const products = pgTable("products", {
|
export const products = pgTable("products", {
|
||||||
id: serial("id").primaryKey(),
|
id: serial("id").primaryKey(),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { pgTable, text } from "drizzle-orm/pg-core";
|
import { pgTable, text } from "drizzle-orm/pg-core";
|
||||||
import { timestamps } from "./column.helpers";
|
import { timestamps } from "./column.helpers.ts";
|
||||||
|
|
||||||
export const users = pgTable("users", {
|
export const users = pgTable("users", {
|
||||||
id: text("id").primaryKey(), // Clerk user ID
|
id: text("id").primaryKey(), // Clerk user ID
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue