Skip to content

Commit c0b5382

Browse files
committed
update to latest sdk, finish custom type
Signed-off-by: Aaron Sutula <asutula@users.noreply.github.com>
1 parent dc408e4 commit c0b5382

File tree

7 files changed

+65
-23
lines changed

7 files changed

+65
-23
lines changed

package-lock.json

Lines changed: 49 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"author": "",
1313
"license": "ISC",
1414
"dependencies": {
15-
"@tableland/sdk": "^4.5.1",
15+
"@tableland/sdk": "^4.5.2",
1616
"@tableland/studio-mail": "^0.0.0",
1717
"@tableland/studio-store": "^1.0.0",
1818
"@trpc/server": "^10.38.4",

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
},
4444
"license": "MIT AND Apache-2.0",
4545
"dependencies": {
46-
"@tableland/sdk": "^4.5.1",
46+
"@tableland/sdk": "^4.5.2",
4747
"@tableland/sqlparser": "^1.3.0",
4848
"@tableland/studio-client": "^0.0.0",
4949
"@toruslabs/broadcast-channel": "^8.0.0",

packages/store/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"author": "",
1313
"license": "ISC",
1414
"dependencies": {
15-
"@tableland/sdk": "^4.5.1",
15+
"@tableland/sdk": "^4.5.2",
1616
"drizzle-orm": "^0.28.5",
1717
"iron-session": "^6.3.1"
1818
}

packages/web/components/schema-builder.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from "@/components/ui/table";
99
import { Constraint, hasConstraint, setConstraint } from "@/lib/schema";
1010
import { CheckedState } from "@radix-ui/react-checkbox";
11-
import { schema } from "@tableland/studio-store";
11+
import { Schema } from "@tableland/studio-store";
1212
import { Plus, X } from "lucide-react";
1313
import { Dispatch, SetStateAction } from "react";
1414
import { Button } from "./ui/button";
@@ -31,8 +31,8 @@ export default function SchemaBuilder({
3131
schema,
3232
setSchema,
3333
}: {
34-
schema: schema.Schema;
35-
setSchema: Dispatch<SetStateAction<schema.Schema>>;
34+
schema: Schema;
35+
setSchema: Dispatch<SetStateAction<Schema>>;
3636
}) {
3737
return (
3838
<div className="flex flex-col items-start">
@@ -71,10 +71,7 @@ export default function SchemaBuilder({
7171
setSchema((prev) => {
7272
return {
7373
...prev,
74-
columns: [
75-
...prev.columns,
76-
{ name: "", type: "text", constraints: [] },
77-
],
74+
columns: [...prev.columns, { name: "", type: "text" }],
7875
};
7976
});
8077
}}
@@ -91,7 +88,7 @@ function RemoveColumn({
9188
setSchema,
9289
}: {
9390
columnIndex: number;
94-
setSchema: Dispatch<SetStateAction<schema.Schema>>;
91+
setSchema: Dispatch<SetStateAction<Schema>>;
9592
}) {
9693
return (
9794
<Button
@@ -118,8 +115,8 @@ function CreateColumn({
118115
setSchema,
119116
}: {
120117
columnIndex: number;
121-
schema: schema.Schema;
122-
setSchema: Dispatch<SetStateAction<schema.Schema>>;
118+
schema: Schema;
119+
setSchema: Dispatch<SetStateAction<Schema>>;
123120
}) {
124121
const column = schema.columns[columnIndex];
125122

packages/web/lib/schema.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { schema } from "@tableland/studio-store";
1+
import { Schema } from "@tableland/studio-store";
22

33
export type Constraint = "not null" | "primary key" | "unique";
44

55
export function hasConstraint(
6-
column: schema.Schema["columns"][number],
6+
column: Schema["columns"][number],
77
constraint: Constraint,
88
) {
99
return column.constraints ? column.constraints.includes(constraint) : false;
1010
}
1111

1212
export function setConstraint(
13-
column: schema.Schema["columns"][number],
13+
column: Schema["columns"][number],
1414
constraint: Constraint,
1515
value: boolean,
1616
) {
@@ -25,7 +25,7 @@ export function setConstraint(
2525

2626
export function generateCreateTableStatement(
2727
tableName: string,
28-
schema: schema.Schema,
28+
schema: Schema,
2929
) {
3030
if (!tableName.length) {
3131
return "";
@@ -50,7 +50,7 @@ export function generateCreateTableStatement(
5050
});`;
5151
}
5252

53-
export function cleanSchema(schema: schema.Schema) {
53+
export function cleanSchema(schema: Schema) {
5454
return {
5555
...schema,
5656
columns: schema.columns.filter(

packages/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@radix-ui/react-switch": "^1.0.3",
3131
"@radix-ui/react-toast": "^1.1.4",
3232
"@radix-ui/react-tooltip": "^1.0.6",
33-
"@tableland/sdk": "^4.5.1",
33+
"@tableland/sdk": "^4.5.2",
3434
"@tableland/studio-api": "^1.0.0",
3535
"@tableland/studio-client": "^0.0.0",
3636
"@tableland/studio-store": "^1.0.0",

0 commit comments

Comments
 (0)