Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
// ── Community queries: people — a profile by username ──
// One of the files server/queries.ts is assembled from (2026-09). Bodies are
// unchanged from the single 1,364-line file they came out of.
import { eq } from "drizzle-orm";
import { getDb } from "../db";
import { user } from "../schema";
export async function getUserByUsername(usernameLower: string) {
const db = getDb();
const rows = await db
.select({
id: user.id,
username: user.username,
displayUsername: user.displayUsername,
createdAt: user.createdAt,
})
.from(user)
.where(eq(user.username, usernameLower))
.limit(1);
return rows[0] ?? null;
}
ea39f3ad2This file is pinned to the selected release. Download the original to open it in your design tool.