chore: fix module import | add extension

requires extension because no bundler in this package
This commit is contained in:
afiqzudinhadi 2025-07-10 22:59:00 +08:00
parent 90cfaca2d8
commit 7d4b49a0e5
6 changed files with 13 additions and 9 deletions

View file

@ -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!);

View file

@ -1,2 +1,2 @@
export * from "./queries/users"; export * from "./queries/users.ts";
export * from "./queries/products"; export * from "./queries/products.ts";

View file

@ -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);

View file

@ -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) {

View file

@ -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(),

View file

@ -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