Skip to content

Commit 1eb8e02

Browse files
committed
Better Names for Schema
1 parent 2f4fc90 commit 1eb8e02

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

src/app/drive-contents.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import { ChevronRight, Upload } from "lucide-react";
44
import Link from "next/link";
55

66
import { Button } from "~/components/ui/button";
7-
import type { files, folders } from "~/server/db/schema";
7+
import type { files_table, folders_table } from "~/server/db/schema";
88

99
import { FileRow, FolderRow } from "./file-row";
1010

1111
export default function DriveContents(props: {
12-
files: (typeof files.$inferSelect)[];
13-
folders: (typeof folders.$inferSelect)[];
14-
parents: (typeof folders.$inferSelect)[];
12+
files: (typeof files_table.$inferSelect)[];
13+
folders: (typeof folders_table.$inferSelect)[];
14+
parents: (typeof folders_table.$inferSelect)[];
1515
}) {
1616
const handleUpload = () => {
1717
alert("Upload functionality would be implemented here");

src/app/f/[folderId]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { z } from "zod";
33

44
import { db } from "~/server/db";
55
import {
6-
files as fileSchema,
7-
folders as folderSchema,
6+
files_table as fileSchema,
7+
folders_table as folderSchema,
88
} from "~/server/db/schema";
99

1010
import DriveContents from "../../drive-contents";

src/app/file-row.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { FileIcon, Folder as FolderIcon } from "lucide-react";
22
import Link from "next/link";
33

4-
import type { files, folders } from "~/server/db/schema";
4+
import type { files_table, folders_table } from "~/server/db/schema";
55

6-
export function FileRow(props: { file: typeof files.$inferSelect }) {
6+
export function FileRow(props: { file: typeof files_table.$inferSelect }) {
77
const { file } = props;
88

99
return (
@@ -29,7 +29,9 @@ export function FileRow(props: { file: typeof files.$inferSelect }) {
2929
);
3030
}
3131

32-
export function FolderRow(props: { folder: typeof folders.$inferSelect }) {
32+
export function FolderRow(props: {
33+
folder: typeof folders_table.$inferSelect;
34+
}) {
3335
const { folder } = props;
3436

3537
return (

src/server/db/schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88

99
const createTable = singlestoreTableCreator((name) => `drive_tutorial_${name}`);
1010

11-
export const files = createTable(
11+
export const files_table = createTable(
1212
"files",
1313
{
1414
id: bigint("id", { mode: "number", unsigned: true })
@@ -22,7 +22,7 @@ export const files = createTable(
2222
(table) => [index("parent_index").on(table.parent)],
2323
);
2424

25-
export const folders = createTable(
25+
export const folders_table = createTable(
2626
"folders",
2727
{
2828
id: bigint("id", { mode: "number", unsigned: true })

0 commit comments

Comments
 (0)