@singlestore/client
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -123,3 +123,3 @@ import * as _singlestore_ai from '@singlestore/ai'; | ||
} | ||
interface WorkspaceTableSchema<T extends WorkspaceTableType> { | ||
interface WorkspaceTableSchema<T extends WorkspaceTableType = WorkspaceTableType> { | ||
name: string; | ||
@@ -206,3 +206,3 @@ columns: { | ||
name: string; | ||
tables: { | ||
tables?: { | ||
[K in keyof T["tables"]]: Omit<WorkspaceTableSchema<T["tables"][K]>, "name">; | ||
@@ -230,3 +230,3 @@ }; | ||
} | ||
declare class WorkspaceDatabase<T extends WorkspaceDatabaseType, _TableNames extends Extract<keyof T["tables"], string> = Extract<keyof T["tables"], string>> { | ||
declare class WorkspaceDatabase<T extends WorkspaceDatabaseType = WorkspaceDatabaseType, _TableNames extends Extract<keyof T["tables"], string> = Extract<keyof T["tables"], string>> { | ||
private _connection; | ||
@@ -261,3 +261,3 @@ name: string; | ||
} | ||
declare class Workspace<T extends WorkspaceType, _DatabaseNames extends Extract<keyof T["databases"], string> = Extract<keyof T["databases"], string>> { | ||
declare class Workspace<T extends WorkspaceType = WorkspaceType, _DatabaseNames extends Extract<keyof T["databases"], string> = Extract<keyof T["databases"], string>> { | ||
connection: WorkspaceConnection; | ||
@@ -264,0 +264,0 @@ name?: string | undefined; |
@@ -464,7 +464,9 @@ "use strict"; | ||
yield connection.client.execute(clauses.join(" ")); | ||
yield Promise.all( | ||
Object.entries(schema.tables).map(([name, tableSchema]) => { | ||
return WorkspaceTable.create(connection, schema.name, __spreadProps(__spreadValues({}, tableSchema), { name })); | ||
}) | ||
); | ||
if (schema.tables) { | ||
yield Promise.all( | ||
Object.entries(schema.tables).map(([name, tableSchema]) => { | ||
return WorkspaceTable.create(connection, schema.name, __spreadProps(__spreadValues({}, tableSchema), { name })); | ||
}) | ||
); | ||
} | ||
return new _WorkspaceDatabase(connection, schema.name, workspaceName, ai); | ||
@@ -471,0 +473,0 @@ }); |
{ | ||
"name": "@singlestore/client", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153471
1423