forked from edgedb/edgedb-js
/
consts.ts
59 lines (55 loc) · 2.48 KB
/
consts.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*!
* This source file is part of the EdgeDB open source project.
*
* Copyright 2019-present MagicStack Inc. and the EdgeDB authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
type uuid = string;
export const NULL_CODEC_ID = "00000000000000000000000000000000";
export const INVALID_CODEC_ID = "ffffffffffffffffffffffffffffffff";
export const KNOWN_TYPES = new Map<uuid, string>([
["00000000000000000000000000000001", "anytype"],
["00000000000000000000000000000002", "anytuple"],
["00000000000000000000000000000003", "anyobject"],
["000000000000000000000000000000f0", "std"],
["000000000000000000000000000000ff", "empty-tuple"],
["00000000000000000000000000000100", "std::uuid"],
["00000000000000000000000000000101", "std::str"],
["00000000000000000000000000000102", "std::bytes"],
["00000000000000000000000000000103", "std::int16"],
["00000000000000000000000000000104", "std::int32"],
["00000000000000000000000000000105", "std::int64"],
["00000000000000000000000000000106", "std::float32"],
["00000000000000000000000000000107", "std::float64"],
["00000000000000000000000000000108", "std::decimal"],
["00000000000000000000000000000109", "std::bool"],
["0000000000000000000000000000010a", "std::datetime"],
["0000000000000000000000000000010b", "cal::local_datetime"],
["0000000000000000000000000000010c", "cal::local_date"],
["0000000000000000000000000000010d", "cal::local_time"],
["0000000000000000000000000000010e", "std::duration"],
["0000000000000000000000000000010f", "std::json"],
["00000000000000000000000000000110", "std::bigint"],
["00000000000000000000000000000111", "cal::relative_duration"],
["00000000000000000000000000000112", "cal::date_duration"],
["00000000000000000000000000000130", "cfg::memory"],
["9565dd8804f511eea6910b6ebe179825", "ext::pgvector::vector"],
]);
export const KNOWN_TYPENAMES = (() => {
const res = new Map<string, uuid>();
for (const [id, name] of KNOWN_TYPES.entries()) {
res.set(name, id);
}
return res;
})();