-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
1,106 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,13 @@ export * as dax from "https://deno.land/x/[email protected]/mod.ts"; | |
export * as safeText from "npm:string-ts"; | ||
|
||
// local: ../../../../../netspective-labs/sql-aide | ||
// remote: https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.20 | ||
// remote: https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.23 | ||
|
||
export * as array from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.20/lib/universal/array.ts"; | ||
export * as chainNB from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.20/lib/notebook/chain-of-responsibility.ts"; | ||
export * as duckdb_shell from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.20/lib/duckdb/mod.ts"; | ||
export * as ws from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.20/lib/universal/whitespace.ts"; | ||
export * as array from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.23/lib/universal/array.ts"; | ||
export * as chainNB from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.23/lib/notebook/chain-of-responsibility.ts"; | ||
export * as duckdb_shell from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.23/lib/duckdb/mod.ts"; | ||
export * as ws from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.23/lib/universal/whitespace.ts"; | ||
|
||
export * as SQLa from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.20/render/mod.ts"; | ||
export * as SQLa_ingest_duckdb from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.20/pattern/ingest/duckdb/mod.ts"; | ||
export * as SQLa from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.23/render/mod.ts"; | ||
export * as SQLa_ingest_duckdb from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.23/pattern/ingest/duckdb/mod.ts"; | ||
export * as SQLa_sqlpage from "https://raw.githubusercontent.com/netspective-labs/sql-aide/v0.11.23/pattern/sqlpage/mod.ts"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { | ||
chainNB, | ||
SQLa_ingest_duckdb as ddbi, | ||
SQLa_sqlpage as sp, | ||
} from "./deps.ts"; | ||
|
||
type SQLPageCell = chainNB.NotebookCell< | ||
SQLPageNotebook, | ||
chainNB.NotebookCellID<SQLPageNotebook> | ||
>; | ||
|
||
const nbDescr = new chainNB.NotebookDescriptor< | ||
SQLPageNotebook, | ||
SQLPageCell | ||
>(); | ||
|
||
// see https://sql.ophir.dev/documentation.sql?component=debug#component | ||
|
||
export class SQLPageNotebook { | ||
readonly tc: ReturnType<typeof sp.typicalContent<ddbi.IngestEmitContext>>; | ||
readonly comps = sp.typicalComponents<string, ddbi.IngestEmitContext>(); | ||
|
||
constructor(readonly govn: ddbi.IngestGovernance) { | ||
this.tc = sp.typicalContent(govn.SQL); | ||
} | ||
|
||
@nbDescr.disregard() | ||
shell() { | ||
return this.govn.SQL` | ||
SELECT | ||
'shell' as component, | ||
'book' as icon, | ||
'QCS Ingestion Center' as title, | ||
'/' as link, | ||
'issues' as menu_item, | ||
'schema' as menu_item`; | ||
} | ||
|
||
"index.sql"() { | ||
// passing in `chainNB.NotebookCellID<SQLPageNotebook>` allows us to restrict | ||
// menu hrefs to this notebook's cell names (the pages in SQLPage) | ||
const { list, listItem: li } = sp.typicalComponents< | ||
chainNB.NotebookCellID<SQLPageNotebook>, | ||
ddbi.IngestEmitContext | ||
>(); | ||
|
||
// deno-fmt-ignore | ||
return this.govn.SQL` | ||
${this.shell()} | ||
${list({ items: [ | ||
li({ title: "Ingestion Issues", link: "issues.sql" }), | ||
li({ title: "Ingestion State Schema", link: "schema.sql" }), | ||
]})}`; | ||
} | ||
|
||
"issues.sql"() { | ||
// deno-fmt-ignore | ||
return this.govn.SQL` | ||
${this.shell()} | ||
SELECT 'table' as component; | ||
SELECT issue_type, issue_message, invalid_value, remediation | ||
FROM "ingest_session_issue"; | ||
`; | ||
} | ||
|
||
"schema.sql"() { | ||
return this.govn.SQL` | ||
${this.shell()} | ||
${this.tc.infoSchemaSQL()} | ||
`; | ||
} | ||
|
||
static create(govn: ddbi.IngestGovernance) { | ||
return sp.sqlPageNotebook( | ||
SQLPageNotebook.prototype, | ||
() => new SQLPageNotebook(govn), | ||
() => govn.emitCtx, | ||
nbDescr, | ||
); | ||
} | ||
} |
Oops, something went wrong.