sql-typechecker 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/.envrc +0 -2
- package/esbuild.js +0 -12
- package/index.ts +0 -22
- package/sample/nested/sample2.sql +0 -26
- package/sample/out.ts +0 -70
- package/sample/sample1.sql +0 -20
- package/school/sql.sql +0 -1055
- package/school/test.ts +0 -27
- package/shell.nix +0 -16
- package/src/builtincasts.ts +0 -277
- package/src/builtinoperators.ts +0 -5144
- package/src/builtinunaryoperators.ts +0 -291
- package/src/cli.ts +0 -144
- package/src/codegen.ts +0 -384
- package/src/readme.md +0 -23
- package/src/typecheck.ts +0 -2143
- package/src/typeparsers.ts +0 -33
- package/template1.sql +0 -43
- package/test/test.ts +0 -1378
- package/tsconfig.json +0 -23
package/src/typeparsers.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { types } from "pg";
|
|
2
|
-
import array from "postgres-array";
|
|
3
|
-
import range from "postgres-range";
|
|
4
|
-
|
|
5
|
-
// We basically disable most parsing by 'pg', so we can do the parsing
|
|
6
|
-
// ourselves in the generated code
|
|
7
|
-
export function registerSqlTypecheckerTypeParsers() {
|
|
8
|
-
// "date" format: 2020-10-28
|
|
9
|
-
types.setTypeParser(types.builtins.DATE, (val) => val);
|
|
10
|
-
|
|
11
|
-
// "time" format: 17:30:00
|
|
12
|
-
types.setTypeParser(types.builtins.TIME, (val) => val);
|
|
13
|
-
|
|
14
|
-
// "timestamp without time zone" 2020-09-22T15:09:09.145
|
|
15
|
-
types.setTypeParser(types.builtins.TIMESTAMP, (val) => val);
|
|
16
|
-
|
|
17
|
-
// "timestamp with time zone" 2022-06-23T15:52:39.77314+00:00
|
|
18
|
-
types.setTypeParser(types.builtins.TIMESTAMPTZ, (val) => val);
|
|
19
|
-
|
|
20
|
-
types.setTypeParser(types.builtins.TIMESTAMPTZ, (val) => val);
|
|
21
|
-
types.setTypeParser(1115, array.parse); // timestamp without time zone[]
|
|
22
|
-
types.setTypeParser(1182, array.parse); // date[]
|
|
23
|
-
types.setTypeParser(1185, array.parse); // timestamp with time zone[]
|
|
24
|
-
|
|
25
|
-
types.setTypeParser(1183, array.parse); // time[]
|
|
26
|
-
types.setTypeParser(1270, array.parse); // timetz[]
|
|
27
|
-
|
|
28
|
-
// https://www.npmjs.com/package/postgres-range
|
|
29
|
-
// Range includes Included/Excluded bounds specification!
|
|
30
|
-
types.setTypeParser(3908, range.parse); // tsrange
|
|
31
|
-
types.setTypeParser(3910, range.parse); // tstzrange
|
|
32
|
-
types.setTypeParser(3912, range.parse); // daterange
|
|
33
|
-
}
|
package/template1.sql
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
--
|
|
2
|
-
-- PostgreSQL database dump
|
|
3
|
-
--
|
|
4
|
-
|
|
5
|
-
-- Dumped from database version 9.6.21
|
|
6
|
-
-- Dumped by pg_dump version 9.6.21
|
|
7
|
-
|
|
8
|
-
SET statement_timeout = 0;
|
|
9
|
-
SET lock_timeout = 0;
|
|
10
|
-
SET idle_in_transaction_session_timeout = 0;
|
|
11
|
-
SET client_encoding = 'UTF8';
|
|
12
|
-
SET standard_conforming_strings = on;
|
|
13
|
-
SELECT pg_catalog.set_config('search_path', '', false);
|
|
14
|
-
SET check_function_bodies = false;
|
|
15
|
-
SET xmloption = content;
|
|
16
|
-
SET client_min_messages = warning;
|
|
17
|
-
SET row_security = off;
|
|
18
|
-
|
|
19
|
-
--
|
|
20
|
-
-- Name: DATABASE template1; Type: COMMENT; Schema: -; Owner: postgres
|
|
21
|
-
--
|
|
22
|
-
|
|
23
|
-
COMMENT ON DATABASE template1 IS 'default template for new databases';
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
--
|
|
27
|
-
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
|
|
28
|
-
--
|
|
29
|
-
|
|
30
|
-
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
--
|
|
34
|
-
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
|
|
35
|
-
--
|
|
36
|
-
|
|
37
|
-
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
--
|
|
41
|
-
-- PostgreSQL database dump complete
|
|
42
|
-
--
|
|
43
|
-
|