// schemaexport const usersTable = sqliteTable("users", { id: text("id").primaryKey(), username: text("username"), // otros campos...});export const followsTable = sqliteTable( "follows", { followerId: text("follower_id").references(() => usersTable.id), followingId: text("following_id").references(() => usersTable.id), createdAt: text("created_at").default(sql`(CURRENT_TIMESTAMP)`), }, (followsTable) => ({ id: primaryKey([followsTable.followerId, followsTable.followingId]), }));
import { db } from "../../../db/db";import { EdarErr } from "../../../error/EdarErr";import { Uuid } from "../../../types";export const getAccountService = async (id: Uuid) => { const account = await db.query.usersTable.findFirst({ where: (user, { eq }) => eq(user.id, id), with: { ?: true }, }); if (!account) throw new EdarErr(404, "Account not found"); return account;};