Skip to content

Commit 0c9d1f1

Browse files
committed
init package contents
1 parent a0ec279 commit 0c9d1f1

10 files changed

Lines changed: 12558 additions & 8 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,4 @@ lib
106106
deps/mermaid
107107
samples/output.md
108108
junit.xml
109+
output-*.json

.vscode/launch.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "example sqlite",
11+
"program": "${workspaceFolder}\\examples\\examples_sqlite.ts",
12+
"preLaunchTask": "npm: build",
13+
"sourceMaps": true,
14+
"smartStep": true,
15+
"internalConsoleOptions": "openOnSessionStart",
16+
"outFiles": [
17+
"${workspaceFolder}/lib/**/*.js"
18+
],
19+
"args": []
20+
},
21+
{
22+
"type": "node",
23+
"request": "launch",
24+
"name": "Jest single run",
25+
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
26+
"args": [
27+
"-c",
28+
"./jest.config.ts",
29+
"--verbose",
30+
"-i",
31+
"--no-cache"
32+
],
33+
"console": "integratedTerminal",
34+
"internalConsoleOptions": "neverOpen"
35+
},
36+
{
37+
"type": "node",
38+
"request": "launch",
39+
"name": "Jest watch run",
40+
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
41+
"args": [
42+
"-c",
43+
"./jest.config.ts",
44+
"--verbose",
45+
"-i",
46+
"--no-cache",
47+
"--watchAll"
48+
],
49+
"console": "integratedTerminal",
50+
"internalConsoleOptions": "neverOpen"
51+
}
52+
]
53+
}
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
/*
2+
sql generated using:
3+
* Package: little-mermaid-2-the-sql
4+
* Version: 0.0.3
5+
* databaseInfo: sqlite
6+
*/
7+
8+
CREATE TABLE "Artist" (
9+
"ArtistId" INTEGER NOT NULL,
10+
"Name" NVARCHAR(120),
11+
PRIMARY KEY("ArtistId")
12+
)
13+
14+
CREATE TABLE "Employee" (
15+
"EmployeeId" INTEGER NOT NULL,
16+
"LastName" NVARCHAR(20) NOT NULL,
17+
"FirstName" NVARCHAR(20) NOT NULL,
18+
"Title" NVARCHAR(30),
19+
"ReportsTo" INTEGER,
20+
"BirthDate" DATETIME,
21+
"HireDate" DATETIME,
22+
"Address" NVARCHAR(70),
23+
"City" NVARCHAR(40),
24+
"State" NVARCHAR(40),
25+
"Country" NVARCHAR(40),
26+
"PostalCode" NVARCHAR(10),
27+
"Phone" NVARCHAR(24),
28+
"Fax" NVARCHAR(24),
29+
"Email" NVARCHAR(60),
30+
PRIMARY KEY("EmployeeId")
31+
)
32+
33+
CREATE TABLE "Genre" (
34+
"GenreId" INTEGER NOT NULL,
35+
"Name" NVARCHAR(120),
36+
PRIMARY KEY("GenreId")
37+
)
38+
39+
CREATE TABLE "MediaType" (
40+
"MediaTypeId" INTEGER NOT NULL,
41+
"Name" NVARCHAR(120),
42+
PRIMARY KEY("MediaTypeId")
43+
)
44+
45+
CREATE TABLE "Playlist" (
46+
"PlaylistId" INTEGER NOT NULL,
47+
"Name" NVARCHAR(120),
48+
PRIMARY KEY("PlaylistId")
49+
)
50+
51+
CREATE TABLE "Album" (
52+
"AlbumId" INTEGER NOT NULL,
53+
"Title" NVARCHAR(160) NOT NULL,
54+
"ArtistId" INTEGER NOT NULL,
55+
PRIMARY KEY("AlbumId"),
56+
FOREIGN KEY ("ArtistId") REFERENCES "Artist"("ArtistId")
57+
)
58+
59+
CREATE TABLE "Customer" (
60+
"CustomerId" INTEGER NOT NULL,
61+
"FirstName" NVARCHAR(40) NOT NULL,
62+
"LastName" NVARCHAR(20) NOT NULL,
63+
"Company" NVARCHAR(80),
64+
"Address" NVARCHAR(70),
65+
"City" NVARCHAR(40),
66+
"State" NVARCHAR(40),
67+
"Country" NVARCHAR(40),
68+
"PostalCode" NVARCHAR(10),
69+
"Phone" NVARCHAR(24),
70+
"Fax" NVARCHAR(24),
71+
"Email" NVARCHAR(60) NOT NULL,
72+
"SupportRepId" INTEGER,
73+
PRIMARY KEY("CustomerId"),
74+
FOREIGN KEY ("SupportRepId") REFERENCES "Employee"("EmployeeId")
75+
)
76+
77+
CREATE TABLE "test_table" (
78+
"id" INTEGER NOT NULL,
79+
"Field 2_2" TEXT,
80+
"Artist Id" INTEGER,
81+
PRIMARY KEY("id"),
82+
FOREIGN KEY ("Artist Id") REFERENCES "Artist"("ArtistId")
83+
)
84+
85+
CREATE TABLE "Invoice" (
86+
"InvoiceId" INTEGER NOT NULL,
87+
"CustomerId" INTEGER NOT NULL,
88+
"InvoiceDate" DATETIME NOT NULL,
89+
"BillingAddress" NVARCHAR(70),
90+
"BillingCity" NVARCHAR(40),
91+
"BillingState" NVARCHAR(40),
92+
"BillingCountry" NVARCHAR(40),
93+
"BillingPostalCode" NVARCHAR(10),
94+
"Total" NUMERIC(10,2) NOT NULL,
95+
PRIMARY KEY("InvoiceId"),
96+
FOREIGN KEY ("CustomerId") REFERENCES "Customer"("CustomerId")
97+
)
98+
99+
CREATE TABLE "Track" (
100+
"TrackId" INTEGER NOT NULL,
101+
"Name" NVARCHAR(200) NOT NULL,
102+
"AlbumId" INTEGER,
103+
"MediaTypeId" INTEGER NOT NULL,
104+
"GenreId" INTEGER,
105+
"Composer" NVARCHAR(220),
106+
"Milliseconds" INTEGER NOT NULL,
107+
"Bytes" INTEGER,
108+
"UnitPrice" NUMERIC(10,2) NOT NULL,
109+
PRIMARY KEY("TrackId"),
110+
FOREIGN KEY ("AlbumId") REFERENCES "Album"("AlbumId"),
111+
FOREIGN KEY ("GenreId") REFERENCES "Genre"("GenreId"),
112+
FOREIGN KEY ("MediaTypeId") REFERENCES "MediaType"("MediaTypeId")
113+
)
114+
115+
CREATE TABLE "InvoiceLine" (
116+
"InvoiceLineId" INTEGER NOT NULL,
117+
"InvoiceId" INTEGER NOT NULL,
118+
"TrackId" INTEGER NOT NULL,
119+
"UnitPrice" NUMERIC(10,2) NOT NULL,
120+
"Quantity" INTEGER NOT NULL,
121+
PRIMARY KEY("InvoiceLineId"),
122+
FOREIGN KEY ("InvoiceId") REFERENCES "Invoice"("InvoiceId"),
123+
FOREIGN KEY ("TrackId") REFERENCES "Track"("TrackId")
124+
)
125+
126+
CREATE TABLE "PlaylistTrack" (
127+
"PlaylistId" INTEGER NOT NULL,
128+
"TrackId" INTEGER NOT NULL,
129+
PRIMARY KEY("PlaylistId","TrackId"),
130+
FOREIGN KEY ("PlaylistId") REFERENCES "Playlist"("PlaylistId"),
131+
FOREIGN KEY ("TrackId") REFERENCES "Track"("TrackId")
132+
)
133+

jest.config.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import type { Config } from "jest";
2+
3+
const config: Config = {
4+
verbose: true,
5+
globals: {
6+
"ts-jest": {
7+
tsConfig: "tsconfig.json",
8+
},
9+
},
10+
moduleFileExtensions: ["ts", "js"],
11+
transform: {
12+
"^.+\\.(ts|tsx)$": "ts-jest",
13+
},
14+
testMatch: ["**/tests/**/*.spec.(ts|js)"],
15+
testPathIgnorePatterns: ["sql-ddl-to-json-schema/"],
16+
// runner: "jest-serial-runner",
17+
// testEnvironment: "node",
18+
reporters: ["default", "jest-junit"],
19+
collectCoverageFrom: ["src/**/*.{ts,js}", "!**/node_modules/**", "!**/lib/**"]
20+
};
21+
22+
export default config;
23+
24+
// module.exports = {
25+
// // [...]
26+
// // Replace `ts-jest` with the preset you want to use
27+
// // from the above list
28+
// preset: 'ts-jest'
29+
// };

0 commit comments

Comments
 (0)