Plan 9 from Bell Labs’s /usr/web/sources/contrib/maht/inferno/module/pg_catalogue.m

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.



PgCatalogue: module { # pg_catalogue.b
	PATH : con "/dis/lib/pg_catalogue.dis";
	Catalogue : adt {
		err_chan : chan of string;
		conn : ref Connection;
		types : array of Type;
		procs : array of Proc;
		Procfields : array of string;
		languages : array of Language;
		users : array of User;
		last_sync : int; # time since epoch

		sync : fn(c : self ref Catalogue) : int;

		user_sysid: fn(c : self ref Catalogue, name : string) : (string, int);
		fill_procs: fn(c : self ref Catalogue) : int;
		fill_types: fn(c : self ref Catalogue) : int;
		print_types: fn(c : self ref Catalogue);
		print_procs_full: fn(c : self ref Catalogue, user_sysid: int);
		print_procs: fn(c : self ref Catalogue, user_sysid: int);
		type_name: fn(c : self ref Catalogue, oid : big) : string;
		language_name: fn(c : self ref Catalogue, oid : big) : string;
		fill_languages: fn(c : self ref Catalogue) : int;
		fill_users: fn(c : self ref Catalogue) : int;
		user_name: fn(c : self ref Catalogue, sysid : int) : string;

		proc_sql : fn(c : self ref Catalogue, r : int) : string;
		drop_proc : fn(c : self ref Catalogue, id : int) : int;
	};

	Proc : adt {
		rows : array of array of byte;
		oid : big;
		name : string;
		namespace : big;
		owner : int;
		lang : big;
		isagg : int;
		secdef : int;
		isstrict : int;
		retset : int;
		volatile : int;
		nargs : int;
		rettype : big;
		argtypes : array of big;
		argnames : array of string;
		src : string;
		bin : array of byte;
	};


	Type : adt {
		oid : big;
		name : string;
		namespace : big;
		owner : big;
		length : int; # pg name is len but that's a reserved word here
		byval : int;
		typ : string;
		isdefined : int;
		delim : string;
		relid : big;
		elem : big;
		input : int;
		output : int;
		receive : int;
		send : int;
		analyze : int;
		align : string;
		storage : string;
		notnull : int;
		basetype : big;
		typmod : int;
		ndims : int;
		defaultbin : array of byte;
		default : string;
	};

	Language : adt {
		oid : big;
		name : string;
		ispl : int;
		pltrusted : int;
		plcallfoid : big;
		validator : big;
		acl : string;
	};

	User : adt {
		oid : big;
		name : string;
		sysid : int;
		createdb : int;
		super : int;
		catupd : int;
		valuntil : string;
		config : string;
	};

	new_connection : fn (ip, port, user, password, database, options, parameters: string) : ref Connection;
	disconnect : fn(c : ref Connection);

	new_catalogue : fn(conn : ref Connection) : ref Catalogue;
};



Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].