deno.land / x / pg_mem@2.8.1 / schema / pg-catalog / pg-database.ts

pg-database.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
import { _ITable, _ISelection, _IIndex, _IDb, _ISchema, _Transaction, setId } from '../../interfaces-private.ts';import { Schema } from '../../interfaces.ts';import { Types } from '../../datatypes/index.ts';import { ReadOnlyTable } from '../readonly-table.ts';
// https://www.postgresql.org/docs/12/catalog-pg-class.html
const IS_SCHEMA = Symbol('_is_pg_database');export class PgDatabaseTable extends ReadOnlyTable implements _ITable {
get ownSymbol() { return IS_SCHEMA; }

_schema: Schema = { name: 'pg_database', fields: [ { name: 'oid', type: Types.integer } // hidden oid column , { name: 'datname', type: Types.text() } , { name: 'datdba', type: Types.integer } , { name: 'encoding', type: Types.integer } , { name: 'datcollate', type: Types.text() } , { name: 'datctype', type: Types.text() } , { name: 'datistemplate', type: Types.bool } , { name: 'datlowconn', type: Types.bool } , { name: 'datconlimit', type: Types.integer } , { name: 'datlastsysoid', type: Types.integer } , { name: 'datfrozenxid', type: Types.integer } , { name: 'datminmxid', type: Types.integer } , { name: 'dattablespace', type: Types.integer } , { name: 'datacl', type: Types.jsonb } ] };
entropy(t: _Transaction): number { return this.db.listSchemas().length; }
*enumerate() { // this is 💩, whaterver... let i = 48593; for (const t of this.db.listSchemas()) { const ret = { oid: ++i, datname: t.name, [IS_SCHEMA]: true, }; yield setId(ret, '/schema/pg_database/' + t.name); } }

hasItem(value: any): boolean { return !!value?.[IS_SCHEMA]; }}
pg_mem

Version Info

Tagged at
a year ago