From d4c0438ece56603e849076a4b2c2278b620fdcca Mon Sep 17 00:00:00 2001 From: Tom Quist Date: Sat, 25 Mar 2023 18:32:57 +0100 Subject: [PATCH] Add deparse --- .gitignore | 1 + index.d.ts | 2 + index.js | 17 + libpg_query/protobuf/.gitkeep | 0 package.json | 7 +- proto.js | 96382 ++++++++++++++++++++++++++++++++ queryparser.cc | 235 - script/buildAddon.sh | 1 + src/addon.cc | 10 + src/async.cc | 47 + src/async.h | 1 + src/helpers.cc | 13 + src/helpers.h | 1 + src/sync.cc | 11 + src/sync.h | 1 + test/index.js | 28 + yarn.lock | 450 +- 17 files changed, 96968 insertions(+), 239 deletions(-) create mode 100644 libpg_query/protobuf/.gitkeep create mode 100644 proto.js delete mode 100644 queryparser.cc diff --git a/.gitignore b/.gitignore index 50288e9..342aa0d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ libs/ npm-debug.log libpg_query/**/*.a libpg_query/**/*.h +libpg_query/**/*.proto diff --git a/index.d.ts b/index.d.ts index f00054a..2c21e9f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,6 +1,8 @@ export function parseQuery(sql: string): Promise; +export function deparse(parseTree: any): Promise; export function parsePlPgSQL(funcsSql: string): Promise; export function parseQuerySync(sql: string): any; +export function deparseSync(parseTree: any): any; export function parsePlPgSQLSync(funcsSql: string): any; export function fingerprint(sql: string): Promise; export function fingerprintSync(sql: string): string; diff --git a/index.js b/index.js index 1acb744..69e78cf 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ const PgQuery = require('./build/Release/queryparser'); +const { pg_query } = require('./proto'); module.exports = { parseQuery(query) { @@ -9,6 +10,16 @@ module.exports = { }); }, + deparse(parseTree) { + const msg = pg_query.ParseResult.fromObject(parseTree); + const data = pg_query.ParseResult.encode(msg).finish(); + return new Promise((resolve, reject) => { + PgQuery.deparseAsync(data, (err, result) => { + err ? reject(err) : resolve(result); + }); + }); + }, + parsePlPgSQL(query) { return new Promise((resolve, reject) => { PgQuery.parsePlPgSQLAsync(query, (err, result) => { @@ -21,6 +32,12 @@ module.exports = { return JSON.parse(PgQuery.parseQuerySync(query)); }, + deparseSync(parseTree) { + const msg = pg_query.ParseResult.fromObject(parseTree); + const data = pg_query.ParseResult.encode(msg).finish(); + return PgQuery.deparseSync(data); + }, + parsePlPgSQLSync(query) { return JSON.parse(PgQuery.parsePlPgSQLSync(query)); }, diff --git a/libpg_query/protobuf/.gitkeep b/libpg_query/protobuf/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json index bb7a140..9b3a538 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "scripts": { "configure": "node-pre-gyp configure", "install": "node-pre-gyp install --fallback-to-build", + "proto": "node_modules/protobufjs-cli/bin/pbjs --keep-case -t static-module -o proto.js libpg_query/protobuf/pg_query.proto", "rebuild": "node-pre-gyp configure rebuild", "test": "mocha --timeout 5000", "binary:build": "node-pre-gyp rebuild package", @@ -25,12 +26,14 @@ "devDependencies": { "chai": "^3.5.0", "lodash": "^4.17.15", - "mocha": "^5.2.0" + "mocha": "^5.2.0", + "protobufjs-cli": "https://gitpkg.now.sh/michaelbgreen/protobuf.js/cli?6254efb1bd9263978e9a90da3b05c4ccbcd6564a" }, "dependencies": { "@mapbox/node-pre-gyp": "^1.0.8", "node-addon-api": "^1.6.3", - "node-gyp": "^8.0.0" + "node-gyp": "^8.0.0", + "protobufjs": "git+https://github.com/michaelbgreen/protobuf.js.git#c0b68ac5c8fbb1ded261c0924bbce0538370333e" }, "keywords": [ "sql", diff --git a/proto.js b/proto.js new file mode 100644 index 0000000..c3b159f --- /dev/null +++ b/proto.js @@ -0,0 +1,96382 @@ +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("protobufjs/minimal")); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + + $root.pg_query = (function() { + + /** + * Namespace pg_query. + * @exports pg_query + * @namespace + */ + var pg_query = {}; + + pg_query.ParseResult = (function() { + + /** + * Properties of a ParseResult. + * @memberof pg_query + * @interface IParseResult + * @property {number|null} [version] ParseResult version + * @property {Array.|null} [stmts] ParseResult stmts + */ + + /** + * Constructs a new ParseResult. + * @memberof pg_query + * @classdesc Represents a ParseResult. + * @implements IParseResult + * @constructor + * @param {pg_query.IParseResult=} [properties] Properties to set + */ + function ParseResult(properties) { + this.stmts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParseResult version. + * @member {number} version + * @memberof pg_query.ParseResult + * @instance + */ + ParseResult.prototype.version = 0; + + /** + * ParseResult stmts. + * @member {Array.} stmts + * @memberof pg_query.ParseResult + * @instance + */ + ParseResult.prototype.stmts = $util.emptyArray; + + /** + * Creates a new ParseResult instance using the specified properties. + * @function create + * @memberof pg_query.ParseResult + * @static + * @param {pg_query.IParseResult=} [properties] Properties to set + * @returns {pg_query.ParseResult} ParseResult instance + */ + ParseResult.create = function create(properties) { + return new ParseResult(properties); + }; + + /** + * Encodes the specified ParseResult message. Does not implicitly {@link pg_query.ParseResult.verify|verify} messages. + * @function encode + * @memberof pg_query.ParseResult + * @static + * @param {pg_query.IParseResult} message ParseResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParseResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.stmts != null && message.stmts.length) + for (var i = 0; i < message.stmts.length; ++i) + $root.pg_query.RawStmt.encode(message.stmts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ParseResult message, length delimited. Does not implicitly {@link pg_query.ParseResult.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ParseResult + * @static + * @param {pg_query.IParseResult} message ParseResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParseResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParseResult message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ParseResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ParseResult} ParseResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParseResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ParseResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 2: { + if (!(message.stmts && message.stmts.length)) + message.stmts = []; + message.stmts.push($root.pg_query.RawStmt.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ParseResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ParseResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ParseResult} ParseResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParseResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParseResult message. + * @function verify + * @memberof pg_query.ParseResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParseResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.stmts != null && message.hasOwnProperty("stmts")) { + if (!Array.isArray(message.stmts)) + return "stmts: array expected"; + for (var i = 0; i < message.stmts.length; ++i) { + var error = $root.pg_query.RawStmt.verify(message.stmts[i]); + if (error) + return "stmts." + error; + } + } + return null; + }; + + /** + * Creates a ParseResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ParseResult + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ParseResult} ParseResult + */ + ParseResult.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ParseResult) + return object; + var message = new $root.pg_query.ParseResult(); + if (object.version != null) + message.version = object.version | 0; + if (object.stmts) { + if (!Array.isArray(object.stmts)) + throw TypeError(".pg_query.ParseResult.stmts: array expected"); + message.stmts = []; + for (var i = 0; i < object.stmts.length; ++i) { + if (typeof object.stmts[i] !== "object") + throw TypeError(".pg_query.ParseResult.stmts: object expected"); + message.stmts[i] = $root.pg_query.RawStmt.fromObject(object.stmts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ParseResult message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ParseResult + * @static + * @param {pg_query.ParseResult} message ParseResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParseResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stmts = []; + if (options.defaults) + object.version = 0; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.stmts && message.stmts.length) { + object.stmts = []; + for (var j = 0; j < message.stmts.length; ++j) + object.stmts[j] = $root.pg_query.RawStmt.toObject(message.stmts[j], options); + } + return object; + }; + + /** + * Converts this ParseResult to JSON. + * @function toJSON + * @memberof pg_query.ParseResult + * @instance + * @returns {Object.} JSON object + */ + ParseResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ParseResult + * @function getTypeUrl + * @memberof pg_query.ParseResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ParseResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ParseResult"; + }; + + return ParseResult; + })(); + + pg_query.ScanResult = (function() { + + /** + * Properties of a ScanResult. + * @memberof pg_query + * @interface IScanResult + * @property {number|null} [version] ScanResult version + * @property {Array.|null} [tokens] ScanResult tokens + */ + + /** + * Constructs a new ScanResult. + * @memberof pg_query + * @classdesc Represents a ScanResult. + * @implements IScanResult + * @constructor + * @param {pg_query.IScanResult=} [properties] Properties to set + */ + function ScanResult(properties) { + this.tokens = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanResult version. + * @member {number} version + * @memberof pg_query.ScanResult + * @instance + */ + ScanResult.prototype.version = 0; + + /** + * ScanResult tokens. + * @member {Array.} tokens + * @memberof pg_query.ScanResult + * @instance + */ + ScanResult.prototype.tokens = $util.emptyArray; + + /** + * Creates a new ScanResult instance using the specified properties. + * @function create + * @memberof pg_query.ScanResult + * @static + * @param {pg_query.IScanResult=} [properties] Properties to set + * @returns {pg_query.ScanResult} ScanResult instance + */ + ScanResult.create = function create(properties) { + return new ScanResult(properties); + }; + + /** + * Encodes the specified ScanResult message. Does not implicitly {@link pg_query.ScanResult.verify|verify} messages. + * @function encode + * @memberof pg_query.ScanResult + * @static + * @param {pg_query.IScanResult} message ScanResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.tokens != null && message.tokens.length) + for (var i = 0; i < message.tokens.length; ++i) + $root.pg_query.ScanToken.encode(message.tokens[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScanResult message, length delimited. Does not implicitly {@link pg_query.ScanResult.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ScanResult + * @static + * @param {pg_query.IScanResult} message ScanResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanResult message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ScanResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ScanResult} ScanResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ScanResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 2: { + if (!(message.tokens && message.tokens.length)) + message.tokens = []; + message.tokens.push($root.pg_query.ScanToken.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ScanResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ScanResult} ScanResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanResult message. + * @function verify + * @memberof pg_query.ScanResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.tokens != null && message.hasOwnProperty("tokens")) { + if (!Array.isArray(message.tokens)) + return "tokens: array expected"; + for (var i = 0; i < message.tokens.length; ++i) { + var error = $root.pg_query.ScanToken.verify(message.tokens[i]); + if (error) + return "tokens." + error; + } + } + return null; + }; + + /** + * Creates a ScanResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ScanResult + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ScanResult} ScanResult + */ + ScanResult.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ScanResult) + return object; + var message = new $root.pg_query.ScanResult(); + if (object.version != null) + message.version = object.version | 0; + if (object.tokens) { + if (!Array.isArray(object.tokens)) + throw TypeError(".pg_query.ScanResult.tokens: array expected"); + message.tokens = []; + for (var i = 0; i < object.tokens.length; ++i) { + if (typeof object.tokens[i] !== "object") + throw TypeError(".pg_query.ScanResult.tokens: object expected"); + message.tokens[i] = $root.pg_query.ScanToken.fromObject(object.tokens[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ScanResult message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ScanResult + * @static + * @param {pg_query.ScanResult} message ScanResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tokens = []; + if (options.defaults) + object.version = 0; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.tokens && message.tokens.length) { + object.tokens = []; + for (var j = 0; j < message.tokens.length; ++j) + object.tokens[j] = $root.pg_query.ScanToken.toObject(message.tokens[j], options); + } + return object; + }; + + /** + * Converts this ScanResult to JSON. + * @function toJSON + * @memberof pg_query.ScanResult + * @instance + * @returns {Object.} JSON object + */ + ScanResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanResult + * @function getTypeUrl + * @memberof pg_query.ScanResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ScanResult"; + }; + + return ScanResult; + })(); + + pg_query.Node = (function() { + + /** + * Properties of a Node. + * @memberof pg_query + * @interface INode + * @property {pg_query.IAlias|null} [Alias] Node Alias + * @property {pg_query.IRangeVar|null} [RangeVar] Node RangeVar + * @property {pg_query.ITableFunc|null} [TableFunc] Node TableFunc + * @property {pg_query.IExpr|null} [Expr] Node Expr + * @property {pg_query.IVar|null} [Var] Node Var + * @property {pg_query.IParam|null} [Param] Node Param + * @property {pg_query.IAggref|null} [Aggref] Node Aggref + * @property {pg_query.IGroupingFunc|null} [GroupingFunc] Node GroupingFunc + * @property {pg_query.IWindowFunc|null} [WindowFunc] Node WindowFunc + * @property {pg_query.ISubscriptingRef|null} [SubscriptingRef] Node SubscriptingRef + * @property {pg_query.IFuncExpr|null} [FuncExpr] Node FuncExpr + * @property {pg_query.INamedArgExpr|null} [NamedArgExpr] Node NamedArgExpr + * @property {pg_query.IOpExpr|null} [OpExpr] Node OpExpr + * @property {pg_query.IDistinctExpr|null} [DistinctExpr] Node DistinctExpr + * @property {pg_query.INullIfExpr|null} [NullIfExpr] Node NullIfExpr + * @property {pg_query.IScalarArrayOpExpr|null} [ScalarArrayOpExpr] Node ScalarArrayOpExpr + * @property {pg_query.IBoolExpr|null} [BoolExpr] Node BoolExpr + * @property {pg_query.ISubLink|null} [SubLink] Node SubLink + * @property {pg_query.ISubPlan|null} [SubPlan] Node SubPlan + * @property {pg_query.IAlternativeSubPlan|null} [AlternativeSubPlan] Node AlternativeSubPlan + * @property {pg_query.IFieldSelect|null} [FieldSelect] Node FieldSelect + * @property {pg_query.IFieldStore|null} [FieldStore] Node FieldStore + * @property {pg_query.IRelabelType|null} [RelabelType] Node RelabelType + * @property {pg_query.ICoerceViaIO|null} [CoerceViaIO] Node CoerceViaIO + * @property {pg_query.IArrayCoerceExpr|null} [ArrayCoerceExpr] Node ArrayCoerceExpr + * @property {pg_query.IConvertRowtypeExpr|null} [ConvertRowtypeExpr] Node ConvertRowtypeExpr + * @property {pg_query.ICollateExpr|null} [CollateExpr] Node CollateExpr + * @property {pg_query.ICaseExpr|null} [CaseExpr] Node CaseExpr + * @property {pg_query.ICaseWhen|null} [CaseWhen] Node CaseWhen + * @property {pg_query.ICaseTestExpr|null} [CaseTestExpr] Node CaseTestExpr + * @property {pg_query.IArrayExpr|null} [ArrayExpr] Node ArrayExpr + * @property {pg_query.IRowExpr|null} [RowExpr] Node RowExpr + * @property {pg_query.IRowCompareExpr|null} [RowCompareExpr] Node RowCompareExpr + * @property {pg_query.ICoalesceExpr|null} [CoalesceExpr] Node CoalesceExpr + * @property {pg_query.IMinMaxExpr|null} [MinMaxExpr] Node MinMaxExpr + * @property {pg_query.ISQLValueFunction|null} [SQLValueFunction] Node SQLValueFunction + * @property {pg_query.IXmlExpr|null} [XmlExpr] Node XmlExpr + * @property {pg_query.INullTest|null} [NullTest] Node NullTest + * @property {pg_query.IBooleanTest|null} [BooleanTest] Node BooleanTest + * @property {pg_query.ICoerceToDomain|null} [CoerceToDomain] Node CoerceToDomain + * @property {pg_query.ICoerceToDomainValue|null} [CoerceToDomainValue] Node CoerceToDomainValue + * @property {pg_query.ISetToDefault|null} [SetToDefault] Node SetToDefault + * @property {pg_query.ICurrentOfExpr|null} [CurrentOfExpr] Node CurrentOfExpr + * @property {pg_query.INextValueExpr|null} [NextValueExpr] Node NextValueExpr + * @property {pg_query.IInferenceElem|null} [InferenceElem] Node InferenceElem + * @property {pg_query.ITargetEntry|null} [TargetEntry] Node TargetEntry + * @property {pg_query.IRangeTblRef|null} [RangeTblRef] Node RangeTblRef + * @property {pg_query.IJoinExpr|null} [JoinExpr] Node JoinExpr + * @property {pg_query.IFromExpr|null} [FromExpr] Node FromExpr + * @property {pg_query.IOnConflictExpr|null} [OnConflictExpr] Node OnConflictExpr + * @property {pg_query.IIntoClause|null} [IntoClause] Node IntoClause + * @property {pg_query.IRawStmt|null} [RawStmt] Node RawStmt + * @property {pg_query.IQuery|null} [Query] Node Query + * @property {pg_query.IInsertStmt|null} [InsertStmt] Node InsertStmt + * @property {pg_query.IDeleteStmt|null} [DeleteStmt] Node DeleteStmt + * @property {pg_query.IUpdateStmt|null} [UpdateStmt] Node UpdateStmt + * @property {pg_query.ISelectStmt|null} [SelectStmt] Node SelectStmt + * @property {pg_query.IAlterTableStmt|null} [AlterTableStmt] Node AlterTableStmt + * @property {pg_query.IAlterTableCmd|null} [AlterTableCmd] Node AlterTableCmd + * @property {pg_query.IAlterDomainStmt|null} [AlterDomainStmt] Node AlterDomainStmt + * @property {pg_query.ISetOperationStmt|null} [SetOperationStmt] Node SetOperationStmt + * @property {pg_query.IGrantStmt|null} [GrantStmt] Node GrantStmt + * @property {pg_query.IGrantRoleStmt|null} [GrantRoleStmt] Node GrantRoleStmt + * @property {pg_query.IAlterDefaultPrivilegesStmt|null} [AlterDefaultPrivilegesStmt] Node AlterDefaultPrivilegesStmt + * @property {pg_query.IClosePortalStmt|null} [ClosePortalStmt] Node ClosePortalStmt + * @property {pg_query.IClusterStmt|null} [ClusterStmt] Node ClusterStmt + * @property {pg_query.ICopyStmt|null} [CopyStmt] Node CopyStmt + * @property {pg_query.ICreateStmt|null} [CreateStmt] Node CreateStmt + * @property {pg_query.IDefineStmt|null} [DefineStmt] Node DefineStmt + * @property {pg_query.IDropStmt|null} [DropStmt] Node DropStmt + * @property {pg_query.ITruncateStmt|null} [TruncateStmt] Node TruncateStmt + * @property {pg_query.ICommentStmt|null} [CommentStmt] Node CommentStmt + * @property {pg_query.IFetchStmt|null} [FetchStmt] Node FetchStmt + * @property {pg_query.IIndexStmt|null} [IndexStmt] Node IndexStmt + * @property {pg_query.ICreateFunctionStmt|null} [CreateFunctionStmt] Node CreateFunctionStmt + * @property {pg_query.IAlterFunctionStmt|null} [AlterFunctionStmt] Node AlterFunctionStmt + * @property {pg_query.IDoStmt|null} [DoStmt] Node DoStmt + * @property {pg_query.IRenameStmt|null} [RenameStmt] Node RenameStmt + * @property {pg_query.IRuleStmt|null} [RuleStmt] Node RuleStmt + * @property {pg_query.INotifyStmt|null} [NotifyStmt] Node NotifyStmt + * @property {pg_query.IListenStmt|null} [ListenStmt] Node ListenStmt + * @property {pg_query.IUnlistenStmt|null} [UnlistenStmt] Node UnlistenStmt + * @property {pg_query.ITransactionStmt|null} [TransactionStmt] Node TransactionStmt + * @property {pg_query.IViewStmt|null} [ViewStmt] Node ViewStmt + * @property {pg_query.ILoadStmt|null} [LoadStmt] Node LoadStmt + * @property {pg_query.ICreateDomainStmt|null} [CreateDomainStmt] Node CreateDomainStmt + * @property {pg_query.ICreatedbStmt|null} [CreatedbStmt] Node CreatedbStmt + * @property {pg_query.IDropdbStmt|null} [DropdbStmt] Node DropdbStmt + * @property {pg_query.IVacuumStmt|null} [VacuumStmt] Node VacuumStmt + * @property {pg_query.IExplainStmt|null} [ExplainStmt] Node ExplainStmt + * @property {pg_query.ICreateTableAsStmt|null} [CreateTableAsStmt] Node CreateTableAsStmt + * @property {pg_query.ICreateSeqStmt|null} [CreateSeqStmt] Node CreateSeqStmt + * @property {pg_query.IAlterSeqStmt|null} [AlterSeqStmt] Node AlterSeqStmt + * @property {pg_query.IVariableSetStmt|null} [VariableSetStmt] Node VariableSetStmt + * @property {pg_query.IVariableShowStmt|null} [VariableShowStmt] Node VariableShowStmt + * @property {pg_query.IDiscardStmt|null} [DiscardStmt] Node DiscardStmt + * @property {pg_query.ICreateTrigStmt|null} [CreateTrigStmt] Node CreateTrigStmt + * @property {pg_query.ICreatePLangStmt|null} [CreatePLangStmt] Node CreatePLangStmt + * @property {pg_query.ICreateRoleStmt|null} [CreateRoleStmt] Node CreateRoleStmt + * @property {pg_query.IAlterRoleStmt|null} [AlterRoleStmt] Node AlterRoleStmt + * @property {pg_query.IDropRoleStmt|null} [DropRoleStmt] Node DropRoleStmt + * @property {pg_query.ILockStmt|null} [LockStmt] Node LockStmt + * @property {pg_query.IConstraintsSetStmt|null} [ConstraintsSetStmt] Node ConstraintsSetStmt + * @property {pg_query.IReindexStmt|null} [ReindexStmt] Node ReindexStmt + * @property {pg_query.ICheckPointStmt|null} [CheckPointStmt] Node CheckPointStmt + * @property {pg_query.ICreateSchemaStmt|null} [CreateSchemaStmt] Node CreateSchemaStmt + * @property {pg_query.IAlterDatabaseStmt|null} [AlterDatabaseStmt] Node AlterDatabaseStmt + * @property {pg_query.IAlterDatabaseSetStmt|null} [AlterDatabaseSetStmt] Node AlterDatabaseSetStmt + * @property {pg_query.IAlterRoleSetStmt|null} [AlterRoleSetStmt] Node AlterRoleSetStmt + * @property {pg_query.ICreateConversionStmt|null} [CreateConversionStmt] Node CreateConversionStmt + * @property {pg_query.ICreateCastStmt|null} [CreateCastStmt] Node CreateCastStmt + * @property {pg_query.ICreateOpClassStmt|null} [CreateOpClassStmt] Node CreateOpClassStmt + * @property {pg_query.ICreateOpFamilyStmt|null} [CreateOpFamilyStmt] Node CreateOpFamilyStmt + * @property {pg_query.IAlterOpFamilyStmt|null} [AlterOpFamilyStmt] Node AlterOpFamilyStmt + * @property {pg_query.IPrepareStmt|null} [PrepareStmt] Node PrepareStmt + * @property {pg_query.IExecuteStmt|null} [ExecuteStmt] Node ExecuteStmt + * @property {pg_query.IDeallocateStmt|null} [DeallocateStmt] Node DeallocateStmt + * @property {pg_query.IDeclareCursorStmt|null} [DeclareCursorStmt] Node DeclareCursorStmt + * @property {pg_query.ICreateTableSpaceStmt|null} [CreateTableSpaceStmt] Node CreateTableSpaceStmt + * @property {pg_query.IDropTableSpaceStmt|null} [DropTableSpaceStmt] Node DropTableSpaceStmt + * @property {pg_query.IAlterObjectDependsStmt|null} [AlterObjectDependsStmt] Node AlterObjectDependsStmt + * @property {pg_query.IAlterObjectSchemaStmt|null} [AlterObjectSchemaStmt] Node AlterObjectSchemaStmt + * @property {pg_query.IAlterOwnerStmt|null} [AlterOwnerStmt] Node AlterOwnerStmt + * @property {pg_query.IAlterOperatorStmt|null} [AlterOperatorStmt] Node AlterOperatorStmt + * @property {pg_query.IAlterTypeStmt|null} [AlterTypeStmt] Node AlterTypeStmt + * @property {pg_query.IDropOwnedStmt|null} [DropOwnedStmt] Node DropOwnedStmt + * @property {pg_query.IReassignOwnedStmt|null} [ReassignOwnedStmt] Node ReassignOwnedStmt + * @property {pg_query.ICompositeTypeStmt|null} [CompositeTypeStmt] Node CompositeTypeStmt + * @property {pg_query.ICreateEnumStmt|null} [CreateEnumStmt] Node CreateEnumStmt + * @property {pg_query.ICreateRangeStmt|null} [CreateRangeStmt] Node CreateRangeStmt + * @property {pg_query.IAlterEnumStmt|null} [AlterEnumStmt] Node AlterEnumStmt + * @property {pg_query.IAlterTSDictionaryStmt|null} [AlterTSDictionaryStmt] Node AlterTSDictionaryStmt + * @property {pg_query.IAlterTSConfigurationStmt|null} [AlterTSConfigurationStmt] Node AlterTSConfigurationStmt + * @property {pg_query.ICreateFdwStmt|null} [CreateFdwStmt] Node CreateFdwStmt + * @property {pg_query.IAlterFdwStmt|null} [AlterFdwStmt] Node AlterFdwStmt + * @property {pg_query.ICreateForeignServerStmt|null} [CreateForeignServerStmt] Node CreateForeignServerStmt + * @property {pg_query.IAlterForeignServerStmt|null} [AlterForeignServerStmt] Node AlterForeignServerStmt + * @property {pg_query.ICreateUserMappingStmt|null} [CreateUserMappingStmt] Node CreateUserMappingStmt + * @property {pg_query.IAlterUserMappingStmt|null} [AlterUserMappingStmt] Node AlterUserMappingStmt + * @property {pg_query.IDropUserMappingStmt|null} [DropUserMappingStmt] Node DropUserMappingStmt + * @property {pg_query.IAlterTableSpaceOptionsStmt|null} [AlterTableSpaceOptionsStmt] Node AlterTableSpaceOptionsStmt + * @property {pg_query.IAlterTableMoveAllStmt|null} [AlterTableMoveAllStmt] Node AlterTableMoveAllStmt + * @property {pg_query.ISecLabelStmt|null} [SecLabelStmt] Node SecLabelStmt + * @property {pg_query.ICreateForeignTableStmt|null} [CreateForeignTableStmt] Node CreateForeignTableStmt + * @property {pg_query.IImportForeignSchemaStmt|null} [ImportForeignSchemaStmt] Node ImportForeignSchemaStmt + * @property {pg_query.ICreateExtensionStmt|null} [CreateExtensionStmt] Node CreateExtensionStmt + * @property {pg_query.IAlterExtensionStmt|null} [AlterExtensionStmt] Node AlterExtensionStmt + * @property {pg_query.IAlterExtensionContentsStmt|null} [AlterExtensionContentsStmt] Node AlterExtensionContentsStmt + * @property {pg_query.ICreateEventTrigStmt|null} [CreateEventTrigStmt] Node CreateEventTrigStmt + * @property {pg_query.IAlterEventTrigStmt|null} [AlterEventTrigStmt] Node AlterEventTrigStmt + * @property {pg_query.IRefreshMatViewStmt|null} [RefreshMatViewStmt] Node RefreshMatViewStmt + * @property {pg_query.IReplicaIdentityStmt|null} [ReplicaIdentityStmt] Node ReplicaIdentityStmt + * @property {pg_query.IAlterSystemStmt|null} [AlterSystemStmt] Node AlterSystemStmt + * @property {pg_query.ICreatePolicyStmt|null} [CreatePolicyStmt] Node CreatePolicyStmt + * @property {pg_query.IAlterPolicyStmt|null} [AlterPolicyStmt] Node AlterPolicyStmt + * @property {pg_query.ICreateTransformStmt|null} [CreateTransformStmt] Node CreateTransformStmt + * @property {pg_query.ICreateAmStmt|null} [CreateAmStmt] Node CreateAmStmt + * @property {pg_query.ICreatePublicationStmt|null} [CreatePublicationStmt] Node CreatePublicationStmt + * @property {pg_query.IAlterPublicationStmt|null} [AlterPublicationStmt] Node AlterPublicationStmt + * @property {pg_query.ICreateSubscriptionStmt|null} [CreateSubscriptionStmt] Node CreateSubscriptionStmt + * @property {pg_query.IAlterSubscriptionStmt|null} [AlterSubscriptionStmt] Node AlterSubscriptionStmt + * @property {pg_query.IDropSubscriptionStmt|null} [DropSubscriptionStmt] Node DropSubscriptionStmt + * @property {pg_query.ICreateStatsStmt|null} [CreateStatsStmt] Node CreateStatsStmt + * @property {pg_query.IAlterCollationStmt|null} [AlterCollationStmt] Node AlterCollationStmt + * @property {pg_query.ICallStmt|null} [CallStmt] Node CallStmt + * @property {pg_query.IAlterStatsStmt|null} [AlterStatsStmt] Node AlterStatsStmt + * @property {pg_query.IA_Expr|null} [A_Expr] Node A_Expr + * @property {pg_query.IColumnRef|null} [ColumnRef] Node ColumnRef + * @property {pg_query.IParamRef|null} [ParamRef] Node ParamRef + * @property {pg_query.IA_Const|null} [A_Const] Node A_Const + * @property {pg_query.IFuncCall|null} [FuncCall] Node FuncCall + * @property {pg_query.IA_Star|null} [A_Star] Node A_Star + * @property {pg_query.IA_Indices|null} [A_Indices] Node A_Indices + * @property {pg_query.IA_Indirection|null} [A_Indirection] Node A_Indirection + * @property {pg_query.IA_ArrayExpr|null} [A_ArrayExpr] Node A_ArrayExpr + * @property {pg_query.IResTarget|null} [ResTarget] Node ResTarget + * @property {pg_query.IMultiAssignRef|null} [MultiAssignRef] Node MultiAssignRef + * @property {pg_query.ITypeCast|null} [TypeCast] Node TypeCast + * @property {pg_query.ICollateClause|null} [CollateClause] Node CollateClause + * @property {pg_query.ISortBy|null} [SortBy] Node SortBy + * @property {pg_query.IWindowDef|null} [WindowDef] Node WindowDef + * @property {pg_query.IRangeSubselect|null} [RangeSubselect] Node RangeSubselect + * @property {pg_query.IRangeFunction|null} [RangeFunction] Node RangeFunction + * @property {pg_query.IRangeTableSample|null} [RangeTableSample] Node RangeTableSample + * @property {pg_query.IRangeTableFunc|null} [RangeTableFunc] Node RangeTableFunc + * @property {pg_query.IRangeTableFuncCol|null} [RangeTableFuncCol] Node RangeTableFuncCol + * @property {pg_query.ITypeName|null} [TypeName] Node TypeName + * @property {pg_query.IColumnDef|null} [ColumnDef] Node ColumnDef + * @property {pg_query.IIndexElem|null} [IndexElem] Node IndexElem + * @property {pg_query.IConstraint|null} [Constraint] Node Constraint + * @property {pg_query.IDefElem|null} [DefElem] Node DefElem + * @property {pg_query.IRangeTblEntry|null} [RangeTblEntry] Node RangeTblEntry + * @property {pg_query.IRangeTblFunction|null} [RangeTblFunction] Node RangeTblFunction + * @property {pg_query.ITableSampleClause|null} [TableSampleClause] Node TableSampleClause + * @property {pg_query.IWithCheckOption|null} [WithCheckOption] Node WithCheckOption + * @property {pg_query.ISortGroupClause|null} [SortGroupClause] Node SortGroupClause + * @property {pg_query.IGroupingSet|null} [GroupingSet] Node GroupingSet + * @property {pg_query.IWindowClause|null} [WindowClause] Node WindowClause + * @property {pg_query.IObjectWithArgs|null} [ObjectWithArgs] Node ObjectWithArgs + * @property {pg_query.IAccessPriv|null} [AccessPriv] Node AccessPriv + * @property {pg_query.ICreateOpClassItem|null} [CreateOpClassItem] Node CreateOpClassItem + * @property {pg_query.ITableLikeClause|null} [TableLikeClause] Node TableLikeClause + * @property {pg_query.IFunctionParameter|null} [FunctionParameter] Node FunctionParameter + * @property {pg_query.ILockingClause|null} [LockingClause] Node LockingClause + * @property {pg_query.IRowMarkClause|null} [RowMarkClause] Node RowMarkClause + * @property {pg_query.IXmlSerialize|null} [XmlSerialize] Node XmlSerialize + * @property {pg_query.IWithClause|null} [WithClause] Node WithClause + * @property {pg_query.IInferClause|null} [InferClause] Node InferClause + * @property {pg_query.IOnConflictClause|null} [OnConflictClause] Node OnConflictClause + * @property {pg_query.ICommonTableExpr|null} [CommonTableExpr] Node CommonTableExpr + * @property {pg_query.IRoleSpec|null} [RoleSpec] Node RoleSpec + * @property {pg_query.ITriggerTransition|null} [TriggerTransition] Node TriggerTransition + * @property {pg_query.IPartitionElem|null} [PartitionElem] Node PartitionElem + * @property {pg_query.IPartitionSpec|null} [PartitionSpec] Node PartitionSpec + * @property {pg_query.IPartitionBoundSpec|null} [PartitionBoundSpec] Node PartitionBoundSpec + * @property {pg_query.IPartitionRangeDatum|null} [PartitionRangeDatum] Node PartitionRangeDatum + * @property {pg_query.IPartitionCmd|null} [PartitionCmd] Node PartitionCmd + * @property {pg_query.IVacuumRelation|null} [VacuumRelation] Node VacuumRelation + * @property {pg_query.IInlineCodeBlock|null} [InlineCodeBlock] Node InlineCodeBlock + * @property {pg_query.ICallContext|null} [CallContext] Node CallContext + * @property {pg_query.IInteger|null} [Integer] Node Integer + * @property {pg_query.IFloat|null} [Float] Node Float + * @property {pg_query.IString|null} [String] Node String + * @property {pg_query.IBitString|null} [BitString] Node BitString + * @property {pg_query.INull|null} [Null] Node Null + * @property {pg_query.IList|null} [List] Node List + * @property {pg_query.IIntList|null} [IntList] Node IntList + * @property {pg_query.IOidList|null} [OidList] Node OidList + */ + + /** + * Constructs a new Node. + * @memberof pg_query + * @classdesc Represents a Node. + * @implements INode + * @constructor + * @param {pg_query.INode=} [properties] Properties to set + */ + function Node(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Node Alias. + * @member {pg_query.IAlias|null|undefined} Alias + * @memberof pg_query.Node + * @instance + */ + Node.prototype.Alias = null; + + /** + * Node RangeVar. + * @member {pg_query.IRangeVar|null|undefined} RangeVar + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RangeVar = null; + + /** + * Node TableFunc. + * @member {pg_query.ITableFunc|null|undefined} TableFunc + * @memberof pg_query.Node + * @instance + */ + Node.prototype.TableFunc = null; + + /** + * Node Expr. + * @member {pg_query.IExpr|null|undefined} Expr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.Expr = null; + + /** + * Node Var. + * @member {pg_query.IVar|null|undefined} Var + * @memberof pg_query.Node + * @instance + */ + Node.prototype.Var = null; + + /** + * Node Param. + * @member {pg_query.IParam|null|undefined} Param + * @memberof pg_query.Node + * @instance + */ + Node.prototype.Param = null; + + /** + * Node Aggref. + * @member {pg_query.IAggref|null|undefined} Aggref + * @memberof pg_query.Node + * @instance + */ + Node.prototype.Aggref = null; + + /** + * Node GroupingFunc. + * @member {pg_query.IGroupingFunc|null|undefined} GroupingFunc + * @memberof pg_query.Node + * @instance + */ + Node.prototype.GroupingFunc = null; + + /** + * Node WindowFunc. + * @member {pg_query.IWindowFunc|null|undefined} WindowFunc + * @memberof pg_query.Node + * @instance + */ + Node.prototype.WindowFunc = null; + + /** + * Node SubscriptingRef. + * @member {pg_query.ISubscriptingRef|null|undefined} SubscriptingRef + * @memberof pg_query.Node + * @instance + */ + Node.prototype.SubscriptingRef = null; + + /** + * Node FuncExpr. + * @member {pg_query.IFuncExpr|null|undefined} FuncExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.FuncExpr = null; + + /** + * Node NamedArgExpr. + * @member {pg_query.INamedArgExpr|null|undefined} NamedArgExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.NamedArgExpr = null; + + /** + * Node OpExpr. + * @member {pg_query.IOpExpr|null|undefined} OpExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.OpExpr = null; + + /** + * Node DistinctExpr. + * @member {pg_query.IDistinctExpr|null|undefined} DistinctExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DistinctExpr = null; + + /** + * Node NullIfExpr. + * @member {pg_query.INullIfExpr|null|undefined} NullIfExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.NullIfExpr = null; + + /** + * Node ScalarArrayOpExpr. + * @member {pg_query.IScalarArrayOpExpr|null|undefined} ScalarArrayOpExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ScalarArrayOpExpr = null; + + /** + * Node BoolExpr. + * @member {pg_query.IBoolExpr|null|undefined} BoolExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.BoolExpr = null; + + /** + * Node SubLink. + * @member {pg_query.ISubLink|null|undefined} SubLink + * @memberof pg_query.Node + * @instance + */ + Node.prototype.SubLink = null; + + /** + * Node SubPlan. + * @member {pg_query.ISubPlan|null|undefined} SubPlan + * @memberof pg_query.Node + * @instance + */ + Node.prototype.SubPlan = null; + + /** + * Node AlternativeSubPlan. + * @member {pg_query.IAlternativeSubPlan|null|undefined} AlternativeSubPlan + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlternativeSubPlan = null; + + /** + * Node FieldSelect. + * @member {pg_query.IFieldSelect|null|undefined} FieldSelect + * @memberof pg_query.Node + * @instance + */ + Node.prototype.FieldSelect = null; + + /** + * Node FieldStore. + * @member {pg_query.IFieldStore|null|undefined} FieldStore + * @memberof pg_query.Node + * @instance + */ + Node.prototype.FieldStore = null; + + /** + * Node RelabelType. + * @member {pg_query.IRelabelType|null|undefined} RelabelType + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RelabelType = null; + + /** + * Node CoerceViaIO. + * @member {pg_query.ICoerceViaIO|null|undefined} CoerceViaIO + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CoerceViaIO = null; + + /** + * Node ArrayCoerceExpr. + * @member {pg_query.IArrayCoerceExpr|null|undefined} ArrayCoerceExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ArrayCoerceExpr = null; + + /** + * Node ConvertRowtypeExpr. + * @member {pg_query.IConvertRowtypeExpr|null|undefined} ConvertRowtypeExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ConvertRowtypeExpr = null; + + /** + * Node CollateExpr. + * @member {pg_query.ICollateExpr|null|undefined} CollateExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CollateExpr = null; + + /** + * Node CaseExpr. + * @member {pg_query.ICaseExpr|null|undefined} CaseExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CaseExpr = null; + + /** + * Node CaseWhen. + * @member {pg_query.ICaseWhen|null|undefined} CaseWhen + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CaseWhen = null; + + /** + * Node CaseTestExpr. + * @member {pg_query.ICaseTestExpr|null|undefined} CaseTestExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CaseTestExpr = null; + + /** + * Node ArrayExpr. + * @member {pg_query.IArrayExpr|null|undefined} ArrayExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ArrayExpr = null; + + /** + * Node RowExpr. + * @member {pg_query.IRowExpr|null|undefined} RowExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RowExpr = null; + + /** + * Node RowCompareExpr. + * @member {pg_query.IRowCompareExpr|null|undefined} RowCompareExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RowCompareExpr = null; + + /** + * Node CoalesceExpr. + * @member {pg_query.ICoalesceExpr|null|undefined} CoalesceExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CoalesceExpr = null; + + /** + * Node MinMaxExpr. + * @member {pg_query.IMinMaxExpr|null|undefined} MinMaxExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.MinMaxExpr = null; + + /** + * Node SQLValueFunction. + * @member {pg_query.ISQLValueFunction|null|undefined} SQLValueFunction + * @memberof pg_query.Node + * @instance + */ + Node.prototype.SQLValueFunction = null; + + /** + * Node XmlExpr. + * @member {pg_query.IXmlExpr|null|undefined} XmlExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.XmlExpr = null; + + /** + * Node NullTest. + * @member {pg_query.INullTest|null|undefined} NullTest + * @memberof pg_query.Node + * @instance + */ + Node.prototype.NullTest = null; + + /** + * Node BooleanTest. + * @member {pg_query.IBooleanTest|null|undefined} BooleanTest + * @memberof pg_query.Node + * @instance + */ + Node.prototype.BooleanTest = null; + + /** + * Node CoerceToDomain. + * @member {pg_query.ICoerceToDomain|null|undefined} CoerceToDomain + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CoerceToDomain = null; + + /** + * Node CoerceToDomainValue. + * @member {pg_query.ICoerceToDomainValue|null|undefined} CoerceToDomainValue + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CoerceToDomainValue = null; + + /** + * Node SetToDefault. + * @member {pg_query.ISetToDefault|null|undefined} SetToDefault + * @memberof pg_query.Node + * @instance + */ + Node.prototype.SetToDefault = null; + + /** + * Node CurrentOfExpr. + * @member {pg_query.ICurrentOfExpr|null|undefined} CurrentOfExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CurrentOfExpr = null; + + /** + * Node NextValueExpr. + * @member {pg_query.INextValueExpr|null|undefined} NextValueExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.NextValueExpr = null; + + /** + * Node InferenceElem. + * @member {pg_query.IInferenceElem|null|undefined} InferenceElem + * @memberof pg_query.Node + * @instance + */ + Node.prototype.InferenceElem = null; + + /** + * Node TargetEntry. + * @member {pg_query.ITargetEntry|null|undefined} TargetEntry + * @memberof pg_query.Node + * @instance + */ + Node.prototype.TargetEntry = null; + + /** + * Node RangeTblRef. + * @member {pg_query.IRangeTblRef|null|undefined} RangeTblRef + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RangeTblRef = null; + + /** + * Node JoinExpr. + * @member {pg_query.IJoinExpr|null|undefined} JoinExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.JoinExpr = null; + + /** + * Node FromExpr. + * @member {pg_query.IFromExpr|null|undefined} FromExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.FromExpr = null; + + /** + * Node OnConflictExpr. + * @member {pg_query.IOnConflictExpr|null|undefined} OnConflictExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.OnConflictExpr = null; + + /** + * Node IntoClause. + * @member {pg_query.IIntoClause|null|undefined} IntoClause + * @memberof pg_query.Node + * @instance + */ + Node.prototype.IntoClause = null; + + /** + * Node RawStmt. + * @member {pg_query.IRawStmt|null|undefined} RawStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RawStmt = null; + + /** + * Node Query. + * @member {pg_query.IQuery|null|undefined} Query + * @memberof pg_query.Node + * @instance + */ + Node.prototype.Query = null; + + /** + * Node InsertStmt. + * @member {pg_query.IInsertStmt|null|undefined} InsertStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.InsertStmt = null; + + /** + * Node DeleteStmt. + * @member {pg_query.IDeleteStmt|null|undefined} DeleteStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DeleteStmt = null; + + /** + * Node UpdateStmt. + * @member {pg_query.IUpdateStmt|null|undefined} UpdateStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.UpdateStmt = null; + + /** + * Node SelectStmt. + * @member {pg_query.ISelectStmt|null|undefined} SelectStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.SelectStmt = null; + + /** + * Node AlterTableStmt. + * @member {pg_query.IAlterTableStmt|null|undefined} AlterTableStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterTableStmt = null; + + /** + * Node AlterTableCmd. + * @member {pg_query.IAlterTableCmd|null|undefined} AlterTableCmd + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterTableCmd = null; + + /** + * Node AlterDomainStmt. + * @member {pg_query.IAlterDomainStmt|null|undefined} AlterDomainStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterDomainStmt = null; + + /** + * Node SetOperationStmt. + * @member {pg_query.ISetOperationStmt|null|undefined} SetOperationStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.SetOperationStmt = null; + + /** + * Node GrantStmt. + * @member {pg_query.IGrantStmt|null|undefined} GrantStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.GrantStmt = null; + + /** + * Node GrantRoleStmt. + * @member {pg_query.IGrantRoleStmt|null|undefined} GrantRoleStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.GrantRoleStmt = null; + + /** + * Node AlterDefaultPrivilegesStmt. + * @member {pg_query.IAlterDefaultPrivilegesStmt|null|undefined} AlterDefaultPrivilegesStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterDefaultPrivilegesStmt = null; + + /** + * Node ClosePortalStmt. + * @member {pg_query.IClosePortalStmt|null|undefined} ClosePortalStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ClosePortalStmt = null; + + /** + * Node ClusterStmt. + * @member {pg_query.IClusterStmt|null|undefined} ClusterStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ClusterStmt = null; + + /** + * Node CopyStmt. + * @member {pg_query.ICopyStmt|null|undefined} CopyStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CopyStmt = null; + + /** + * Node CreateStmt. + * @member {pg_query.ICreateStmt|null|undefined} CreateStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateStmt = null; + + /** + * Node DefineStmt. + * @member {pg_query.IDefineStmt|null|undefined} DefineStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DefineStmt = null; + + /** + * Node DropStmt. + * @member {pg_query.IDropStmt|null|undefined} DropStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DropStmt = null; + + /** + * Node TruncateStmt. + * @member {pg_query.ITruncateStmt|null|undefined} TruncateStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.TruncateStmt = null; + + /** + * Node CommentStmt. + * @member {pg_query.ICommentStmt|null|undefined} CommentStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CommentStmt = null; + + /** + * Node FetchStmt. + * @member {pg_query.IFetchStmt|null|undefined} FetchStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.FetchStmt = null; + + /** + * Node IndexStmt. + * @member {pg_query.IIndexStmt|null|undefined} IndexStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.IndexStmt = null; + + /** + * Node CreateFunctionStmt. + * @member {pg_query.ICreateFunctionStmt|null|undefined} CreateFunctionStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateFunctionStmt = null; + + /** + * Node AlterFunctionStmt. + * @member {pg_query.IAlterFunctionStmt|null|undefined} AlterFunctionStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterFunctionStmt = null; + + /** + * Node DoStmt. + * @member {pg_query.IDoStmt|null|undefined} DoStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DoStmt = null; + + /** + * Node RenameStmt. + * @member {pg_query.IRenameStmt|null|undefined} RenameStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RenameStmt = null; + + /** + * Node RuleStmt. + * @member {pg_query.IRuleStmt|null|undefined} RuleStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RuleStmt = null; + + /** + * Node NotifyStmt. + * @member {pg_query.INotifyStmt|null|undefined} NotifyStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.NotifyStmt = null; + + /** + * Node ListenStmt. + * @member {pg_query.IListenStmt|null|undefined} ListenStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ListenStmt = null; + + /** + * Node UnlistenStmt. + * @member {pg_query.IUnlistenStmt|null|undefined} UnlistenStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.UnlistenStmt = null; + + /** + * Node TransactionStmt. + * @member {pg_query.ITransactionStmt|null|undefined} TransactionStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.TransactionStmt = null; + + /** + * Node ViewStmt. + * @member {pg_query.IViewStmt|null|undefined} ViewStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ViewStmt = null; + + /** + * Node LoadStmt. + * @member {pg_query.ILoadStmt|null|undefined} LoadStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.LoadStmt = null; + + /** + * Node CreateDomainStmt. + * @member {pg_query.ICreateDomainStmt|null|undefined} CreateDomainStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateDomainStmt = null; + + /** + * Node CreatedbStmt. + * @member {pg_query.ICreatedbStmt|null|undefined} CreatedbStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreatedbStmt = null; + + /** + * Node DropdbStmt. + * @member {pg_query.IDropdbStmt|null|undefined} DropdbStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DropdbStmt = null; + + /** + * Node VacuumStmt. + * @member {pg_query.IVacuumStmt|null|undefined} VacuumStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.VacuumStmt = null; + + /** + * Node ExplainStmt. + * @member {pg_query.IExplainStmt|null|undefined} ExplainStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ExplainStmt = null; + + /** + * Node CreateTableAsStmt. + * @member {pg_query.ICreateTableAsStmt|null|undefined} CreateTableAsStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateTableAsStmt = null; + + /** + * Node CreateSeqStmt. + * @member {pg_query.ICreateSeqStmt|null|undefined} CreateSeqStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateSeqStmt = null; + + /** + * Node AlterSeqStmt. + * @member {pg_query.IAlterSeqStmt|null|undefined} AlterSeqStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterSeqStmt = null; + + /** + * Node VariableSetStmt. + * @member {pg_query.IVariableSetStmt|null|undefined} VariableSetStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.VariableSetStmt = null; + + /** + * Node VariableShowStmt. + * @member {pg_query.IVariableShowStmt|null|undefined} VariableShowStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.VariableShowStmt = null; + + /** + * Node DiscardStmt. + * @member {pg_query.IDiscardStmt|null|undefined} DiscardStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DiscardStmt = null; + + /** + * Node CreateTrigStmt. + * @member {pg_query.ICreateTrigStmt|null|undefined} CreateTrigStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateTrigStmt = null; + + /** + * Node CreatePLangStmt. + * @member {pg_query.ICreatePLangStmt|null|undefined} CreatePLangStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreatePLangStmt = null; + + /** + * Node CreateRoleStmt. + * @member {pg_query.ICreateRoleStmt|null|undefined} CreateRoleStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateRoleStmt = null; + + /** + * Node AlterRoleStmt. + * @member {pg_query.IAlterRoleStmt|null|undefined} AlterRoleStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterRoleStmt = null; + + /** + * Node DropRoleStmt. + * @member {pg_query.IDropRoleStmt|null|undefined} DropRoleStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DropRoleStmt = null; + + /** + * Node LockStmt. + * @member {pg_query.ILockStmt|null|undefined} LockStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.LockStmt = null; + + /** + * Node ConstraintsSetStmt. + * @member {pg_query.IConstraintsSetStmt|null|undefined} ConstraintsSetStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ConstraintsSetStmt = null; + + /** + * Node ReindexStmt. + * @member {pg_query.IReindexStmt|null|undefined} ReindexStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ReindexStmt = null; + + /** + * Node CheckPointStmt. + * @member {pg_query.ICheckPointStmt|null|undefined} CheckPointStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CheckPointStmt = null; + + /** + * Node CreateSchemaStmt. + * @member {pg_query.ICreateSchemaStmt|null|undefined} CreateSchemaStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateSchemaStmt = null; + + /** + * Node AlterDatabaseStmt. + * @member {pg_query.IAlterDatabaseStmt|null|undefined} AlterDatabaseStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterDatabaseStmt = null; + + /** + * Node AlterDatabaseSetStmt. + * @member {pg_query.IAlterDatabaseSetStmt|null|undefined} AlterDatabaseSetStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterDatabaseSetStmt = null; + + /** + * Node AlterRoleSetStmt. + * @member {pg_query.IAlterRoleSetStmt|null|undefined} AlterRoleSetStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterRoleSetStmt = null; + + /** + * Node CreateConversionStmt. + * @member {pg_query.ICreateConversionStmt|null|undefined} CreateConversionStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateConversionStmt = null; + + /** + * Node CreateCastStmt. + * @member {pg_query.ICreateCastStmt|null|undefined} CreateCastStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateCastStmt = null; + + /** + * Node CreateOpClassStmt. + * @member {pg_query.ICreateOpClassStmt|null|undefined} CreateOpClassStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateOpClassStmt = null; + + /** + * Node CreateOpFamilyStmt. + * @member {pg_query.ICreateOpFamilyStmt|null|undefined} CreateOpFamilyStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateOpFamilyStmt = null; + + /** + * Node AlterOpFamilyStmt. + * @member {pg_query.IAlterOpFamilyStmt|null|undefined} AlterOpFamilyStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterOpFamilyStmt = null; + + /** + * Node PrepareStmt. + * @member {pg_query.IPrepareStmt|null|undefined} PrepareStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.PrepareStmt = null; + + /** + * Node ExecuteStmt. + * @member {pg_query.IExecuteStmt|null|undefined} ExecuteStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ExecuteStmt = null; + + /** + * Node DeallocateStmt. + * @member {pg_query.IDeallocateStmt|null|undefined} DeallocateStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DeallocateStmt = null; + + /** + * Node DeclareCursorStmt. + * @member {pg_query.IDeclareCursorStmt|null|undefined} DeclareCursorStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DeclareCursorStmt = null; + + /** + * Node CreateTableSpaceStmt. + * @member {pg_query.ICreateTableSpaceStmt|null|undefined} CreateTableSpaceStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateTableSpaceStmt = null; + + /** + * Node DropTableSpaceStmt. + * @member {pg_query.IDropTableSpaceStmt|null|undefined} DropTableSpaceStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DropTableSpaceStmt = null; + + /** + * Node AlterObjectDependsStmt. + * @member {pg_query.IAlterObjectDependsStmt|null|undefined} AlterObjectDependsStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterObjectDependsStmt = null; + + /** + * Node AlterObjectSchemaStmt. + * @member {pg_query.IAlterObjectSchemaStmt|null|undefined} AlterObjectSchemaStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterObjectSchemaStmt = null; + + /** + * Node AlterOwnerStmt. + * @member {pg_query.IAlterOwnerStmt|null|undefined} AlterOwnerStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterOwnerStmt = null; + + /** + * Node AlterOperatorStmt. + * @member {pg_query.IAlterOperatorStmt|null|undefined} AlterOperatorStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterOperatorStmt = null; + + /** + * Node AlterTypeStmt. + * @member {pg_query.IAlterTypeStmt|null|undefined} AlterTypeStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterTypeStmt = null; + + /** + * Node DropOwnedStmt. + * @member {pg_query.IDropOwnedStmt|null|undefined} DropOwnedStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DropOwnedStmt = null; + + /** + * Node ReassignOwnedStmt. + * @member {pg_query.IReassignOwnedStmt|null|undefined} ReassignOwnedStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ReassignOwnedStmt = null; + + /** + * Node CompositeTypeStmt. + * @member {pg_query.ICompositeTypeStmt|null|undefined} CompositeTypeStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CompositeTypeStmt = null; + + /** + * Node CreateEnumStmt. + * @member {pg_query.ICreateEnumStmt|null|undefined} CreateEnumStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateEnumStmt = null; + + /** + * Node CreateRangeStmt. + * @member {pg_query.ICreateRangeStmt|null|undefined} CreateRangeStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateRangeStmt = null; + + /** + * Node AlterEnumStmt. + * @member {pg_query.IAlterEnumStmt|null|undefined} AlterEnumStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterEnumStmt = null; + + /** + * Node AlterTSDictionaryStmt. + * @member {pg_query.IAlterTSDictionaryStmt|null|undefined} AlterTSDictionaryStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterTSDictionaryStmt = null; + + /** + * Node AlterTSConfigurationStmt. + * @member {pg_query.IAlterTSConfigurationStmt|null|undefined} AlterTSConfigurationStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterTSConfigurationStmt = null; + + /** + * Node CreateFdwStmt. + * @member {pg_query.ICreateFdwStmt|null|undefined} CreateFdwStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateFdwStmt = null; + + /** + * Node AlterFdwStmt. + * @member {pg_query.IAlterFdwStmt|null|undefined} AlterFdwStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterFdwStmt = null; + + /** + * Node CreateForeignServerStmt. + * @member {pg_query.ICreateForeignServerStmt|null|undefined} CreateForeignServerStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateForeignServerStmt = null; + + /** + * Node AlterForeignServerStmt. + * @member {pg_query.IAlterForeignServerStmt|null|undefined} AlterForeignServerStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterForeignServerStmt = null; + + /** + * Node CreateUserMappingStmt. + * @member {pg_query.ICreateUserMappingStmt|null|undefined} CreateUserMappingStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateUserMappingStmt = null; + + /** + * Node AlterUserMappingStmt. + * @member {pg_query.IAlterUserMappingStmt|null|undefined} AlterUserMappingStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterUserMappingStmt = null; + + /** + * Node DropUserMappingStmt. + * @member {pg_query.IDropUserMappingStmt|null|undefined} DropUserMappingStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DropUserMappingStmt = null; + + /** + * Node AlterTableSpaceOptionsStmt. + * @member {pg_query.IAlterTableSpaceOptionsStmt|null|undefined} AlterTableSpaceOptionsStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterTableSpaceOptionsStmt = null; + + /** + * Node AlterTableMoveAllStmt. + * @member {pg_query.IAlterTableMoveAllStmt|null|undefined} AlterTableMoveAllStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterTableMoveAllStmt = null; + + /** + * Node SecLabelStmt. + * @member {pg_query.ISecLabelStmt|null|undefined} SecLabelStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.SecLabelStmt = null; + + /** + * Node CreateForeignTableStmt. + * @member {pg_query.ICreateForeignTableStmt|null|undefined} CreateForeignTableStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateForeignTableStmt = null; + + /** + * Node ImportForeignSchemaStmt. + * @member {pg_query.IImportForeignSchemaStmt|null|undefined} ImportForeignSchemaStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ImportForeignSchemaStmt = null; + + /** + * Node CreateExtensionStmt. + * @member {pg_query.ICreateExtensionStmt|null|undefined} CreateExtensionStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateExtensionStmt = null; + + /** + * Node AlterExtensionStmt. + * @member {pg_query.IAlterExtensionStmt|null|undefined} AlterExtensionStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterExtensionStmt = null; + + /** + * Node AlterExtensionContentsStmt. + * @member {pg_query.IAlterExtensionContentsStmt|null|undefined} AlterExtensionContentsStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterExtensionContentsStmt = null; + + /** + * Node CreateEventTrigStmt. + * @member {pg_query.ICreateEventTrigStmt|null|undefined} CreateEventTrigStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateEventTrigStmt = null; + + /** + * Node AlterEventTrigStmt. + * @member {pg_query.IAlterEventTrigStmt|null|undefined} AlterEventTrigStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterEventTrigStmt = null; + + /** + * Node RefreshMatViewStmt. + * @member {pg_query.IRefreshMatViewStmt|null|undefined} RefreshMatViewStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RefreshMatViewStmt = null; + + /** + * Node ReplicaIdentityStmt. + * @member {pg_query.IReplicaIdentityStmt|null|undefined} ReplicaIdentityStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ReplicaIdentityStmt = null; + + /** + * Node AlterSystemStmt. + * @member {pg_query.IAlterSystemStmt|null|undefined} AlterSystemStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterSystemStmt = null; + + /** + * Node CreatePolicyStmt. + * @member {pg_query.ICreatePolicyStmt|null|undefined} CreatePolicyStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreatePolicyStmt = null; + + /** + * Node AlterPolicyStmt. + * @member {pg_query.IAlterPolicyStmt|null|undefined} AlterPolicyStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterPolicyStmt = null; + + /** + * Node CreateTransformStmt. + * @member {pg_query.ICreateTransformStmt|null|undefined} CreateTransformStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateTransformStmt = null; + + /** + * Node CreateAmStmt. + * @member {pg_query.ICreateAmStmt|null|undefined} CreateAmStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateAmStmt = null; + + /** + * Node CreatePublicationStmt. + * @member {pg_query.ICreatePublicationStmt|null|undefined} CreatePublicationStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreatePublicationStmt = null; + + /** + * Node AlterPublicationStmt. + * @member {pg_query.IAlterPublicationStmt|null|undefined} AlterPublicationStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterPublicationStmt = null; + + /** + * Node CreateSubscriptionStmt. + * @member {pg_query.ICreateSubscriptionStmt|null|undefined} CreateSubscriptionStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateSubscriptionStmt = null; + + /** + * Node AlterSubscriptionStmt. + * @member {pg_query.IAlterSubscriptionStmt|null|undefined} AlterSubscriptionStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterSubscriptionStmt = null; + + /** + * Node DropSubscriptionStmt. + * @member {pg_query.IDropSubscriptionStmt|null|undefined} DropSubscriptionStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DropSubscriptionStmt = null; + + /** + * Node CreateStatsStmt. + * @member {pg_query.ICreateStatsStmt|null|undefined} CreateStatsStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateStatsStmt = null; + + /** + * Node AlterCollationStmt. + * @member {pg_query.IAlterCollationStmt|null|undefined} AlterCollationStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterCollationStmt = null; + + /** + * Node CallStmt. + * @member {pg_query.ICallStmt|null|undefined} CallStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CallStmt = null; + + /** + * Node AlterStatsStmt. + * @member {pg_query.IAlterStatsStmt|null|undefined} AlterStatsStmt + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AlterStatsStmt = null; + + /** + * Node A_Expr. + * @member {pg_query.IA_Expr|null|undefined} A_Expr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.A_Expr = null; + + /** + * Node ColumnRef. + * @member {pg_query.IColumnRef|null|undefined} ColumnRef + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ColumnRef = null; + + /** + * Node ParamRef. + * @member {pg_query.IParamRef|null|undefined} ParamRef + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ParamRef = null; + + /** + * Node A_Const. + * @member {pg_query.IA_Const|null|undefined} A_Const + * @memberof pg_query.Node + * @instance + */ + Node.prototype.A_Const = null; + + /** + * Node FuncCall. + * @member {pg_query.IFuncCall|null|undefined} FuncCall + * @memberof pg_query.Node + * @instance + */ + Node.prototype.FuncCall = null; + + /** + * Node A_Star. + * @member {pg_query.IA_Star|null|undefined} A_Star + * @memberof pg_query.Node + * @instance + */ + Node.prototype.A_Star = null; + + /** + * Node A_Indices. + * @member {pg_query.IA_Indices|null|undefined} A_Indices + * @memberof pg_query.Node + * @instance + */ + Node.prototype.A_Indices = null; + + /** + * Node A_Indirection. + * @member {pg_query.IA_Indirection|null|undefined} A_Indirection + * @memberof pg_query.Node + * @instance + */ + Node.prototype.A_Indirection = null; + + /** + * Node A_ArrayExpr. + * @member {pg_query.IA_ArrayExpr|null|undefined} A_ArrayExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.A_ArrayExpr = null; + + /** + * Node ResTarget. + * @member {pg_query.IResTarget|null|undefined} ResTarget + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ResTarget = null; + + /** + * Node MultiAssignRef. + * @member {pg_query.IMultiAssignRef|null|undefined} MultiAssignRef + * @memberof pg_query.Node + * @instance + */ + Node.prototype.MultiAssignRef = null; + + /** + * Node TypeCast. + * @member {pg_query.ITypeCast|null|undefined} TypeCast + * @memberof pg_query.Node + * @instance + */ + Node.prototype.TypeCast = null; + + /** + * Node CollateClause. + * @member {pg_query.ICollateClause|null|undefined} CollateClause + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CollateClause = null; + + /** + * Node SortBy. + * @member {pg_query.ISortBy|null|undefined} SortBy + * @memberof pg_query.Node + * @instance + */ + Node.prototype.SortBy = null; + + /** + * Node WindowDef. + * @member {pg_query.IWindowDef|null|undefined} WindowDef + * @memberof pg_query.Node + * @instance + */ + Node.prototype.WindowDef = null; + + /** + * Node RangeSubselect. + * @member {pg_query.IRangeSubselect|null|undefined} RangeSubselect + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RangeSubselect = null; + + /** + * Node RangeFunction. + * @member {pg_query.IRangeFunction|null|undefined} RangeFunction + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RangeFunction = null; + + /** + * Node RangeTableSample. + * @member {pg_query.IRangeTableSample|null|undefined} RangeTableSample + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RangeTableSample = null; + + /** + * Node RangeTableFunc. + * @member {pg_query.IRangeTableFunc|null|undefined} RangeTableFunc + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RangeTableFunc = null; + + /** + * Node RangeTableFuncCol. + * @member {pg_query.IRangeTableFuncCol|null|undefined} RangeTableFuncCol + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RangeTableFuncCol = null; + + /** + * Node TypeName. + * @member {pg_query.ITypeName|null|undefined} TypeName + * @memberof pg_query.Node + * @instance + */ + Node.prototype.TypeName = null; + + /** + * Node ColumnDef. + * @member {pg_query.IColumnDef|null|undefined} ColumnDef + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ColumnDef = null; + + /** + * Node IndexElem. + * @member {pg_query.IIndexElem|null|undefined} IndexElem + * @memberof pg_query.Node + * @instance + */ + Node.prototype.IndexElem = null; + + /** + * Node Constraint. + * @member {pg_query.IConstraint|null|undefined} Constraint + * @memberof pg_query.Node + * @instance + */ + Node.prototype.Constraint = null; + + /** + * Node DefElem. + * @member {pg_query.IDefElem|null|undefined} DefElem + * @memberof pg_query.Node + * @instance + */ + Node.prototype.DefElem = null; + + /** + * Node RangeTblEntry. + * @member {pg_query.IRangeTblEntry|null|undefined} RangeTblEntry + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RangeTblEntry = null; + + /** + * Node RangeTblFunction. + * @member {pg_query.IRangeTblFunction|null|undefined} RangeTblFunction + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RangeTblFunction = null; + + /** + * Node TableSampleClause. + * @member {pg_query.ITableSampleClause|null|undefined} TableSampleClause + * @memberof pg_query.Node + * @instance + */ + Node.prototype.TableSampleClause = null; + + /** + * Node WithCheckOption. + * @member {pg_query.IWithCheckOption|null|undefined} WithCheckOption + * @memberof pg_query.Node + * @instance + */ + Node.prototype.WithCheckOption = null; + + /** + * Node SortGroupClause. + * @member {pg_query.ISortGroupClause|null|undefined} SortGroupClause + * @memberof pg_query.Node + * @instance + */ + Node.prototype.SortGroupClause = null; + + /** + * Node GroupingSet. + * @member {pg_query.IGroupingSet|null|undefined} GroupingSet + * @memberof pg_query.Node + * @instance + */ + Node.prototype.GroupingSet = null; + + /** + * Node WindowClause. + * @member {pg_query.IWindowClause|null|undefined} WindowClause + * @memberof pg_query.Node + * @instance + */ + Node.prototype.WindowClause = null; + + /** + * Node ObjectWithArgs. + * @member {pg_query.IObjectWithArgs|null|undefined} ObjectWithArgs + * @memberof pg_query.Node + * @instance + */ + Node.prototype.ObjectWithArgs = null; + + /** + * Node AccessPriv. + * @member {pg_query.IAccessPriv|null|undefined} AccessPriv + * @memberof pg_query.Node + * @instance + */ + Node.prototype.AccessPriv = null; + + /** + * Node CreateOpClassItem. + * @member {pg_query.ICreateOpClassItem|null|undefined} CreateOpClassItem + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CreateOpClassItem = null; + + /** + * Node TableLikeClause. + * @member {pg_query.ITableLikeClause|null|undefined} TableLikeClause + * @memberof pg_query.Node + * @instance + */ + Node.prototype.TableLikeClause = null; + + /** + * Node FunctionParameter. + * @member {pg_query.IFunctionParameter|null|undefined} FunctionParameter + * @memberof pg_query.Node + * @instance + */ + Node.prototype.FunctionParameter = null; + + /** + * Node LockingClause. + * @member {pg_query.ILockingClause|null|undefined} LockingClause + * @memberof pg_query.Node + * @instance + */ + Node.prototype.LockingClause = null; + + /** + * Node RowMarkClause. + * @member {pg_query.IRowMarkClause|null|undefined} RowMarkClause + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RowMarkClause = null; + + /** + * Node XmlSerialize. + * @member {pg_query.IXmlSerialize|null|undefined} XmlSerialize + * @memberof pg_query.Node + * @instance + */ + Node.prototype.XmlSerialize = null; + + /** + * Node WithClause. + * @member {pg_query.IWithClause|null|undefined} WithClause + * @memberof pg_query.Node + * @instance + */ + Node.prototype.WithClause = null; + + /** + * Node InferClause. + * @member {pg_query.IInferClause|null|undefined} InferClause + * @memberof pg_query.Node + * @instance + */ + Node.prototype.InferClause = null; + + /** + * Node OnConflictClause. + * @member {pg_query.IOnConflictClause|null|undefined} OnConflictClause + * @memberof pg_query.Node + * @instance + */ + Node.prototype.OnConflictClause = null; + + /** + * Node CommonTableExpr. + * @member {pg_query.ICommonTableExpr|null|undefined} CommonTableExpr + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CommonTableExpr = null; + + /** + * Node RoleSpec. + * @member {pg_query.IRoleSpec|null|undefined} RoleSpec + * @memberof pg_query.Node + * @instance + */ + Node.prototype.RoleSpec = null; + + /** + * Node TriggerTransition. + * @member {pg_query.ITriggerTransition|null|undefined} TriggerTransition + * @memberof pg_query.Node + * @instance + */ + Node.prototype.TriggerTransition = null; + + /** + * Node PartitionElem. + * @member {pg_query.IPartitionElem|null|undefined} PartitionElem + * @memberof pg_query.Node + * @instance + */ + Node.prototype.PartitionElem = null; + + /** + * Node PartitionSpec. + * @member {pg_query.IPartitionSpec|null|undefined} PartitionSpec + * @memberof pg_query.Node + * @instance + */ + Node.prototype.PartitionSpec = null; + + /** + * Node PartitionBoundSpec. + * @member {pg_query.IPartitionBoundSpec|null|undefined} PartitionBoundSpec + * @memberof pg_query.Node + * @instance + */ + Node.prototype.PartitionBoundSpec = null; + + /** + * Node PartitionRangeDatum. + * @member {pg_query.IPartitionRangeDatum|null|undefined} PartitionRangeDatum + * @memberof pg_query.Node + * @instance + */ + Node.prototype.PartitionRangeDatum = null; + + /** + * Node PartitionCmd. + * @member {pg_query.IPartitionCmd|null|undefined} PartitionCmd + * @memberof pg_query.Node + * @instance + */ + Node.prototype.PartitionCmd = null; + + /** + * Node VacuumRelation. + * @member {pg_query.IVacuumRelation|null|undefined} VacuumRelation + * @memberof pg_query.Node + * @instance + */ + Node.prototype.VacuumRelation = null; + + /** + * Node InlineCodeBlock. + * @member {pg_query.IInlineCodeBlock|null|undefined} InlineCodeBlock + * @memberof pg_query.Node + * @instance + */ + Node.prototype.InlineCodeBlock = null; + + /** + * Node CallContext. + * @member {pg_query.ICallContext|null|undefined} CallContext + * @memberof pg_query.Node + * @instance + */ + Node.prototype.CallContext = null; + + /** + * Node Integer. + * @member {pg_query.IInteger|null|undefined} Integer + * @memberof pg_query.Node + * @instance + */ + Node.prototype.Integer = null; + + /** + * Node Float. + * @member {pg_query.IFloat|null|undefined} Float + * @memberof pg_query.Node + * @instance + */ + Node.prototype.Float = null; + + /** + * Node String. + * @member {pg_query.IString|null|undefined} String + * @memberof pg_query.Node + * @instance + */ + Node.prototype.String = null; + + /** + * Node BitString. + * @member {pg_query.IBitString|null|undefined} BitString + * @memberof pg_query.Node + * @instance + */ + Node.prototype.BitString = null; + + /** + * Node Null. + * @member {pg_query.INull|null|undefined} Null + * @memberof pg_query.Node + * @instance + */ + Node.prototype.Null = null; + + /** + * Node List. + * @member {pg_query.IList|null|undefined} List + * @memberof pg_query.Node + * @instance + */ + Node.prototype.List = null; + + /** + * Node IntList. + * @member {pg_query.IIntList|null|undefined} IntList + * @memberof pg_query.Node + * @instance + */ + Node.prototype.IntList = null; + + /** + * Node OidList. + * @member {pg_query.IOidList|null|undefined} OidList + * @memberof pg_query.Node + * @instance + */ + Node.prototype.OidList = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Node node. + * @member {"Alias"|"RangeVar"|"TableFunc"|"Expr"|"Var"|"Param"|"Aggref"|"GroupingFunc"|"WindowFunc"|"SubscriptingRef"|"FuncExpr"|"NamedArgExpr"|"OpExpr"|"DistinctExpr"|"NullIfExpr"|"ScalarArrayOpExpr"|"BoolExpr"|"SubLink"|"SubPlan"|"AlternativeSubPlan"|"FieldSelect"|"FieldStore"|"RelabelType"|"CoerceViaIO"|"ArrayCoerceExpr"|"ConvertRowtypeExpr"|"CollateExpr"|"CaseExpr"|"CaseWhen"|"CaseTestExpr"|"ArrayExpr"|"RowExpr"|"RowCompareExpr"|"CoalesceExpr"|"MinMaxExpr"|"SQLValueFunction"|"XmlExpr"|"NullTest"|"BooleanTest"|"CoerceToDomain"|"CoerceToDomainValue"|"SetToDefault"|"CurrentOfExpr"|"NextValueExpr"|"InferenceElem"|"TargetEntry"|"RangeTblRef"|"JoinExpr"|"FromExpr"|"OnConflictExpr"|"IntoClause"|"RawStmt"|"Query"|"InsertStmt"|"DeleteStmt"|"UpdateStmt"|"SelectStmt"|"AlterTableStmt"|"AlterTableCmd"|"AlterDomainStmt"|"SetOperationStmt"|"GrantStmt"|"GrantRoleStmt"|"AlterDefaultPrivilegesStmt"|"ClosePortalStmt"|"ClusterStmt"|"CopyStmt"|"CreateStmt"|"DefineStmt"|"DropStmt"|"TruncateStmt"|"CommentStmt"|"FetchStmt"|"IndexStmt"|"CreateFunctionStmt"|"AlterFunctionStmt"|"DoStmt"|"RenameStmt"|"RuleStmt"|"NotifyStmt"|"ListenStmt"|"UnlistenStmt"|"TransactionStmt"|"ViewStmt"|"LoadStmt"|"CreateDomainStmt"|"CreatedbStmt"|"DropdbStmt"|"VacuumStmt"|"ExplainStmt"|"CreateTableAsStmt"|"CreateSeqStmt"|"AlterSeqStmt"|"VariableSetStmt"|"VariableShowStmt"|"DiscardStmt"|"CreateTrigStmt"|"CreatePLangStmt"|"CreateRoleStmt"|"AlterRoleStmt"|"DropRoleStmt"|"LockStmt"|"ConstraintsSetStmt"|"ReindexStmt"|"CheckPointStmt"|"CreateSchemaStmt"|"AlterDatabaseStmt"|"AlterDatabaseSetStmt"|"AlterRoleSetStmt"|"CreateConversionStmt"|"CreateCastStmt"|"CreateOpClassStmt"|"CreateOpFamilyStmt"|"AlterOpFamilyStmt"|"PrepareStmt"|"ExecuteStmt"|"DeallocateStmt"|"DeclareCursorStmt"|"CreateTableSpaceStmt"|"DropTableSpaceStmt"|"AlterObjectDependsStmt"|"AlterObjectSchemaStmt"|"AlterOwnerStmt"|"AlterOperatorStmt"|"AlterTypeStmt"|"DropOwnedStmt"|"ReassignOwnedStmt"|"CompositeTypeStmt"|"CreateEnumStmt"|"CreateRangeStmt"|"AlterEnumStmt"|"AlterTSDictionaryStmt"|"AlterTSConfigurationStmt"|"CreateFdwStmt"|"AlterFdwStmt"|"CreateForeignServerStmt"|"AlterForeignServerStmt"|"CreateUserMappingStmt"|"AlterUserMappingStmt"|"DropUserMappingStmt"|"AlterTableSpaceOptionsStmt"|"AlterTableMoveAllStmt"|"SecLabelStmt"|"CreateForeignTableStmt"|"ImportForeignSchemaStmt"|"CreateExtensionStmt"|"AlterExtensionStmt"|"AlterExtensionContentsStmt"|"CreateEventTrigStmt"|"AlterEventTrigStmt"|"RefreshMatViewStmt"|"ReplicaIdentityStmt"|"AlterSystemStmt"|"CreatePolicyStmt"|"AlterPolicyStmt"|"CreateTransformStmt"|"CreateAmStmt"|"CreatePublicationStmt"|"AlterPublicationStmt"|"CreateSubscriptionStmt"|"AlterSubscriptionStmt"|"DropSubscriptionStmt"|"CreateStatsStmt"|"AlterCollationStmt"|"CallStmt"|"AlterStatsStmt"|"A_Expr"|"ColumnRef"|"ParamRef"|"A_Const"|"FuncCall"|"A_Star"|"A_Indices"|"A_Indirection"|"A_ArrayExpr"|"ResTarget"|"MultiAssignRef"|"TypeCast"|"CollateClause"|"SortBy"|"WindowDef"|"RangeSubselect"|"RangeFunction"|"RangeTableSample"|"RangeTableFunc"|"RangeTableFuncCol"|"TypeName"|"ColumnDef"|"IndexElem"|"Constraint"|"DefElem"|"RangeTblEntry"|"RangeTblFunction"|"TableSampleClause"|"WithCheckOption"|"SortGroupClause"|"GroupingSet"|"WindowClause"|"ObjectWithArgs"|"AccessPriv"|"CreateOpClassItem"|"TableLikeClause"|"FunctionParameter"|"LockingClause"|"RowMarkClause"|"XmlSerialize"|"WithClause"|"InferClause"|"OnConflictClause"|"CommonTableExpr"|"RoleSpec"|"TriggerTransition"|"PartitionElem"|"PartitionSpec"|"PartitionBoundSpec"|"PartitionRangeDatum"|"PartitionCmd"|"VacuumRelation"|"InlineCodeBlock"|"CallContext"|"Integer"|"Float"|"String"|"BitString"|"Null"|"List"|"IntList"|"OidList"|undefined} node + * @memberof pg_query.Node + * @instance + */ + Object.defineProperty(Node.prototype, "node", { + get: $util.oneOfGetter($oneOfFields = ["Alias", "RangeVar", "TableFunc", "Expr", "Var", "Param", "Aggref", "GroupingFunc", "WindowFunc", "SubscriptingRef", "FuncExpr", "NamedArgExpr", "OpExpr", "DistinctExpr", "NullIfExpr", "ScalarArrayOpExpr", "BoolExpr", "SubLink", "SubPlan", "AlternativeSubPlan", "FieldSelect", "FieldStore", "RelabelType", "CoerceViaIO", "ArrayCoerceExpr", "ConvertRowtypeExpr", "CollateExpr", "CaseExpr", "CaseWhen", "CaseTestExpr", "ArrayExpr", "RowExpr", "RowCompareExpr", "CoalesceExpr", "MinMaxExpr", "SQLValueFunction", "XmlExpr", "NullTest", "BooleanTest", "CoerceToDomain", "CoerceToDomainValue", "SetToDefault", "CurrentOfExpr", "NextValueExpr", "InferenceElem", "TargetEntry", "RangeTblRef", "JoinExpr", "FromExpr", "OnConflictExpr", "IntoClause", "RawStmt", "Query", "InsertStmt", "DeleteStmt", "UpdateStmt", "SelectStmt", "AlterTableStmt", "AlterTableCmd", "AlterDomainStmt", "SetOperationStmt", "GrantStmt", "GrantRoleStmt", "AlterDefaultPrivilegesStmt", "ClosePortalStmt", "ClusterStmt", "CopyStmt", "CreateStmt", "DefineStmt", "DropStmt", "TruncateStmt", "CommentStmt", "FetchStmt", "IndexStmt", "CreateFunctionStmt", "AlterFunctionStmt", "DoStmt", "RenameStmt", "RuleStmt", "NotifyStmt", "ListenStmt", "UnlistenStmt", "TransactionStmt", "ViewStmt", "LoadStmt", "CreateDomainStmt", "CreatedbStmt", "DropdbStmt", "VacuumStmt", "ExplainStmt", "CreateTableAsStmt", "CreateSeqStmt", "AlterSeqStmt", "VariableSetStmt", "VariableShowStmt", "DiscardStmt", "CreateTrigStmt", "CreatePLangStmt", "CreateRoleStmt", "AlterRoleStmt", "DropRoleStmt", "LockStmt", "ConstraintsSetStmt", "ReindexStmt", "CheckPointStmt", "CreateSchemaStmt", "AlterDatabaseStmt", "AlterDatabaseSetStmt", "AlterRoleSetStmt", "CreateConversionStmt", "CreateCastStmt", "CreateOpClassStmt", "CreateOpFamilyStmt", "AlterOpFamilyStmt", "PrepareStmt", "ExecuteStmt", "DeallocateStmt", "DeclareCursorStmt", "CreateTableSpaceStmt", "DropTableSpaceStmt", "AlterObjectDependsStmt", "AlterObjectSchemaStmt", "AlterOwnerStmt", "AlterOperatorStmt", "AlterTypeStmt", "DropOwnedStmt", "ReassignOwnedStmt", "CompositeTypeStmt", "CreateEnumStmt", "CreateRangeStmt", "AlterEnumStmt", "AlterTSDictionaryStmt", "AlterTSConfigurationStmt", "CreateFdwStmt", "AlterFdwStmt", "CreateForeignServerStmt", "AlterForeignServerStmt", "CreateUserMappingStmt", "AlterUserMappingStmt", "DropUserMappingStmt", "AlterTableSpaceOptionsStmt", "AlterTableMoveAllStmt", "SecLabelStmt", "CreateForeignTableStmt", "ImportForeignSchemaStmt", "CreateExtensionStmt", "AlterExtensionStmt", "AlterExtensionContentsStmt", "CreateEventTrigStmt", "AlterEventTrigStmt", "RefreshMatViewStmt", "ReplicaIdentityStmt", "AlterSystemStmt", "CreatePolicyStmt", "AlterPolicyStmt", "CreateTransformStmt", "CreateAmStmt", "CreatePublicationStmt", "AlterPublicationStmt", "CreateSubscriptionStmt", "AlterSubscriptionStmt", "DropSubscriptionStmt", "CreateStatsStmt", "AlterCollationStmt", "CallStmt", "AlterStatsStmt", "A_Expr", "ColumnRef", "ParamRef", "A_Const", "FuncCall", "A_Star", "A_Indices", "A_Indirection", "A_ArrayExpr", "ResTarget", "MultiAssignRef", "TypeCast", "CollateClause", "SortBy", "WindowDef", "RangeSubselect", "RangeFunction", "RangeTableSample", "RangeTableFunc", "RangeTableFuncCol", "TypeName", "ColumnDef", "IndexElem", "Constraint", "DefElem", "RangeTblEntry", "RangeTblFunction", "TableSampleClause", "WithCheckOption", "SortGroupClause", "GroupingSet", "WindowClause", "ObjectWithArgs", "AccessPriv", "CreateOpClassItem", "TableLikeClause", "FunctionParameter", "LockingClause", "RowMarkClause", "XmlSerialize", "WithClause", "InferClause", "OnConflictClause", "CommonTableExpr", "RoleSpec", "TriggerTransition", "PartitionElem", "PartitionSpec", "PartitionBoundSpec", "PartitionRangeDatum", "PartitionCmd", "VacuumRelation", "InlineCodeBlock", "CallContext", "Integer", "Float", "String", "BitString", "Null", "List", "IntList", "OidList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Node instance using the specified properties. + * @function create + * @memberof pg_query.Node + * @static + * @param {pg_query.INode=} [properties] Properties to set + * @returns {pg_query.Node} Node instance + */ + Node.create = function create(properties) { + return new Node(properties); + }; + + /** + * Encodes the specified Node message. Does not implicitly {@link pg_query.Node.verify|verify} messages. + * @function encode + * @memberof pg_query.Node + * @static + * @param {pg_query.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.Alias != null && Object.hasOwnProperty.call(message, "Alias")) + $root.pg_query.Alias.encode(message.Alias, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.RangeVar != null && Object.hasOwnProperty.call(message, "RangeVar")) + $root.pg_query.RangeVar.encode(message.RangeVar, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.TableFunc != null && Object.hasOwnProperty.call(message, "TableFunc")) + $root.pg_query.TableFunc.encode(message.TableFunc, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.Expr != null && Object.hasOwnProperty.call(message, "Expr")) + $root.pg_query.Expr.encode(message.Expr, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.Var != null && Object.hasOwnProperty.call(message, "Var")) + $root.pg_query.Var.encode(message.Var, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.Param != null && Object.hasOwnProperty.call(message, "Param")) + $root.pg_query.Param.encode(message.Param, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.Aggref != null && Object.hasOwnProperty.call(message, "Aggref")) + $root.pg_query.Aggref.encode(message.Aggref, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.GroupingFunc != null && Object.hasOwnProperty.call(message, "GroupingFunc")) + $root.pg_query.GroupingFunc.encode(message.GroupingFunc, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.WindowFunc != null && Object.hasOwnProperty.call(message, "WindowFunc")) + $root.pg_query.WindowFunc.encode(message.WindowFunc, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.SubscriptingRef != null && Object.hasOwnProperty.call(message, "SubscriptingRef")) + $root.pg_query.SubscriptingRef.encode(message.SubscriptingRef, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.FuncExpr != null && Object.hasOwnProperty.call(message, "FuncExpr")) + $root.pg_query.FuncExpr.encode(message.FuncExpr, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.NamedArgExpr != null && Object.hasOwnProperty.call(message, "NamedArgExpr")) + $root.pg_query.NamedArgExpr.encode(message.NamedArgExpr, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.OpExpr != null && Object.hasOwnProperty.call(message, "OpExpr")) + $root.pg_query.OpExpr.encode(message.OpExpr, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.DistinctExpr != null && Object.hasOwnProperty.call(message, "DistinctExpr")) + $root.pg_query.DistinctExpr.encode(message.DistinctExpr, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.NullIfExpr != null && Object.hasOwnProperty.call(message, "NullIfExpr")) + $root.pg_query.NullIfExpr.encode(message.NullIfExpr, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.ScalarArrayOpExpr != null && Object.hasOwnProperty.call(message, "ScalarArrayOpExpr")) + $root.pg_query.ScalarArrayOpExpr.encode(message.ScalarArrayOpExpr, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.BoolExpr != null && Object.hasOwnProperty.call(message, "BoolExpr")) + $root.pg_query.BoolExpr.encode(message.BoolExpr, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.SubLink != null && Object.hasOwnProperty.call(message, "SubLink")) + $root.pg_query.SubLink.encode(message.SubLink, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.SubPlan != null && Object.hasOwnProperty.call(message, "SubPlan")) + $root.pg_query.SubPlan.encode(message.SubPlan, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.AlternativeSubPlan != null && Object.hasOwnProperty.call(message, "AlternativeSubPlan")) + $root.pg_query.AlternativeSubPlan.encode(message.AlternativeSubPlan, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.FieldSelect != null && Object.hasOwnProperty.call(message, "FieldSelect")) + $root.pg_query.FieldSelect.encode(message.FieldSelect, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.FieldStore != null && Object.hasOwnProperty.call(message, "FieldStore")) + $root.pg_query.FieldStore.encode(message.FieldStore, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.RelabelType != null && Object.hasOwnProperty.call(message, "RelabelType")) + $root.pg_query.RelabelType.encode(message.RelabelType, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.CoerceViaIO != null && Object.hasOwnProperty.call(message, "CoerceViaIO")) + $root.pg_query.CoerceViaIO.encode(message.CoerceViaIO, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.ArrayCoerceExpr != null && Object.hasOwnProperty.call(message, "ArrayCoerceExpr")) + $root.pg_query.ArrayCoerceExpr.encode(message.ArrayCoerceExpr, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.ConvertRowtypeExpr != null && Object.hasOwnProperty.call(message, "ConvertRowtypeExpr")) + $root.pg_query.ConvertRowtypeExpr.encode(message.ConvertRowtypeExpr, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.CollateExpr != null && Object.hasOwnProperty.call(message, "CollateExpr")) + $root.pg_query.CollateExpr.encode(message.CollateExpr, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.CaseExpr != null && Object.hasOwnProperty.call(message, "CaseExpr")) + $root.pg_query.CaseExpr.encode(message.CaseExpr, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.CaseWhen != null && Object.hasOwnProperty.call(message, "CaseWhen")) + $root.pg_query.CaseWhen.encode(message.CaseWhen, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.CaseTestExpr != null && Object.hasOwnProperty.call(message, "CaseTestExpr")) + $root.pg_query.CaseTestExpr.encode(message.CaseTestExpr, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.ArrayExpr != null && Object.hasOwnProperty.call(message, "ArrayExpr")) + $root.pg_query.ArrayExpr.encode(message.ArrayExpr, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.RowExpr != null && Object.hasOwnProperty.call(message, "RowExpr")) + $root.pg_query.RowExpr.encode(message.RowExpr, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.RowCompareExpr != null && Object.hasOwnProperty.call(message, "RowCompareExpr")) + $root.pg_query.RowCompareExpr.encode(message.RowCompareExpr, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.CoalesceExpr != null && Object.hasOwnProperty.call(message, "CoalesceExpr")) + $root.pg_query.CoalesceExpr.encode(message.CoalesceExpr, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.MinMaxExpr != null && Object.hasOwnProperty.call(message, "MinMaxExpr")) + $root.pg_query.MinMaxExpr.encode(message.MinMaxExpr, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.SQLValueFunction != null && Object.hasOwnProperty.call(message, "SQLValueFunction")) + $root.pg_query.SQLValueFunction.encode(message.SQLValueFunction, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + if (message.XmlExpr != null && Object.hasOwnProperty.call(message, "XmlExpr")) + $root.pg_query.XmlExpr.encode(message.XmlExpr, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + if (message.NullTest != null && Object.hasOwnProperty.call(message, "NullTest")) + $root.pg_query.NullTest.encode(message.NullTest, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + if (message.BooleanTest != null && Object.hasOwnProperty.call(message, "BooleanTest")) + $root.pg_query.BooleanTest.encode(message.BooleanTest, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.CoerceToDomain != null && Object.hasOwnProperty.call(message, "CoerceToDomain")) + $root.pg_query.CoerceToDomain.encode(message.CoerceToDomain, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + if (message.CoerceToDomainValue != null && Object.hasOwnProperty.call(message, "CoerceToDomainValue")) + $root.pg_query.CoerceToDomainValue.encode(message.CoerceToDomainValue, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + if (message.SetToDefault != null && Object.hasOwnProperty.call(message, "SetToDefault")) + $root.pg_query.SetToDefault.encode(message.SetToDefault, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.CurrentOfExpr != null && Object.hasOwnProperty.call(message, "CurrentOfExpr")) + $root.pg_query.CurrentOfExpr.encode(message.CurrentOfExpr, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + if (message.NextValueExpr != null && Object.hasOwnProperty.call(message, "NextValueExpr")) + $root.pg_query.NextValueExpr.encode(message.NextValueExpr, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.InferenceElem != null && Object.hasOwnProperty.call(message, "InferenceElem")) + $root.pg_query.InferenceElem.encode(message.InferenceElem, writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); + if (message.TargetEntry != null && Object.hasOwnProperty.call(message, "TargetEntry")) + $root.pg_query.TargetEntry.encode(message.TargetEntry, writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim(); + if (message.RangeTblRef != null && Object.hasOwnProperty.call(message, "RangeTblRef")) + $root.pg_query.RangeTblRef.encode(message.RangeTblRef, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); + if (message.JoinExpr != null && Object.hasOwnProperty.call(message, "JoinExpr")) + $root.pg_query.JoinExpr.encode(message.JoinExpr, writer.uint32(/* id 48, wireType 2 =*/386).fork()).ldelim(); + if (message.FromExpr != null && Object.hasOwnProperty.call(message, "FromExpr")) + $root.pg_query.FromExpr.encode(message.FromExpr, writer.uint32(/* id 49, wireType 2 =*/394).fork()).ldelim(); + if (message.OnConflictExpr != null && Object.hasOwnProperty.call(message, "OnConflictExpr")) + $root.pg_query.OnConflictExpr.encode(message.OnConflictExpr, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.IntoClause != null && Object.hasOwnProperty.call(message, "IntoClause")) + $root.pg_query.IntoClause.encode(message.IntoClause, writer.uint32(/* id 51, wireType 2 =*/410).fork()).ldelim(); + if (message.RawStmt != null && Object.hasOwnProperty.call(message, "RawStmt")) + $root.pg_query.RawStmt.encode(message.RawStmt, writer.uint32(/* id 52, wireType 2 =*/418).fork()).ldelim(); + if (message.Query != null && Object.hasOwnProperty.call(message, "Query")) + $root.pg_query.Query.encode(message.Query, writer.uint32(/* id 53, wireType 2 =*/426).fork()).ldelim(); + if (message.InsertStmt != null && Object.hasOwnProperty.call(message, "InsertStmt")) + $root.pg_query.InsertStmt.encode(message.InsertStmt, writer.uint32(/* id 54, wireType 2 =*/434).fork()).ldelim(); + if (message.DeleteStmt != null && Object.hasOwnProperty.call(message, "DeleteStmt")) + $root.pg_query.DeleteStmt.encode(message.DeleteStmt, writer.uint32(/* id 55, wireType 2 =*/442).fork()).ldelim(); + if (message.UpdateStmt != null && Object.hasOwnProperty.call(message, "UpdateStmt")) + $root.pg_query.UpdateStmt.encode(message.UpdateStmt, writer.uint32(/* id 56, wireType 2 =*/450).fork()).ldelim(); + if (message.SelectStmt != null && Object.hasOwnProperty.call(message, "SelectStmt")) + $root.pg_query.SelectStmt.encode(message.SelectStmt, writer.uint32(/* id 57, wireType 2 =*/458).fork()).ldelim(); + if (message.AlterTableStmt != null && Object.hasOwnProperty.call(message, "AlterTableStmt")) + $root.pg_query.AlterTableStmt.encode(message.AlterTableStmt, writer.uint32(/* id 58, wireType 2 =*/466).fork()).ldelim(); + if (message.AlterTableCmd != null && Object.hasOwnProperty.call(message, "AlterTableCmd")) + $root.pg_query.AlterTableCmd.encode(message.AlterTableCmd, writer.uint32(/* id 59, wireType 2 =*/474).fork()).ldelim(); + if (message.AlterDomainStmt != null && Object.hasOwnProperty.call(message, "AlterDomainStmt")) + $root.pg_query.AlterDomainStmt.encode(message.AlterDomainStmt, writer.uint32(/* id 60, wireType 2 =*/482).fork()).ldelim(); + if (message.SetOperationStmt != null && Object.hasOwnProperty.call(message, "SetOperationStmt")) + $root.pg_query.SetOperationStmt.encode(message.SetOperationStmt, writer.uint32(/* id 61, wireType 2 =*/490).fork()).ldelim(); + if (message.GrantStmt != null && Object.hasOwnProperty.call(message, "GrantStmt")) + $root.pg_query.GrantStmt.encode(message.GrantStmt, writer.uint32(/* id 62, wireType 2 =*/498).fork()).ldelim(); + if (message.GrantRoleStmt != null && Object.hasOwnProperty.call(message, "GrantRoleStmt")) + $root.pg_query.GrantRoleStmt.encode(message.GrantRoleStmt, writer.uint32(/* id 63, wireType 2 =*/506).fork()).ldelim(); + if (message.AlterDefaultPrivilegesStmt != null && Object.hasOwnProperty.call(message, "AlterDefaultPrivilegesStmt")) + $root.pg_query.AlterDefaultPrivilegesStmt.encode(message.AlterDefaultPrivilegesStmt, writer.uint32(/* id 64, wireType 2 =*/514).fork()).ldelim(); + if (message.ClosePortalStmt != null && Object.hasOwnProperty.call(message, "ClosePortalStmt")) + $root.pg_query.ClosePortalStmt.encode(message.ClosePortalStmt, writer.uint32(/* id 65, wireType 2 =*/522).fork()).ldelim(); + if (message.ClusterStmt != null && Object.hasOwnProperty.call(message, "ClusterStmt")) + $root.pg_query.ClusterStmt.encode(message.ClusterStmt, writer.uint32(/* id 66, wireType 2 =*/530).fork()).ldelim(); + if (message.CopyStmt != null && Object.hasOwnProperty.call(message, "CopyStmt")) + $root.pg_query.CopyStmt.encode(message.CopyStmt, writer.uint32(/* id 67, wireType 2 =*/538).fork()).ldelim(); + if (message.CreateStmt != null && Object.hasOwnProperty.call(message, "CreateStmt")) + $root.pg_query.CreateStmt.encode(message.CreateStmt, writer.uint32(/* id 68, wireType 2 =*/546).fork()).ldelim(); + if (message.DefineStmt != null && Object.hasOwnProperty.call(message, "DefineStmt")) + $root.pg_query.DefineStmt.encode(message.DefineStmt, writer.uint32(/* id 69, wireType 2 =*/554).fork()).ldelim(); + if (message.DropStmt != null && Object.hasOwnProperty.call(message, "DropStmt")) + $root.pg_query.DropStmt.encode(message.DropStmt, writer.uint32(/* id 70, wireType 2 =*/562).fork()).ldelim(); + if (message.TruncateStmt != null && Object.hasOwnProperty.call(message, "TruncateStmt")) + $root.pg_query.TruncateStmt.encode(message.TruncateStmt, writer.uint32(/* id 71, wireType 2 =*/570).fork()).ldelim(); + if (message.CommentStmt != null && Object.hasOwnProperty.call(message, "CommentStmt")) + $root.pg_query.CommentStmt.encode(message.CommentStmt, writer.uint32(/* id 72, wireType 2 =*/578).fork()).ldelim(); + if (message.FetchStmt != null && Object.hasOwnProperty.call(message, "FetchStmt")) + $root.pg_query.FetchStmt.encode(message.FetchStmt, writer.uint32(/* id 73, wireType 2 =*/586).fork()).ldelim(); + if (message.IndexStmt != null && Object.hasOwnProperty.call(message, "IndexStmt")) + $root.pg_query.IndexStmt.encode(message.IndexStmt, writer.uint32(/* id 74, wireType 2 =*/594).fork()).ldelim(); + if (message.CreateFunctionStmt != null && Object.hasOwnProperty.call(message, "CreateFunctionStmt")) + $root.pg_query.CreateFunctionStmt.encode(message.CreateFunctionStmt, writer.uint32(/* id 75, wireType 2 =*/602).fork()).ldelim(); + if (message.AlterFunctionStmt != null && Object.hasOwnProperty.call(message, "AlterFunctionStmt")) + $root.pg_query.AlterFunctionStmt.encode(message.AlterFunctionStmt, writer.uint32(/* id 76, wireType 2 =*/610).fork()).ldelim(); + if (message.DoStmt != null && Object.hasOwnProperty.call(message, "DoStmt")) + $root.pg_query.DoStmt.encode(message.DoStmt, writer.uint32(/* id 77, wireType 2 =*/618).fork()).ldelim(); + if (message.RenameStmt != null && Object.hasOwnProperty.call(message, "RenameStmt")) + $root.pg_query.RenameStmt.encode(message.RenameStmt, writer.uint32(/* id 78, wireType 2 =*/626).fork()).ldelim(); + if (message.RuleStmt != null && Object.hasOwnProperty.call(message, "RuleStmt")) + $root.pg_query.RuleStmt.encode(message.RuleStmt, writer.uint32(/* id 79, wireType 2 =*/634).fork()).ldelim(); + if (message.NotifyStmt != null && Object.hasOwnProperty.call(message, "NotifyStmt")) + $root.pg_query.NotifyStmt.encode(message.NotifyStmt, writer.uint32(/* id 80, wireType 2 =*/642).fork()).ldelim(); + if (message.ListenStmt != null && Object.hasOwnProperty.call(message, "ListenStmt")) + $root.pg_query.ListenStmt.encode(message.ListenStmt, writer.uint32(/* id 81, wireType 2 =*/650).fork()).ldelim(); + if (message.UnlistenStmt != null && Object.hasOwnProperty.call(message, "UnlistenStmt")) + $root.pg_query.UnlistenStmt.encode(message.UnlistenStmt, writer.uint32(/* id 82, wireType 2 =*/658).fork()).ldelim(); + if (message.TransactionStmt != null && Object.hasOwnProperty.call(message, "TransactionStmt")) + $root.pg_query.TransactionStmt.encode(message.TransactionStmt, writer.uint32(/* id 83, wireType 2 =*/666).fork()).ldelim(); + if (message.ViewStmt != null && Object.hasOwnProperty.call(message, "ViewStmt")) + $root.pg_query.ViewStmt.encode(message.ViewStmt, writer.uint32(/* id 84, wireType 2 =*/674).fork()).ldelim(); + if (message.LoadStmt != null && Object.hasOwnProperty.call(message, "LoadStmt")) + $root.pg_query.LoadStmt.encode(message.LoadStmt, writer.uint32(/* id 85, wireType 2 =*/682).fork()).ldelim(); + if (message.CreateDomainStmt != null && Object.hasOwnProperty.call(message, "CreateDomainStmt")) + $root.pg_query.CreateDomainStmt.encode(message.CreateDomainStmt, writer.uint32(/* id 86, wireType 2 =*/690).fork()).ldelim(); + if (message.CreatedbStmt != null && Object.hasOwnProperty.call(message, "CreatedbStmt")) + $root.pg_query.CreatedbStmt.encode(message.CreatedbStmt, writer.uint32(/* id 87, wireType 2 =*/698).fork()).ldelim(); + if (message.DropdbStmt != null && Object.hasOwnProperty.call(message, "DropdbStmt")) + $root.pg_query.DropdbStmt.encode(message.DropdbStmt, writer.uint32(/* id 88, wireType 2 =*/706).fork()).ldelim(); + if (message.VacuumStmt != null && Object.hasOwnProperty.call(message, "VacuumStmt")) + $root.pg_query.VacuumStmt.encode(message.VacuumStmt, writer.uint32(/* id 89, wireType 2 =*/714).fork()).ldelim(); + if (message.ExplainStmt != null && Object.hasOwnProperty.call(message, "ExplainStmt")) + $root.pg_query.ExplainStmt.encode(message.ExplainStmt, writer.uint32(/* id 90, wireType 2 =*/722).fork()).ldelim(); + if (message.CreateTableAsStmt != null && Object.hasOwnProperty.call(message, "CreateTableAsStmt")) + $root.pg_query.CreateTableAsStmt.encode(message.CreateTableAsStmt, writer.uint32(/* id 91, wireType 2 =*/730).fork()).ldelim(); + if (message.CreateSeqStmt != null && Object.hasOwnProperty.call(message, "CreateSeqStmt")) + $root.pg_query.CreateSeqStmt.encode(message.CreateSeqStmt, writer.uint32(/* id 92, wireType 2 =*/738).fork()).ldelim(); + if (message.AlterSeqStmt != null && Object.hasOwnProperty.call(message, "AlterSeqStmt")) + $root.pg_query.AlterSeqStmt.encode(message.AlterSeqStmt, writer.uint32(/* id 93, wireType 2 =*/746).fork()).ldelim(); + if (message.VariableSetStmt != null && Object.hasOwnProperty.call(message, "VariableSetStmt")) + $root.pg_query.VariableSetStmt.encode(message.VariableSetStmt, writer.uint32(/* id 94, wireType 2 =*/754).fork()).ldelim(); + if (message.VariableShowStmt != null && Object.hasOwnProperty.call(message, "VariableShowStmt")) + $root.pg_query.VariableShowStmt.encode(message.VariableShowStmt, writer.uint32(/* id 95, wireType 2 =*/762).fork()).ldelim(); + if (message.DiscardStmt != null && Object.hasOwnProperty.call(message, "DiscardStmt")) + $root.pg_query.DiscardStmt.encode(message.DiscardStmt, writer.uint32(/* id 96, wireType 2 =*/770).fork()).ldelim(); + if (message.CreateTrigStmt != null && Object.hasOwnProperty.call(message, "CreateTrigStmt")) + $root.pg_query.CreateTrigStmt.encode(message.CreateTrigStmt, writer.uint32(/* id 97, wireType 2 =*/778).fork()).ldelim(); + if (message.CreatePLangStmt != null && Object.hasOwnProperty.call(message, "CreatePLangStmt")) + $root.pg_query.CreatePLangStmt.encode(message.CreatePLangStmt, writer.uint32(/* id 98, wireType 2 =*/786).fork()).ldelim(); + if (message.CreateRoleStmt != null && Object.hasOwnProperty.call(message, "CreateRoleStmt")) + $root.pg_query.CreateRoleStmt.encode(message.CreateRoleStmt, writer.uint32(/* id 99, wireType 2 =*/794).fork()).ldelim(); + if (message.AlterRoleStmt != null && Object.hasOwnProperty.call(message, "AlterRoleStmt")) + $root.pg_query.AlterRoleStmt.encode(message.AlterRoleStmt, writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim(); + if (message.DropRoleStmt != null && Object.hasOwnProperty.call(message, "DropRoleStmt")) + $root.pg_query.DropRoleStmt.encode(message.DropRoleStmt, writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim(); + if (message.LockStmt != null && Object.hasOwnProperty.call(message, "LockStmt")) + $root.pg_query.LockStmt.encode(message.LockStmt, writer.uint32(/* id 102, wireType 2 =*/818).fork()).ldelim(); + if (message.ConstraintsSetStmt != null && Object.hasOwnProperty.call(message, "ConstraintsSetStmt")) + $root.pg_query.ConstraintsSetStmt.encode(message.ConstraintsSetStmt, writer.uint32(/* id 103, wireType 2 =*/826).fork()).ldelim(); + if (message.ReindexStmt != null && Object.hasOwnProperty.call(message, "ReindexStmt")) + $root.pg_query.ReindexStmt.encode(message.ReindexStmt, writer.uint32(/* id 104, wireType 2 =*/834).fork()).ldelim(); + if (message.CheckPointStmt != null && Object.hasOwnProperty.call(message, "CheckPointStmt")) + $root.pg_query.CheckPointStmt.encode(message.CheckPointStmt, writer.uint32(/* id 105, wireType 2 =*/842).fork()).ldelim(); + if (message.CreateSchemaStmt != null && Object.hasOwnProperty.call(message, "CreateSchemaStmt")) + $root.pg_query.CreateSchemaStmt.encode(message.CreateSchemaStmt, writer.uint32(/* id 106, wireType 2 =*/850).fork()).ldelim(); + if (message.AlterDatabaseStmt != null && Object.hasOwnProperty.call(message, "AlterDatabaseStmt")) + $root.pg_query.AlterDatabaseStmt.encode(message.AlterDatabaseStmt, writer.uint32(/* id 107, wireType 2 =*/858).fork()).ldelim(); + if (message.AlterDatabaseSetStmt != null && Object.hasOwnProperty.call(message, "AlterDatabaseSetStmt")) + $root.pg_query.AlterDatabaseSetStmt.encode(message.AlterDatabaseSetStmt, writer.uint32(/* id 108, wireType 2 =*/866).fork()).ldelim(); + if (message.AlterRoleSetStmt != null && Object.hasOwnProperty.call(message, "AlterRoleSetStmt")) + $root.pg_query.AlterRoleSetStmt.encode(message.AlterRoleSetStmt, writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.CreateConversionStmt != null && Object.hasOwnProperty.call(message, "CreateConversionStmt")) + $root.pg_query.CreateConversionStmt.encode(message.CreateConversionStmt, writer.uint32(/* id 110, wireType 2 =*/882).fork()).ldelim(); + if (message.CreateCastStmt != null && Object.hasOwnProperty.call(message, "CreateCastStmt")) + $root.pg_query.CreateCastStmt.encode(message.CreateCastStmt, writer.uint32(/* id 111, wireType 2 =*/890).fork()).ldelim(); + if (message.CreateOpClassStmt != null && Object.hasOwnProperty.call(message, "CreateOpClassStmt")) + $root.pg_query.CreateOpClassStmt.encode(message.CreateOpClassStmt, writer.uint32(/* id 112, wireType 2 =*/898).fork()).ldelim(); + if (message.CreateOpFamilyStmt != null && Object.hasOwnProperty.call(message, "CreateOpFamilyStmt")) + $root.pg_query.CreateOpFamilyStmt.encode(message.CreateOpFamilyStmt, writer.uint32(/* id 113, wireType 2 =*/906).fork()).ldelim(); + if (message.AlterOpFamilyStmt != null && Object.hasOwnProperty.call(message, "AlterOpFamilyStmt")) + $root.pg_query.AlterOpFamilyStmt.encode(message.AlterOpFamilyStmt, writer.uint32(/* id 114, wireType 2 =*/914).fork()).ldelim(); + if (message.PrepareStmt != null && Object.hasOwnProperty.call(message, "PrepareStmt")) + $root.pg_query.PrepareStmt.encode(message.PrepareStmt, writer.uint32(/* id 115, wireType 2 =*/922).fork()).ldelim(); + if (message.ExecuteStmt != null && Object.hasOwnProperty.call(message, "ExecuteStmt")) + $root.pg_query.ExecuteStmt.encode(message.ExecuteStmt, writer.uint32(/* id 116, wireType 2 =*/930).fork()).ldelim(); + if (message.DeallocateStmt != null && Object.hasOwnProperty.call(message, "DeallocateStmt")) + $root.pg_query.DeallocateStmt.encode(message.DeallocateStmt, writer.uint32(/* id 117, wireType 2 =*/938).fork()).ldelim(); + if (message.DeclareCursorStmt != null && Object.hasOwnProperty.call(message, "DeclareCursorStmt")) + $root.pg_query.DeclareCursorStmt.encode(message.DeclareCursorStmt, writer.uint32(/* id 118, wireType 2 =*/946).fork()).ldelim(); + if (message.CreateTableSpaceStmt != null && Object.hasOwnProperty.call(message, "CreateTableSpaceStmt")) + $root.pg_query.CreateTableSpaceStmt.encode(message.CreateTableSpaceStmt, writer.uint32(/* id 119, wireType 2 =*/954).fork()).ldelim(); + if (message.DropTableSpaceStmt != null && Object.hasOwnProperty.call(message, "DropTableSpaceStmt")) + $root.pg_query.DropTableSpaceStmt.encode(message.DropTableSpaceStmt, writer.uint32(/* id 120, wireType 2 =*/962).fork()).ldelim(); + if (message.AlterObjectDependsStmt != null && Object.hasOwnProperty.call(message, "AlterObjectDependsStmt")) + $root.pg_query.AlterObjectDependsStmt.encode(message.AlterObjectDependsStmt, writer.uint32(/* id 121, wireType 2 =*/970).fork()).ldelim(); + if (message.AlterObjectSchemaStmt != null && Object.hasOwnProperty.call(message, "AlterObjectSchemaStmt")) + $root.pg_query.AlterObjectSchemaStmt.encode(message.AlterObjectSchemaStmt, writer.uint32(/* id 122, wireType 2 =*/978).fork()).ldelim(); + if (message.AlterOwnerStmt != null && Object.hasOwnProperty.call(message, "AlterOwnerStmt")) + $root.pg_query.AlterOwnerStmt.encode(message.AlterOwnerStmt, writer.uint32(/* id 123, wireType 2 =*/986).fork()).ldelim(); + if (message.AlterOperatorStmt != null && Object.hasOwnProperty.call(message, "AlterOperatorStmt")) + $root.pg_query.AlterOperatorStmt.encode(message.AlterOperatorStmt, writer.uint32(/* id 124, wireType 2 =*/994).fork()).ldelim(); + if (message.AlterTypeStmt != null && Object.hasOwnProperty.call(message, "AlterTypeStmt")) + $root.pg_query.AlterTypeStmt.encode(message.AlterTypeStmt, writer.uint32(/* id 125, wireType 2 =*/1002).fork()).ldelim(); + if (message.DropOwnedStmt != null && Object.hasOwnProperty.call(message, "DropOwnedStmt")) + $root.pg_query.DropOwnedStmt.encode(message.DropOwnedStmt, writer.uint32(/* id 126, wireType 2 =*/1010).fork()).ldelim(); + if (message.ReassignOwnedStmt != null && Object.hasOwnProperty.call(message, "ReassignOwnedStmt")) + $root.pg_query.ReassignOwnedStmt.encode(message.ReassignOwnedStmt, writer.uint32(/* id 127, wireType 2 =*/1018).fork()).ldelim(); + if (message.CompositeTypeStmt != null && Object.hasOwnProperty.call(message, "CompositeTypeStmt")) + $root.pg_query.CompositeTypeStmt.encode(message.CompositeTypeStmt, writer.uint32(/* id 128, wireType 2 =*/1026).fork()).ldelim(); + if (message.CreateEnumStmt != null && Object.hasOwnProperty.call(message, "CreateEnumStmt")) + $root.pg_query.CreateEnumStmt.encode(message.CreateEnumStmt, writer.uint32(/* id 129, wireType 2 =*/1034).fork()).ldelim(); + if (message.CreateRangeStmt != null && Object.hasOwnProperty.call(message, "CreateRangeStmt")) + $root.pg_query.CreateRangeStmt.encode(message.CreateRangeStmt, writer.uint32(/* id 130, wireType 2 =*/1042).fork()).ldelim(); + if (message.AlterEnumStmt != null && Object.hasOwnProperty.call(message, "AlterEnumStmt")) + $root.pg_query.AlterEnumStmt.encode(message.AlterEnumStmt, writer.uint32(/* id 131, wireType 2 =*/1050).fork()).ldelim(); + if (message.AlterTSDictionaryStmt != null && Object.hasOwnProperty.call(message, "AlterTSDictionaryStmt")) + $root.pg_query.AlterTSDictionaryStmt.encode(message.AlterTSDictionaryStmt, writer.uint32(/* id 132, wireType 2 =*/1058).fork()).ldelim(); + if (message.AlterTSConfigurationStmt != null && Object.hasOwnProperty.call(message, "AlterTSConfigurationStmt")) + $root.pg_query.AlterTSConfigurationStmt.encode(message.AlterTSConfigurationStmt, writer.uint32(/* id 133, wireType 2 =*/1066).fork()).ldelim(); + if (message.CreateFdwStmt != null && Object.hasOwnProperty.call(message, "CreateFdwStmt")) + $root.pg_query.CreateFdwStmt.encode(message.CreateFdwStmt, writer.uint32(/* id 134, wireType 2 =*/1074).fork()).ldelim(); + if (message.AlterFdwStmt != null && Object.hasOwnProperty.call(message, "AlterFdwStmt")) + $root.pg_query.AlterFdwStmt.encode(message.AlterFdwStmt, writer.uint32(/* id 135, wireType 2 =*/1082).fork()).ldelim(); + if (message.CreateForeignServerStmt != null && Object.hasOwnProperty.call(message, "CreateForeignServerStmt")) + $root.pg_query.CreateForeignServerStmt.encode(message.CreateForeignServerStmt, writer.uint32(/* id 136, wireType 2 =*/1090).fork()).ldelim(); + if (message.AlterForeignServerStmt != null && Object.hasOwnProperty.call(message, "AlterForeignServerStmt")) + $root.pg_query.AlterForeignServerStmt.encode(message.AlterForeignServerStmt, writer.uint32(/* id 137, wireType 2 =*/1098).fork()).ldelim(); + if (message.CreateUserMappingStmt != null && Object.hasOwnProperty.call(message, "CreateUserMappingStmt")) + $root.pg_query.CreateUserMappingStmt.encode(message.CreateUserMappingStmt, writer.uint32(/* id 138, wireType 2 =*/1106).fork()).ldelim(); + if (message.AlterUserMappingStmt != null && Object.hasOwnProperty.call(message, "AlterUserMappingStmt")) + $root.pg_query.AlterUserMappingStmt.encode(message.AlterUserMappingStmt, writer.uint32(/* id 139, wireType 2 =*/1114).fork()).ldelim(); + if (message.DropUserMappingStmt != null && Object.hasOwnProperty.call(message, "DropUserMappingStmt")) + $root.pg_query.DropUserMappingStmt.encode(message.DropUserMappingStmt, writer.uint32(/* id 140, wireType 2 =*/1122).fork()).ldelim(); + if (message.AlterTableSpaceOptionsStmt != null && Object.hasOwnProperty.call(message, "AlterTableSpaceOptionsStmt")) + $root.pg_query.AlterTableSpaceOptionsStmt.encode(message.AlterTableSpaceOptionsStmt, writer.uint32(/* id 141, wireType 2 =*/1130).fork()).ldelim(); + if (message.AlterTableMoveAllStmt != null && Object.hasOwnProperty.call(message, "AlterTableMoveAllStmt")) + $root.pg_query.AlterTableMoveAllStmt.encode(message.AlterTableMoveAllStmt, writer.uint32(/* id 142, wireType 2 =*/1138).fork()).ldelim(); + if (message.SecLabelStmt != null && Object.hasOwnProperty.call(message, "SecLabelStmt")) + $root.pg_query.SecLabelStmt.encode(message.SecLabelStmt, writer.uint32(/* id 143, wireType 2 =*/1146).fork()).ldelim(); + if (message.CreateForeignTableStmt != null && Object.hasOwnProperty.call(message, "CreateForeignTableStmt")) + $root.pg_query.CreateForeignTableStmt.encode(message.CreateForeignTableStmt, writer.uint32(/* id 144, wireType 2 =*/1154).fork()).ldelim(); + if (message.ImportForeignSchemaStmt != null && Object.hasOwnProperty.call(message, "ImportForeignSchemaStmt")) + $root.pg_query.ImportForeignSchemaStmt.encode(message.ImportForeignSchemaStmt, writer.uint32(/* id 145, wireType 2 =*/1162).fork()).ldelim(); + if (message.CreateExtensionStmt != null && Object.hasOwnProperty.call(message, "CreateExtensionStmt")) + $root.pg_query.CreateExtensionStmt.encode(message.CreateExtensionStmt, writer.uint32(/* id 146, wireType 2 =*/1170).fork()).ldelim(); + if (message.AlterExtensionStmt != null && Object.hasOwnProperty.call(message, "AlterExtensionStmt")) + $root.pg_query.AlterExtensionStmt.encode(message.AlterExtensionStmt, writer.uint32(/* id 147, wireType 2 =*/1178).fork()).ldelim(); + if (message.AlterExtensionContentsStmt != null && Object.hasOwnProperty.call(message, "AlterExtensionContentsStmt")) + $root.pg_query.AlterExtensionContentsStmt.encode(message.AlterExtensionContentsStmt, writer.uint32(/* id 148, wireType 2 =*/1186).fork()).ldelim(); + if (message.CreateEventTrigStmt != null && Object.hasOwnProperty.call(message, "CreateEventTrigStmt")) + $root.pg_query.CreateEventTrigStmt.encode(message.CreateEventTrigStmt, writer.uint32(/* id 149, wireType 2 =*/1194).fork()).ldelim(); + if (message.AlterEventTrigStmt != null && Object.hasOwnProperty.call(message, "AlterEventTrigStmt")) + $root.pg_query.AlterEventTrigStmt.encode(message.AlterEventTrigStmt, writer.uint32(/* id 150, wireType 2 =*/1202).fork()).ldelim(); + if (message.RefreshMatViewStmt != null && Object.hasOwnProperty.call(message, "RefreshMatViewStmt")) + $root.pg_query.RefreshMatViewStmt.encode(message.RefreshMatViewStmt, writer.uint32(/* id 151, wireType 2 =*/1210).fork()).ldelim(); + if (message.ReplicaIdentityStmt != null && Object.hasOwnProperty.call(message, "ReplicaIdentityStmt")) + $root.pg_query.ReplicaIdentityStmt.encode(message.ReplicaIdentityStmt, writer.uint32(/* id 152, wireType 2 =*/1218).fork()).ldelim(); + if (message.AlterSystemStmt != null && Object.hasOwnProperty.call(message, "AlterSystemStmt")) + $root.pg_query.AlterSystemStmt.encode(message.AlterSystemStmt, writer.uint32(/* id 153, wireType 2 =*/1226).fork()).ldelim(); + if (message.CreatePolicyStmt != null && Object.hasOwnProperty.call(message, "CreatePolicyStmt")) + $root.pg_query.CreatePolicyStmt.encode(message.CreatePolicyStmt, writer.uint32(/* id 154, wireType 2 =*/1234).fork()).ldelim(); + if (message.AlterPolicyStmt != null && Object.hasOwnProperty.call(message, "AlterPolicyStmt")) + $root.pg_query.AlterPolicyStmt.encode(message.AlterPolicyStmt, writer.uint32(/* id 155, wireType 2 =*/1242).fork()).ldelim(); + if (message.CreateTransformStmt != null && Object.hasOwnProperty.call(message, "CreateTransformStmt")) + $root.pg_query.CreateTransformStmt.encode(message.CreateTransformStmt, writer.uint32(/* id 156, wireType 2 =*/1250).fork()).ldelim(); + if (message.CreateAmStmt != null && Object.hasOwnProperty.call(message, "CreateAmStmt")) + $root.pg_query.CreateAmStmt.encode(message.CreateAmStmt, writer.uint32(/* id 157, wireType 2 =*/1258).fork()).ldelim(); + if (message.CreatePublicationStmt != null && Object.hasOwnProperty.call(message, "CreatePublicationStmt")) + $root.pg_query.CreatePublicationStmt.encode(message.CreatePublicationStmt, writer.uint32(/* id 158, wireType 2 =*/1266).fork()).ldelim(); + if (message.AlterPublicationStmt != null && Object.hasOwnProperty.call(message, "AlterPublicationStmt")) + $root.pg_query.AlterPublicationStmt.encode(message.AlterPublicationStmt, writer.uint32(/* id 159, wireType 2 =*/1274).fork()).ldelim(); + if (message.CreateSubscriptionStmt != null && Object.hasOwnProperty.call(message, "CreateSubscriptionStmt")) + $root.pg_query.CreateSubscriptionStmt.encode(message.CreateSubscriptionStmt, writer.uint32(/* id 160, wireType 2 =*/1282).fork()).ldelim(); + if (message.AlterSubscriptionStmt != null && Object.hasOwnProperty.call(message, "AlterSubscriptionStmt")) + $root.pg_query.AlterSubscriptionStmt.encode(message.AlterSubscriptionStmt, writer.uint32(/* id 161, wireType 2 =*/1290).fork()).ldelim(); + if (message.DropSubscriptionStmt != null && Object.hasOwnProperty.call(message, "DropSubscriptionStmt")) + $root.pg_query.DropSubscriptionStmt.encode(message.DropSubscriptionStmt, writer.uint32(/* id 162, wireType 2 =*/1298).fork()).ldelim(); + if (message.CreateStatsStmt != null && Object.hasOwnProperty.call(message, "CreateStatsStmt")) + $root.pg_query.CreateStatsStmt.encode(message.CreateStatsStmt, writer.uint32(/* id 163, wireType 2 =*/1306).fork()).ldelim(); + if (message.AlterCollationStmt != null && Object.hasOwnProperty.call(message, "AlterCollationStmt")) + $root.pg_query.AlterCollationStmt.encode(message.AlterCollationStmt, writer.uint32(/* id 164, wireType 2 =*/1314).fork()).ldelim(); + if (message.CallStmt != null && Object.hasOwnProperty.call(message, "CallStmt")) + $root.pg_query.CallStmt.encode(message.CallStmt, writer.uint32(/* id 165, wireType 2 =*/1322).fork()).ldelim(); + if (message.AlterStatsStmt != null && Object.hasOwnProperty.call(message, "AlterStatsStmt")) + $root.pg_query.AlterStatsStmt.encode(message.AlterStatsStmt, writer.uint32(/* id 166, wireType 2 =*/1330).fork()).ldelim(); + if (message.A_Expr != null && Object.hasOwnProperty.call(message, "A_Expr")) + $root.pg_query.A_Expr.encode(message.A_Expr, writer.uint32(/* id 167, wireType 2 =*/1338).fork()).ldelim(); + if (message.ColumnRef != null && Object.hasOwnProperty.call(message, "ColumnRef")) + $root.pg_query.ColumnRef.encode(message.ColumnRef, writer.uint32(/* id 168, wireType 2 =*/1346).fork()).ldelim(); + if (message.ParamRef != null && Object.hasOwnProperty.call(message, "ParamRef")) + $root.pg_query.ParamRef.encode(message.ParamRef, writer.uint32(/* id 169, wireType 2 =*/1354).fork()).ldelim(); + if (message.A_Const != null && Object.hasOwnProperty.call(message, "A_Const")) + $root.pg_query.A_Const.encode(message.A_Const, writer.uint32(/* id 170, wireType 2 =*/1362).fork()).ldelim(); + if (message.FuncCall != null && Object.hasOwnProperty.call(message, "FuncCall")) + $root.pg_query.FuncCall.encode(message.FuncCall, writer.uint32(/* id 171, wireType 2 =*/1370).fork()).ldelim(); + if (message.A_Star != null && Object.hasOwnProperty.call(message, "A_Star")) + $root.pg_query.A_Star.encode(message.A_Star, writer.uint32(/* id 172, wireType 2 =*/1378).fork()).ldelim(); + if (message.A_Indices != null && Object.hasOwnProperty.call(message, "A_Indices")) + $root.pg_query.A_Indices.encode(message.A_Indices, writer.uint32(/* id 173, wireType 2 =*/1386).fork()).ldelim(); + if (message.A_Indirection != null && Object.hasOwnProperty.call(message, "A_Indirection")) + $root.pg_query.A_Indirection.encode(message.A_Indirection, writer.uint32(/* id 174, wireType 2 =*/1394).fork()).ldelim(); + if (message.A_ArrayExpr != null && Object.hasOwnProperty.call(message, "A_ArrayExpr")) + $root.pg_query.A_ArrayExpr.encode(message.A_ArrayExpr, writer.uint32(/* id 175, wireType 2 =*/1402).fork()).ldelim(); + if (message.ResTarget != null && Object.hasOwnProperty.call(message, "ResTarget")) + $root.pg_query.ResTarget.encode(message.ResTarget, writer.uint32(/* id 176, wireType 2 =*/1410).fork()).ldelim(); + if (message.MultiAssignRef != null && Object.hasOwnProperty.call(message, "MultiAssignRef")) + $root.pg_query.MultiAssignRef.encode(message.MultiAssignRef, writer.uint32(/* id 177, wireType 2 =*/1418).fork()).ldelim(); + if (message.TypeCast != null && Object.hasOwnProperty.call(message, "TypeCast")) + $root.pg_query.TypeCast.encode(message.TypeCast, writer.uint32(/* id 178, wireType 2 =*/1426).fork()).ldelim(); + if (message.CollateClause != null && Object.hasOwnProperty.call(message, "CollateClause")) + $root.pg_query.CollateClause.encode(message.CollateClause, writer.uint32(/* id 179, wireType 2 =*/1434).fork()).ldelim(); + if (message.SortBy != null && Object.hasOwnProperty.call(message, "SortBy")) + $root.pg_query.SortBy.encode(message.SortBy, writer.uint32(/* id 180, wireType 2 =*/1442).fork()).ldelim(); + if (message.WindowDef != null && Object.hasOwnProperty.call(message, "WindowDef")) + $root.pg_query.WindowDef.encode(message.WindowDef, writer.uint32(/* id 181, wireType 2 =*/1450).fork()).ldelim(); + if (message.RangeSubselect != null && Object.hasOwnProperty.call(message, "RangeSubselect")) + $root.pg_query.RangeSubselect.encode(message.RangeSubselect, writer.uint32(/* id 182, wireType 2 =*/1458).fork()).ldelim(); + if (message.RangeFunction != null && Object.hasOwnProperty.call(message, "RangeFunction")) + $root.pg_query.RangeFunction.encode(message.RangeFunction, writer.uint32(/* id 183, wireType 2 =*/1466).fork()).ldelim(); + if (message.RangeTableSample != null && Object.hasOwnProperty.call(message, "RangeTableSample")) + $root.pg_query.RangeTableSample.encode(message.RangeTableSample, writer.uint32(/* id 184, wireType 2 =*/1474).fork()).ldelim(); + if (message.RangeTableFunc != null && Object.hasOwnProperty.call(message, "RangeTableFunc")) + $root.pg_query.RangeTableFunc.encode(message.RangeTableFunc, writer.uint32(/* id 185, wireType 2 =*/1482).fork()).ldelim(); + if (message.RangeTableFuncCol != null && Object.hasOwnProperty.call(message, "RangeTableFuncCol")) + $root.pg_query.RangeTableFuncCol.encode(message.RangeTableFuncCol, writer.uint32(/* id 186, wireType 2 =*/1490).fork()).ldelim(); + if (message.TypeName != null && Object.hasOwnProperty.call(message, "TypeName")) + $root.pg_query.TypeName.encode(message.TypeName, writer.uint32(/* id 187, wireType 2 =*/1498).fork()).ldelim(); + if (message.ColumnDef != null && Object.hasOwnProperty.call(message, "ColumnDef")) + $root.pg_query.ColumnDef.encode(message.ColumnDef, writer.uint32(/* id 188, wireType 2 =*/1506).fork()).ldelim(); + if (message.IndexElem != null && Object.hasOwnProperty.call(message, "IndexElem")) + $root.pg_query.IndexElem.encode(message.IndexElem, writer.uint32(/* id 189, wireType 2 =*/1514).fork()).ldelim(); + if (message.Constraint != null && Object.hasOwnProperty.call(message, "Constraint")) + $root.pg_query.Constraint.encode(message.Constraint, writer.uint32(/* id 190, wireType 2 =*/1522).fork()).ldelim(); + if (message.DefElem != null && Object.hasOwnProperty.call(message, "DefElem")) + $root.pg_query.DefElem.encode(message.DefElem, writer.uint32(/* id 191, wireType 2 =*/1530).fork()).ldelim(); + if (message.RangeTblEntry != null && Object.hasOwnProperty.call(message, "RangeTblEntry")) + $root.pg_query.RangeTblEntry.encode(message.RangeTblEntry, writer.uint32(/* id 192, wireType 2 =*/1538).fork()).ldelim(); + if (message.RangeTblFunction != null && Object.hasOwnProperty.call(message, "RangeTblFunction")) + $root.pg_query.RangeTblFunction.encode(message.RangeTblFunction, writer.uint32(/* id 193, wireType 2 =*/1546).fork()).ldelim(); + if (message.TableSampleClause != null && Object.hasOwnProperty.call(message, "TableSampleClause")) + $root.pg_query.TableSampleClause.encode(message.TableSampleClause, writer.uint32(/* id 194, wireType 2 =*/1554).fork()).ldelim(); + if (message.WithCheckOption != null && Object.hasOwnProperty.call(message, "WithCheckOption")) + $root.pg_query.WithCheckOption.encode(message.WithCheckOption, writer.uint32(/* id 195, wireType 2 =*/1562).fork()).ldelim(); + if (message.SortGroupClause != null && Object.hasOwnProperty.call(message, "SortGroupClause")) + $root.pg_query.SortGroupClause.encode(message.SortGroupClause, writer.uint32(/* id 196, wireType 2 =*/1570).fork()).ldelim(); + if (message.GroupingSet != null && Object.hasOwnProperty.call(message, "GroupingSet")) + $root.pg_query.GroupingSet.encode(message.GroupingSet, writer.uint32(/* id 197, wireType 2 =*/1578).fork()).ldelim(); + if (message.WindowClause != null && Object.hasOwnProperty.call(message, "WindowClause")) + $root.pg_query.WindowClause.encode(message.WindowClause, writer.uint32(/* id 198, wireType 2 =*/1586).fork()).ldelim(); + if (message.ObjectWithArgs != null && Object.hasOwnProperty.call(message, "ObjectWithArgs")) + $root.pg_query.ObjectWithArgs.encode(message.ObjectWithArgs, writer.uint32(/* id 199, wireType 2 =*/1594).fork()).ldelim(); + if (message.AccessPriv != null && Object.hasOwnProperty.call(message, "AccessPriv")) + $root.pg_query.AccessPriv.encode(message.AccessPriv, writer.uint32(/* id 200, wireType 2 =*/1602).fork()).ldelim(); + if (message.CreateOpClassItem != null && Object.hasOwnProperty.call(message, "CreateOpClassItem")) + $root.pg_query.CreateOpClassItem.encode(message.CreateOpClassItem, writer.uint32(/* id 201, wireType 2 =*/1610).fork()).ldelim(); + if (message.TableLikeClause != null && Object.hasOwnProperty.call(message, "TableLikeClause")) + $root.pg_query.TableLikeClause.encode(message.TableLikeClause, writer.uint32(/* id 202, wireType 2 =*/1618).fork()).ldelim(); + if (message.FunctionParameter != null && Object.hasOwnProperty.call(message, "FunctionParameter")) + $root.pg_query.FunctionParameter.encode(message.FunctionParameter, writer.uint32(/* id 203, wireType 2 =*/1626).fork()).ldelim(); + if (message.LockingClause != null && Object.hasOwnProperty.call(message, "LockingClause")) + $root.pg_query.LockingClause.encode(message.LockingClause, writer.uint32(/* id 204, wireType 2 =*/1634).fork()).ldelim(); + if (message.RowMarkClause != null && Object.hasOwnProperty.call(message, "RowMarkClause")) + $root.pg_query.RowMarkClause.encode(message.RowMarkClause, writer.uint32(/* id 205, wireType 2 =*/1642).fork()).ldelim(); + if (message.XmlSerialize != null && Object.hasOwnProperty.call(message, "XmlSerialize")) + $root.pg_query.XmlSerialize.encode(message.XmlSerialize, writer.uint32(/* id 206, wireType 2 =*/1650).fork()).ldelim(); + if (message.WithClause != null && Object.hasOwnProperty.call(message, "WithClause")) + $root.pg_query.WithClause.encode(message.WithClause, writer.uint32(/* id 207, wireType 2 =*/1658).fork()).ldelim(); + if (message.InferClause != null && Object.hasOwnProperty.call(message, "InferClause")) + $root.pg_query.InferClause.encode(message.InferClause, writer.uint32(/* id 208, wireType 2 =*/1666).fork()).ldelim(); + if (message.OnConflictClause != null && Object.hasOwnProperty.call(message, "OnConflictClause")) + $root.pg_query.OnConflictClause.encode(message.OnConflictClause, writer.uint32(/* id 209, wireType 2 =*/1674).fork()).ldelim(); + if (message.CommonTableExpr != null && Object.hasOwnProperty.call(message, "CommonTableExpr")) + $root.pg_query.CommonTableExpr.encode(message.CommonTableExpr, writer.uint32(/* id 210, wireType 2 =*/1682).fork()).ldelim(); + if (message.RoleSpec != null && Object.hasOwnProperty.call(message, "RoleSpec")) + $root.pg_query.RoleSpec.encode(message.RoleSpec, writer.uint32(/* id 211, wireType 2 =*/1690).fork()).ldelim(); + if (message.TriggerTransition != null && Object.hasOwnProperty.call(message, "TriggerTransition")) + $root.pg_query.TriggerTransition.encode(message.TriggerTransition, writer.uint32(/* id 212, wireType 2 =*/1698).fork()).ldelim(); + if (message.PartitionElem != null && Object.hasOwnProperty.call(message, "PartitionElem")) + $root.pg_query.PartitionElem.encode(message.PartitionElem, writer.uint32(/* id 213, wireType 2 =*/1706).fork()).ldelim(); + if (message.PartitionSpec != null && Object.hasOwnProperty.call(message, "PartitionSpec")) + $root.pg_query.PartitionSpec.encode(message.PartitionSpec, writer.uint32(/* id 214, wireType 2 =*/1714).fork()).ldelim(); + if (message.PartitionBoundSpec != null && Object.hasOwnProperty.call(message, "PartitionBoundSpec")) + $root.pg_query.PartitionBoundSpec.encode(message.PartitionBoundSpec, writer.uint32(/* id 215, wireType 2 =*/1722).fork()).ldelim(); + if (message.PartitionRangeDatum != null && Object.hasOwnProperty.call(message, "PartitionRangeDatum")) + $root.pg_query.PartitionRangeDatum.encode(message.PartitionRangeDatum, writer.uint32(/* id 216, wireType 2 =*/1730).fork()).ldelim(); + if (message.PartitionCmd != null && Object.hasOwnProperty.call(message, "PartitionCmd")) + $root.pg_query.PartitionCmd.encode(message.PartitionCmd, writer.uint32(/* id 217, wireType 2 =*/1738).fork()).ldelim(); + if (message.VacuumRelation != null && Object.hasOwnProperty.call(message, "VacuumRelation")) + $root.pg_query.VacuumRelation.encode(message.VacuumRelation, writer.uint32(/* id 218, wireType 2 =*/1746).fork()).ldelim(); + if (message.InlineCodeBlock != null && Object.hasOwnProperty.call(message, "InlineCodeBlock")) + $root.pg_query.InlineCodeBlock.encode(message.InlineCodeBlock, writer.uint32(/* id 219, wireType 2 =*/1754).fork()).ldelim(); + if (message.CallContext != null && Object.hasOwnProperty.call(message, "CallContext")) + $root.pg_query.CallContext.encode(message.CallContext, writer.uint32(/* id 220, wireType 2 =*/1762).fork()).ldelim(); + if (message.Integer != null && Object.hasOwnProperty.call(message, "Integer")) + $root.pg_query.Integer.encode(message.Integer, writer.uint32(/* id 221, wireType 2 =*/1770).fork()).ldelim(); + if (message.Float != null && Object.hasOwnProperty.call(message, "Float")) + $root.pg_query.Float.encode(message.Float, writer.uint32(/* id 222, wireType 2 =*/1778).fork()).ldelim(); + if (message.String != null && Object.hasOwnProperty.call(message, "String")) + $root.pg_query.String.encode(message.String, writer.uint32(/* id 223, wireType 2 =*/1786).fork()).ldelim(); + if (message.BitString != null && Object.hasOwnProperty.call(message, "BitString")) + $root.pg_query.BitString.encode(message.BitString, writer.uint32(/* id 224, wireType 2 =*/1794).fork()).ldelim(); + if (message.Null != null && Object.hasOwnProperty.call(message, "Null")) + $root.pg_query.Null.encode(message.Null, writer.uint32(/* id 225, wireType 2 =*/1802).fork()).ldelim(); + if (message.List != null && Object.hasOwnProperty.call(message, "List")) + $root.pg_query.List.encode(message.List, writer.uint32(/* id 226, wireType 2 =*/1810).fork()).ldelim(); + if (message.IntList != null && Object.hasOwnProperty.call(message, "IntList")) + $root.pg_query.IntList.encode(message.IntList, writer.uint32(/* id 227, wireType 2 =*/1818).fork()).ldelim(); + if (message.OidList != null && Object.hasOwnProperty.call(message, "OidList")) + $root.pg_query.OidList.encode(message.OidList, writer.uint32(/* id 228, wireType 2 =*/1826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Node message, length delimited. Does not implicitly {@link pg_query.Node.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.Node + * @static + * @param {pg_query.INode} message Node message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Node.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Node message from the specified reader or buffer. + * @function decode + * @memberof pg_query.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.Node(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.Alias = $root.pg_query.Alias.decode(reader, reader.uint32()); + break; + } + case 2: { + message.RangeVar = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 3: { + message.TableFunc = $root.pg_query.TableFunc.decode(reader, reader.uint32()); + break; + } + case 4: { + message.Expr = $root.pg_query.Expr.decode(reader, reader.uint32()); + break; + } + case 5: { + message.Var = $root.pg_query.Var.decode(reader, reader.uint32()); + break; + } + case 6: { + message.Param = $root.pg_query.Param.decode(reader, reader.uint32()); + break; + } + case 7: { + message.Aggref = $root.pg_query.Aggref.decode(reader, reader.uint32()); + break; + } + case 8: { + message.GroupingFunc = $root.pg_query.GroupingFunc.decode(reader, reader.uint32()); + break; + } + case 9: { + message.WindowFunc = $root.pg_query.WindowFunc.decode(reader, reader.uint32()); + break; + } + case 10: { + message.SubscriptingRef = $root.pg_query.SubscriptingRef.decode(reader, reader.uint32()); + break; + } + case 11: { + message.FuncExpr = $root.pg_query.FuncExpr.decode(reader, reader.uint32()); + break; + } + case 12: { + message.NamedArgExpr = $root.pg_query.NamedArgExpr.decode(reader, reader.uint32()); + break; + } + case 13: { + message.OpExpr = $root.pg_query.OpExpr.decode(reader, reader.uint32()); + break; + } + case 14: { + message.DistinctExpr = $root.pg_query.DistinctExpr.decode(reader, reader.uint32()); + break; + } + case 15: { + message.NullIfExpr = $root.pg_query.NullIfExpr.decode(reader, reader.uint32()); + break; + } + case 16: { + message.ScalarArrayOpExpr = $root.pg_query.ScalarArrayOpExpr.decode(reader, reader.uint32()); + break; + } + case 17: { + message.BoolExpr = $root.pg_query.BoolExpr.decode(reader, reader.uint32()); + break; + } + case 18: { + message.SubLink = $root.pg_query.SubLink.decode(reader, reader.uint32()); + break; + } + case 19: { + message.SubPlan = $root.pg_query.SubPlan.decode(reader, reader.uint32()); + break; + } + case 20: { + message.AlternativeSubPlan = $root.pg_query.AlternativeSubPlan.decode(reader, reader.uint32()); + break; + } + case 21: { + message.FieldSelect = $root.pg_query.FieldSelect.decode(reader, reader.uint32()); + break; + } + case 22: { + message.FieldStore = $root.pg_query.FieldStore.decode(reader, reader.uint32()); + break; + } + case 23: { + message.RelabelType = $root.pg_query.RelabelType.decode(reader, reader.uint32()); + break; + } + case 24: { + message.CoerceViaIO = $root.pg_query.CoerceViaIO.decode(reader, reader.uint32()); + break; + } + case 25: { + message.ArrayCoerceExpr = $root.pg_query.ArrayCoerceExpr.decode(reader, reader.uint32()); + break; + } + case 26: { + message.ConvertRowtypeExpr = $root.pg_query.ConvertRowtypeExpr.decode(reader, reader.uint32()); + break; + } + case 27: { + message.CollateExpr = $root.pg_query.CollateExpr.decode(reader, reader.uint32()); + break; + } + case 28: { + message.CaseExpr = $root.pg_query.CaseExpr.decode(reader, reader.uint32()); + break; + } + case 29: { + message.CaseWhen = $root.pg_query.CaseWhen.decode(reader, reader.uint32()); + break; + } + case 30: { + message.CaseTestExpr = $root.pg_query.CaseTestExpr.decode(reader, reader.uint32()); + break; + } + case 31: { + message.ArrayExpr = $root.pg_query.ArrayExpr.decode(reader, reader.uint32()); + break; + } + case 32: { + message.RowExpr = $root.pg_query.RowExpr.decode(reader, reader.uint32()); + break; + } + case 33: { + message.RowCompareExpr = $root.pg_query.RowCompareExpr.decode(reader, reader.uint32()); + break; + } + case 34: { + message.CoalesceExpr = $root.pg_query.CoalesceExpr.decode(reader, reader.uint32()); + break; + } + case 35: { + message.MinMaxExpr = $root.pg_query.MinMaxExpr.decode(reader, reader.uint32()); + break; + } + case 36: { + message.SQLValueFunction = $root.pg_query.SQLValueFunction.decode(reader, reader.uint32()); + break; + } + case 37: { + message.XmlExpr = $root.pg_query.XmlExpr.decode(reader, reader.uint32()); + break; + } + case 38: { + message.NullTest = $root.pg_query.NullTest.decode(reader, reader.uint32()); + break; + } + case 39: { + message.BooleanTest = $root.pg_query.BooleanTest.decode(reader, reader.uint32()); + break; + } + case 40: { + message.CoerceToDomain = $root.pg_query.CoerceToDomain.decode(reader, reader.uint32()); + break; + } + case 41: { + message.CoerceToDomainValue = $root.pg_query.CoerceToDomainValue.decode(reader, reader.uint32()); + break; + } + case 42: { + message.SetToDefault = $root.pg_query.SetToDefault.decode(reader, reader.uint32()); + break; + } + case 43: { + message.CurrentOfExpr = $root.pg_query.CurrentOfExpr.decode(reader, reader.uint32()); + break; + } + case 44: { + message.NextValueExpr = $root.pg_query.NextValueExpr.decode(reader, reader.uint32()); + break; + } + case 45: { + message.InferenceElem = $root.pg_query.InferenceElem.decode(reader, reader.uint32()); + break; + } + case 46: { + message.TargetEntry = $root.pg_query.TargetEntry.decode(reader, reader.uint32()); + break; + } + case 47: { + message.RangeTblRef = $root.pg_query.RangeTblRef.decode(reader, reader.uint32()); + break; + } + case 48: { + message.JoinExpr = $root.pg_query.JoinExpr.decode(reader, reader.uint32()); + break; + } + case 49: { + message.FromExpr = $root.pg_query.FromExpr.decode(reader, reader.uint32()); + break; + } + case 50: { + message.OnConflictExpr = $root.pg_query.OnConflictExpr.decode(reader, reader.uint32()); + break; + } + case 51: { + message.IntoClause = $root.pg_query.IntoClause.decode(reader, reader.uint32()); + break; + } + case 52: { + message.RawStmt = $root.pg_query.RawStmt.decode(reader, reader.uint32()); + break; + } + case 53: { + message.Query = $root.pg_query.Query.decode(reader, reader.uint32()); + break; + } + case 54: { + message.InsertStmt = $root.pg_query.InsertStmt.decode(reader, reader.uint32()); + break; + } + case 55: { + message.DeleteStmt = $root.pg_query.DeleteStmt.decode(reader, reader.uint32()); + break; + } + case 56: { + message.UpdateStmt = $root.pg_query.UpdateStmt.decode(reader, reader.uint32()); + break; + } + case 57: { + message.SelectStmt = $root.pg_query.SelectStmt.decode(reader, reader.uint32()); + break; + } + case 58: { + message.AlterTableStmt = $root.pg_query.AlterTableStmt.decode(reader, reader.uint32()); + break; + } + case 59: { + message.AlterTableCmd = $root.pg_query.AlterTableCmd.decode(reader, reader.uint32()); + break; + } + case 60: { + message.AlterDomainStmt = $root.pg_query.AlterDomainStmt.decode(reader, reader.uint32()); + break; + } + case 61: { + message.SetOperationStmt = $root.pg_query.SetOperationStmt.decode(reader, reader.uint32()); + break; + } + case 62: { + message.GrantStmt = $root.pg_query.GrantStmt.decode(reader, reader.uint32()); + break; + } + case 63: { + message.GrantRoleStmt = $root.pg_query.GrantRoleStmt.decode(reader, reader.uint32()); + break; + } + case 64: { + message.AlterDefaultPrivilegesStmt = $root.pg_query.AlterDefaultPrivilegesStmt.decode(reader, reader.uint32()); + break; + } + case 65: { + message.ClosePortalStmt = $root.pg_query.ClosePortalStmt.decode(reader, reader.uint32()); + break; + } + case 66: { + message.ClusterStmt = $root.pg_query.ClusterStmt.decode(reader, reader.uint32()); + break; + } + case 67: { + message.CopyStmt = $root.pg_query.CopyStmt.decode(reader, reader.uint32()); + break; + } + case 68: { + message.CreateStmt = $root.pg_query.CreateStmt.decode(reader, reader.uint32()); + break; + } + case 69: { + message.DefineStmt = $root.pg_query.DefineStmt.decode(reader, reader.uint32()); + break; + } + case 70: { + message.DropStmt = $root.pg_query.DropStmt.decode(reader, reader.uint32()); + break; + } + case 71: { + message.TruncateStmt = $root.pg_query.TruncateStmt.decode(reader, reader.uint32()); + break; + } + case 72: { + message.CommentStmt = $root.pg_query.CommentStmt.decode(reader, reader.uint32()); + break; + } + case 73: { + message.FetchStmt = $root.pg_query.FetchStmt.decode(reader, reader.uint32()); + break; + } + case 74: { + message.IndexStmt = $root.pg_query.IndexStmt.decode(reader, reader.uint32()); + break; + } + case 75: { + message.CreateFunctionStmt = $root.pg_query.CreateFunctionStmt.decode(reader, reader.uint32()); + break; + } + case 76: { + message.AlterFunctionStmt = $root.pg_query.AlterFunctionStmt.decode(reader, reader.uint32()); + break; + } + case 77: { + message.DoStmt = $root.pg_query.DoStmt.decode(reader, reader.uint32()); + break; + } + case 78: { + message.RenameStmt = $root.pg_query.RenameStmt.decode(reader, reader.uint32()); + break; + } + case 79: { + message.RuleStmt = $root.pg_query.RuleStmt.decode(reader, reader.uint32()); + break; + } + case 80: { + message.NotifyStmt = $root.pg_query.NotifyStmt.decode(reader, reader.uint32()); + break; + } + case 81: { + message.ListenStmt = $root.pg_query.ListenStmt.decode(reader, reader.uint32()); + break; + } + case 82: { + message.UnlistenStmt = $root.pg_query.UnlistenStmt.decode(reader, reader.uint32()); + break; + } + case 83: { + message.TransactionStmt = $root.pg_query.TransactionStmt.decode(reader, reader.uint32()); + break; + } + case 84: { + message.ViewStmt = $root.pg_query.ViewStmt.decode(reader, reader.uint32()); + break; + } + case 85: { + message.LoadStmt = $root.pg_query.LoadStmt.decode(reader, reader.uint32()); + break; + } + case 86: { + message.CreateDomainStmt = $root.pg_query.CreateDomainStmt.decode(reader, reader.uint32()); + break; + } + case 87: { + message.CreatedbStmt = $root.pg_query.CreatedbStmt.decode(reader, reader.uint32()); + break; + } + case 88: { + message.DropdbStmt = $root.pg_query.DropdbStmt.decode(reader, reader.uint32()); + break; + } + case 89: { + message.VacuumStmt = $root.pg_query.VacuumStmt.decode(reader, reader.uint32()); + break; + } + case 90: { + message.ExplainStmt = $root.pg_query.ExplainStmt.decode(reader, reader.uint32()); + break; + } + case 91: { + message.CreateTableAsStmt = $root.pg_query.CreateTableAsStmt.decode(reader, reader.uint32()); + break; + } + case 92: { + message.CreateSeqStmt = $root.pg_query.CreateSeqStmt.decode(reader, reader.uint32()); + break; + } + case 93: { + message.AlterSeqStmt = $root.pg_query.AlterSeqStmt.decode(reader, reader.uint32()); + break; + } + case 94: { + message.VariableSetStmt = $root.pg_query.VariableSetStmt.decode(reader, reader.uint32()); + break; + } + case 95: { + message.VariableShowStmt = $root.pg_query.VariableShowStmt.decode(reader, reader.uint32()); + break; + } + case 96: { + message.DiscardStmt = $root.pg_query.DiscardStmt.decode(reader, reader.uint32()); + break; + } + case 97: { + message.CreateTrigStmt = $root.pg_query.CreateTrigStmt.decode(reader, reader.uint32()); + break; + } + case 98: { + message.CreatePLangStmt = $root.pg_query.CreatePLangStmt.decode(reader, reader.uint32()); + break; + } + case 99: { + message.CreateRoleStmt = $root.pg_query.CreateRoleStmt.decode(reader, reader.uint32()); + break; + } + case 100: { + message.AlterRoleStmt = $root.pg_query.AlterRoleStmt.decode(reader, reader.uint32()); + break; + } + case 101: { + message.DropRoleStmt = $root.pg_query.DropRoleStmt.decode(reader, reader.uint32()); + break; + } + case 102: { + message.LockStmt = $root.pg_query.LockStmt.decode(reader, reader.uint32()); + break; + } + case 103: { + message.ConstraintsSetStmt = $root.pg_query.ConstraintsSetStmt.decode(reader, reader.uint32()); + break; + } + case 104: { + message.ReindexStmt = $root.pg_query.ReindexStmt.decode(reader, reader.uint32()); + break; + } + case 105: { + message.CheckPointStmt = $root.pg_query.CheckPointStmt.decode(reader, reader.uint32()); + break; + } + case 106: { + message.CreateSchemaStmt = $root.pg_query.CreateSchemaStmt.decode(reader, reader.uint32()); + break; + } + case 107: { + message.AlterDatabaseStmt = $root.pg_query.AlterDatabaseStmt.decode(reader, reader.uint32()); + break; + } + case 108: { + message.AlterDatabaseSetStmt = $root.pg_query.AlterDatabaseSetStmt.decode(reader, reader.uint32()); + break; + } + case 109: { + message.AlterRoleSetStmt = $root.pg_query.AlterRoleSetStmt.decode(reader, reader.uint32()); + break; + } + case 110: { + message.CreateConversionStmt = $root.pg_query.CreateConversionStmt.decode(reader, reader.uint32()); + break; + } + case 111: { + message.CreateCastStmt = $root.pg_query.CreateCastStmt.decode(reader, reader.uint32()); + break; + } + case 112: { + message.CreateOpClassStmt = $root.pg_query.CreateOpClassStmt.decode(reader, reader.uint32()); + break; + } + case 113: { + message.CreateOpFamilyStmt = $root.pg_query.CreateOpFamilyStmt.decode(reader, reader.uint32()); + break; + } + case 114: { + message.AlterOpFamilyStmt = $root.pg_query.AlterOpFamilyStmt.decode(reader, reader.uint32()); + break; + } + case 115: { + message.PrepareStmt = $root.pg_query.PrepareStmt.decode(reader, reader.uint32()); + break; + } + case 116: { + message.ExecuteStmt = $root.pg_query.ExecuteStmt.decode(reader, reader.uint32()); + break; + } + case 117: { + message.DeallocateStmt = $root.pg_query.DeallocateStmt.decode(reader, reader.uint32()); + break; + } + case 118: { + message.DeclareCursorStmt = $root.pg_query.DeclareCursorStmt.decode(reader, reader.uint32()); + break; + } + case 119: { + message.CreateTableSpaceStmt = $root.pg_query.CreateTableSpaceStmt.decode(reader, reader.uint32()); + break; + } + case 120: { + message.DropTableSpaceStmt = $root.pg_query.DropTableSpaceStmt.decode(reader, reader.uint32()); + break; + } + case 121: { + message.AlterObjectDependsStmt = $root.pg_query.AlterObjectDependsStmt.decode(reader, reader.uint32()); + break; + } + case 122: { + message.AlterObjectSchemaStmt = $root.pg_query.AlterObjectSchemaStmt.decode(reader, reader.uint32()); + break; + } + case 123: { + message.AlterOwnerStmt = $root.pg_query.AlterOwnerStmt.decode(reader, reader.uint32()); + break; + } + case 124: { + message.AlterOperatorStmt = $root.pg_query.AlterOperatorStmt.decode(reader, reader.uint32()); + break; + } + case 125: { + message.AlterTypeStmt = $root.pg_query.AlterTypeStmt.decode(reader, reader.uint32()); + break; + } + case 126: { + message.DropOwnedStmt = $root.pg_query.DropOwnedStmt.decode(reader, reader.uint32()); + break; + } + case 127: { + message.ReassignOwnedStmt = $root.pg_query.ReassignOwnedStmt.decode(reader, reader.uint32()); + break; + } + case 128: { + message.CompositeTypeStmt = $root.pg_query.CompositeTypeStmt.decode(reader, reader.uint32()); + break; + } + case 129: { + message.CreateEnumStmt = $root.pg_query.CreateEnumStmt.decode(reader, reader.uint32()); + break; + } + case 130: { + message.CreateRangeStmt = $root.pg_query.CreateRangeStmt.decode(reader, reader.uint32()); + break; + } + case 131: { + message.AlterEnumStmt = $root.pg_query.AlterEnumStmt.decode(reader, reader.uint32()); + break; + } + case 132: { + message.AlterTSDictionaryStmt = $root.pg_query.AlterTSDictionaryStmt.decode(reader, reader.uint32()); + break; + } + case 133: { + message.AlterTSConfigurationStmt = $root.pg_query.AlterTSConfigurationStmt.decode(reader, reader.uint32()); + break; + } + case 134: { + message.CreateFdwStmt = $root.pg_query.CreateFdwStmt.decode(reader, reader.uint32()); + break; + } + case 135: { + message.AlterFdwStmt = $root.pg_query.AlterFdwStmt.decode(reader, reader.uint32()); + break; + } + case 136: { + message.CreateForeignServerStmt = $root.pg_query.CreateForeignServerStmt.decode(reader, reader.uint32()); + break; + } + case 137: { + message.AlterForeignServerStmt = $root.pg_query.AlterForeignServerStmt.decode(reader, reader.uint32()); + break; + } + case 138: { + message.CreateUserMappingStmt = $root.pg_query.CreateUserMappingStmt.decode(reader, reader.uint32()); + break; + } + case 139: { + message.AlterUserMappingStmt = $root.pg_query.AlterUserMappingStmt.decode(reader, reader.uint32()); + break; + } + case 140: { + message.DropUserMappingStmt = $root.pg_query.DropUserMappingStmt.decode(reader, reader.uint32()); + break; + } + case 141: { + message.AlterTableSpaceOptionsStmt = $root.pg_query.AlterTableSpaceOptionsStmt.decode(reader, reader.uint32()); + break; + } + case 142: { + message.AlterTableMoveAllStmt = $root.pg_query.AlterTableMoveAllStmt.decode(reader, reader.uint32()); + break; + } + case 143: { + message.SecLabelStmt = $root.pg_query.SecLabelStmt.decode(reader, reader.uint32()); + break; + } + case 144: { + message.CreateForeignTableStmt = $root.pg_query.CreateForeignTableStmt.decode(reader, reader.uint32()); + break; + } + case 145: { + message.ImportForeignSchemaStmt = $root.pg_query.ImportForeignSchemaStmt.decode(reader, reader.uint32()); + break; + } + case 146: { + message.CreateExtensionStmt = $root.pg_query.CreateExtensionStmt.decode(reader, reader.uint32()); + break; + } + case 147: { + message.AlterExtensionStmt = $root.pg_query.AlterExtensionStmt.decode(reader, reader.uint32()); + break; + } + case 148: { + message.AlterExtensionContentsStmt = $root.pg_query.AlterExtensionContentsStmt.decode(reader, reader.uint32()); + break; + } + case 149: { + message.CreateEventTrigStmt = $root.pg_query.CreateEventTrigStmt.decode(reader, reader.uint32()); + break; + } + case 150: { + message.AlterEventTrigStmt = $root.pg_query.AlterEventTrigStmt.decode(reader, reader.uint32()); + break; + } + case 151: { + message.RefreshMatViewStmt = $root.pg_query.RefreshMatViewStmt.decode(reader, reader.uint32()); + break; + } + case 152: { + message.ReplicaIdentityStmt = $root.pg_query.ReplicaIdentityStmt.decode(reader, reader.uint32()); + break; + } + case 153: { + message.AlterSystemStmt = $root.pg_query.AlterSystemStmt.decode(reader, reader.uint32()); + break; + } + case 154: { + message.CreatePolicyStmt = $root.pg_query.CreatePolicyStmt.decode(reader, reader.uint32()); + break; + } + case 155: { + message.AlterPolicyStmt = $root.pg_query.AlterPolicyStmt.decode(reader, reader.uint32()); + break; + } + case 156: { + message.CreateTransformStmt = $root.pg_query.CreateTransformStmt.decode(reader, reader.uint32()); + break; + } + case 157: { + message.CreateAmStmt = $root.pg_query.CreateAmStmt.decode(reader, reader.uint32()); + break; + } + case 158: { + message.CreatePublicationStmt = $root.pg_query.CreatePublicationStmt.decode(reader, reader.uint32()); + break; + } + case 159: { + message.AlterPublicationStmt = $root.pg_query.AlterPublicationStmt.decode(reader, reader.uint32()); + break; + } + case 160: { + message.CreateSubscriptionStmt = $root.pg_query.CreateSubscriptionStmt.decode(reader, reader.uint32()); + break; + } + case 161: { + message.AlterSubscriptionStmt = $root.pg_query.AlterSubscriptionStmt.decode(reader, reader.uint32()); + break; + } + case 162: { + message.DropSubscriptionStmt = $root.pg_query.DropSubscriptionStmt.decode(reader, reader.uint32()); + break; + } + case 163: { + message.CreateStatsStmt = $root.pg_query.CreateStatsStmt.decode(reader, reader.uint32()); + break; + } + case 164: { + message.AlterCollationStmt = $root.pg_query.AlterCollationStmt.decode(reader, reader.uint32()); + break; + } + case 165: { + message.CallStmt = $root.pg_query.CallStmt.decode(reader, reader.uint32()); + break; + } + case 166: { + message.AlterStatsStmt = $root.pg_query.AlterStatsStmt.decode(reader, reader.uint32()); + break; + } + case 167: { + message.A_Expr = $root.pg_query.A_Expr.decode(reader, reader.uint32()); + break; + } + case 168: { + message.ColumnRef = $root.pg_query.ColumnRef.decode(reader, reader.uint32()); + break; + } + case 169: { + message.ParamRef = $root.pg_query.ParamRef.decode(reader, reader.uint32()); + break; + } + case 170: { + message.A_Const = $root.pg_query.A_Const.decode(reader, reader.uint32()); + break; + } + case 171: { + message.FuncCall = $root.pg_query.FuncCall.decode(reader, reader.uint32()); + break; + } + case 172: { + message.A_Star = $root.pg_query.A_Star.decode(reader, reader.uint32()); + break; + } + case 173: { + message.A_Indices = $root.pg_query.A_Indices.decode(reader, reader.uint32()); + break; + } + case 174: { + message.A_Indirection = $root.pg_query.A_Indirection.decode(reader, reader.uint32()); + break; + } + case 175: { + message.A_ArrayExpr = $root.pg_query.A_ArrayExpr.decode(reader, reader.uint32()); + break; + } + case 176: { + message.ResTarget = $root.pg_query.ResTarget.decode(reader, reader.uint32()); + break; + } + case 177: { + message.MultiAssignRef = $root.pg_query.MultiAssignRef.decode(reader, reader.uint32()); + break; + } + case 178: { + message.TypeCast = $root.pg_query.TypeCast.decode(reader, reader.uint32()); + break; + } + case 179: { + message.CollateClause = $root.pg_query.CollateClause.decode(reader, reader.uint32()); + break; + } + case 180: { + message.SortBy = $root.pg_query.SortBy.decode(reader, reader.uint32()); + break; + } + case 181: { + message.WindowDef = $root.pg_query.WindowDef.decode(reader, reader.uint32()); + break; + } + case 182: { + message.RangeSubselect = $root.pg_query.RangeSubselect.decode(reader, reader.uint32()); + break; + } + case 183: { + message.RangeFunction = $root.pg_query.RangeFunction.decode(reader, reader.uint32()); + break; + } + case 184: { + message.RangeTableSample = $root.pg_query.RangeTableSample.decode(reader, reader.uint32()); + break; + } + case 185: { + message.RangeTableFunc = $root.pg_query.RangeTableFunc.decode(reader, reader.uint32()); + break; + } + case 186: { + message.RangeTableFuncCol = $root.pg_query.RangeTableFuncCol.decode(reader, reader.uint32()); + break; + } + case 187: { + message.TypeName = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 188: { + message.ColumnDef = $root.pg_query.ColumnDef.decode(reader, reader.uint32()); + break; + } + case 189: { + message.IndexElem = $root.pg_query.IndexElem.decode(reader, reader.uint32()); + break; + } + case 190: { + message.Constraint = $root.pg_query.Constraint.decode(reader, reader.uint32()); + break; + } + case 191: { + message.DefElem = $root.pg_query.DefElem.decode(reader, reader.uint32()); + break; + } + case 192: { + message.RangeTblEntry = $root.pg_query.RangeTblEntry.decode(reader, reader.uint32()); + break; + } + case 193: { + message.RangeTblFunction = $root.pg_query.RangeTblFunction.decode(reader, reader.uint32()); + break; + } + case 194: { + message.TableSampleClause = $root.pg_query.TableSampleClause.decode(reader, reader.uint32()); + break; + } + case 195: { + message.WithCheckOption = $root.pg_query.WithCheckOption.decode(reader, reader.uint32()); + break; + } + case 196: { + message.SortGroupClause = $root.pg_query.SortGroupClause.decode(reader, reader.uint32()); + break; + } + case 197: { + message.GroupingSet = $root.pg_query.GroupingSet.decode(reader, reader.uint32()); + break; + } + case 198: { + message.WindowClause = $root.pg_query.WindowClause.decode(reader, reader.uint32()); + break; + } + case 199: { + message.ObjectWithArgs = $root.pg_query.ObjectWithArgs.decode(reader, reader.uint32()); + break; + } + case 200: { + message.AccessPriv = $root.pg_query.AccessPriv.decode(reader, reader.uint32()); + break; + } + case 201: { + message.CreateOpClassItem = $root.pg_query.CreateOpClassItem.decode(reader, reader.uint32()); + break; + } + case 202: { + message.TableLikeClause = $root.pg_query.TableLikeClause.decode(reader, reader.uint32()); + break; + } + case 203: { + message.FunctionParameter = $root.pg_query.FunctionParameter.decode(reader, reader.uint32()); + break; + } + case 204: { + message.LockingClause = $root.pg_query.LockingClause.decode(reader, reader.uint32()); + break; + } + case 205: { + message.RowMarkClause = $root.pg_query.RowMarkClause.decode(reader, reader.uint32()); + break; + } + case 206: { + message.XmlSerialize = $root.pg_query.XmlSerialize.decode(reader, reader.uint32()); + break; + } + case 207: { + message.WithClause = $root.pg_query.WithClause.decode(reader, reader.uint32()); + break; + } + case 208: { + message.InferClause = $root.pg_query.InferClause.decode(reader, reader.uint32()); + break; + } + case 209: { + message.OnConflictClause = $root.pg_query.OnConflictClause.decode(reader, reader.uint32()); + break; + } + case 210: { + message.CommonTableExpr = $root.pg_query.CommonTableExpr.decode(reader, reader.uint32()); + break; + } + case 211: { + message.RoleSpec = $root.pg_query.RoleSpec.decode(reader, reader.uint32()); + break; + } + case 212: { + message.TriggerTransition = $root.pg_query.TriggerTransition.decode(reader, reader.uint32()); + break; + } + case 213: { + message.PartitionElem = $root.pg_query.PartitionElem.decode(reader, reader.uint32()); + break; + } + case 214: { + message.PartitionSpec = $root.pg_query.PartitionSpec.decode(reader, reader.uint32()); + break; + } + case 215: { + message.PartitionBoundSpec = $root.pg_query.PartitionBoundSpec.decode(reader, reader.uint32()); + break; + } + case 216: { + message.PartitionRangeDatum = $root.pg_query.PartitionRangeDatum.decode(reader, reader.uint32()); + break; + } + case 217: { + message.PartitionCmd = $root.pg_query.PartitionCmd.decode(reader, reader.uint32()); + break; + } + case 218: { + message.VacuumRelation = $root.pg_query.VacuumRelation.decode(reader, reader.uint32()); + break; + } + case 219: { + message.InlineCodeBlock = $root.pg_query.InlineCodeBlock.decode(reader, reader.uint32()); + break; + } + case 220: { + message.CallContext = $root.pg_query.CallContext.decode(reader, reader.uint32()); + break; + } + case 221: { + message.Integer = $root.pg_query.Integer.decode(reader, reader.uint32()); + break; + } + case 222: { + message.Float = $root.pg_query.Float.decode(reader, reader.uint32()); + break; + } + case 223: { + message.String = $root.pg_query.String.decode(reader, reader.uint32()); + break; + } + case 224: { + message.BitString = $root.pg_query.BitString.decode(reader, reader.uint32()); + break; + } + case 225: { + message.Null = $root.pg_query.Null.decode(reader, reader.uint32()); + break; + } + case 226: { + message.List = $root.pg_query.List.decode(reader, reader.uint32()); + break; + } + case 227: { + message.IntList = $root.pg_query.IntList.decode(reader, reader.uint32()); + break; + } + case 228: { + message.OidList = $root.pg_query.OidList.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Node message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.Node + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.Node} Node + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Node.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Node message. + * @function verify + * @memberof pg_query.Node + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Node.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.Alias != null && message.hasOwnProperty("Alias")) { + properties.node = 1; + { + var error = $root.pg_query.Alias.verify(message.Alias); + if (error) + return "Alias." + error; + } + } + if (message.RangeVar != null && message.hasOwnProperty("RangeVar")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RangeVar.verify(message.RangeVar); + if (error) + return "RangeVar." + error; + } + } + if (message.TableFunc != null && message.hasOwnProperty("TableFunc")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.TableFunc.verify(message.TableFunc); + if (error) + return "TableFunc." + error; + } + } + if (message.Expr != null && message.hasOwnProperty("Expr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.Expr.verify(message.Expr); + if (error) + return "Expr." + error; + } + } + if (message.Var != null && message.hasOwnProperty("Var")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.Var.verify(message.Var); + if (error) + return "Var." + error; + } + } + if (message.Param != null && message.hasOwnProperty("Param")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.Param.verify(message.Param); + if (error) + return "Param." + error; + } + } + if (message.Aggref != null && message.hasOwnProperty("Aggref")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.Aggref.verify(message.Aggref); + if (error) + return "Aggref." + error; + } + } + if (message.GroupingFunc != null && message.hasOwnProperty("GroupingFunc")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.GroupingFunc.verify(message.GroupingFunc); + if (error) + return "GroupingFunc." + error; + } + } + if (message.WindowFunc != null && message.hasOwnProperty("WindowFunc")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.WindowFunc.verify(message.WindowFunc); + if (error) + return "WindowFunc." + error; + } + } + if (message.SubscriptingRef != null && message.hasOwnProperty("SubscriptingRef")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.SubscriptingRef.verify(message.SubscriptingRef); + if (error) + return "SubscriptingRef." + error; + } + } + if (message.FuncExpr != null && message.hasOwnProperty("FuncExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.FuncExpr.verify(message.FuncExpr); + if (error) + return "FuncExpr." + error; + } + } + if (message.NamedArgExpr != null && message.hasOwnProperty("NamedArgExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.NamedArgExpr.verify(message.NamedArgExpr); + if (error) + return "NamedArgExpr." + error; + } + } + if (message.OpExpr != null && message.hasOwnProperty("OpExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.OpExpr.verify(message.OpExpr); + if (error) + return "OpExpr." + error; + } + } + if (message.DistinctExpr != null && message.hasOwnProperty("DistinctExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DistinctExpr.verify(message.DistinctExpr); + if (error) + return "DistinctExpr." + error; + } + } + if (message.NullIfExpr != null && message.hasOwnProperty("NullIfExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.NullIfExpr.verify(message.NullIfExpr); + if (error) + return "NullIfExpr." + error; + } + } + if (message.ScalarArrayOpExpr != null && message.hasOwnProperty("ScalarArrayOpExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ScalarArrayOpExpr.verify(message.ScalarArrayOpExpr); + if (error) + return "ScalarArrayOpExpr." + error; + } + } + if (message.BoolExpr != null && message.hasOwnProperty("BoolExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.BoolExpr.verify(message.BoolExpr); + if (error) + return "BoolExpr." + error; + } + } + if (message.SubLink != null && message.hasOwnProperty("SubLink")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.SubLink.verify(message.SubLink); + if (error) + return "SubLink." + error; + } + } + if (message.SubPlan != null && message.hasOwnProperty("SubPlan")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.SubPlan.verify(message.SubPlan); + if (error) + return "SubPlan." + error; + } + } + if (message.AlternativeSubPlan != null && message.hasOwnProperty("AlternativeSubPlan")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlternativeSubPlan.verify(message.AlternativeSubPlan); + if (error) + return "AlternativeSubPlan." + error; + } + } + if (message.FieldSelect != null && message.hasOwnProperty("FieldSelect")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.FieldSelect.verify(message.FieldSelect); + if (error) + return "FieldSelect." + error; + } + } + if (message.FieldStore != null && message.hasOwnProperty("FieldStore")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.FieldStore.verify(message.FieldStore); + if (error) + return "FieldStore." + error; + } + } + if (message.RelabelType != null && message.hasOwnProperty("RelabelType")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RelabelType.verify(message.RelabelType); + if (error) + return "RelabelType." + error; + } + } + if (message.CoerceViaIO != null && message.hasOwnProperty("CoerceViaIO")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CoerceViaIO.verify(message.CoerceViaIO); + if (error) + return "CoerceViaIO." + error; + } + } + if (message.ArrayCoerceExpr != null && message.hasOwnProperty("ArrayCoerceExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ArrayCoerceExpr.verify(message.ArrayCoerceExpr); + if (error) + return "ArrayCoerceExpr." + error; + } + } + if (message.ConvertRowtypeExpr != null && message.hasOwnProperty("ConvertRowtypeExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ConvertRowtypeExpr.verify(message.ConvertRowtypeExpr); + if (error) + return "ConvertRowtypeExpr." + error; + } + } + if (message.CollateExpr != null && message.hasOwnProperty("CollateExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CollateExpr.verify(message.CollateExpr); + if (error) + return "CollateExpr." + error; + } + } + if (message.CaseExpr != null && message.hasOwnProperty("CaseExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CaseExpr.verify(message.CaseExpr); + if (error) + return "CaseExpr." + error; + } + } + if (message.CaseWhen != null && message.hasOwnProperty("CaseWhen")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CaseWhen.verify(message.CaseWhen); + if (error) + return "CaseWhen." + error; + } + } + if (message.CaseTestExpr != null && message.hasOwnProperty("CaseTestExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CaseTestExpr.verify(message.CaseTestExpr); + if (error) + return "CaseTestExpr." + error; + } + } + if (message.ArrayExpr != null && message.hasOwnProperty("ArrayExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ArrayExpr.verify(message.ArrayExpr); + if (error) + return "ArrayExpr." + error; + } + } + if (message.RowExpr != null && message.hasOwnProperty("RowExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RowExpr.verify(message.RowExpr); + if (error) + return "RowExpr." + error; + } + } + if (message.RowCompareExpr != null && message.hasOwnProperty("RowCompareExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RowCompareExpr.verify(message.RowCompareExpr); + if (error) + return "RowCompareExpr." + error; + } + } + if (message.CoalesceExpr != null && message.hasOwnProperty("CoalesceExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CoalesceExpr.verify(message.CoalesceExpr); + if (error) + return "CoalesceExpr." + error; + } + } + if (message.MinMaxExpr != null && message.hasOwnProperty("MinMaxExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.MinMaxExpr.verify(message.MinMaxExpr); + if (error) + return "MinMaxExpr." + error; + } + } + if (message.SQLValueFunction != null && message.hasOwnProperty("SQLValueFunction")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.SQLValueFunction.verify(message.SQLValueFunction); + if (error) + return "SQLValueFunction." + error; + } + } + if (message.XmlExpr != null && message.hasOwnProperty("XmlExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.XmlExpr.verify(message.XmlExpr); + if (error) + return "XmlExpr." + error; + } + } + if (message.NullTest != null && message.hasOwnProperty("NullTest")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.NullTest.verify(message.NullTest); + if (error) + return "NullTest." + error; + } + } + if (message.BooleanTest != null && message.hasOwnProperty("BooleanTest")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.BooleanTest.verify(message.BooleanTest); + if (error) + return "BooleanTest." + error; + } + } + if (message.CoerceToDomain != null && message.hasOwnProperty("CoerceToDomain")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CoerceToDomain.verify(message.CoerceToDomain); + if (error) + return "CoerceToDomain." + error; + } + } + if (message.CoerceToDomainValue != null && message.hasOwnProperty("CoerceToDomainValue")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CoerceToDomainValue.verify(message.CoerceToDomainValue); + if (error) + return "CoerceToDomainValue." + error; + } + } + if (message.SetToDefault != null && message.hasOwnProperty("SetToDefault")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.SetToDefault.verify(message.SetToDefault); + if (error) + return "SetToDefault." + error; + } + } + if (message.CurrentOfExpr != null && message.hasOwnProperty("CurrentOfExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CurrentOfExpr.verify(message.CurrentOfExpr); + if (error) + return "CurrentOfExpr." + error; + } + } + if (message.NextValueExpr != null && message.hasOwnProperty("NextValueExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.NextValueExpr.verify(message.NextValueExpr); + if (error) + return "NextValueExpr." + error; + } + } + if (message.InferenceElem != null && message.hasOwnProperty("InferenceElem")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.InferenceElem.verify(message.InferenceElem); + if (error) + return "InferenceElem." + error; + } + } + if (message.TargetEntry != null && message.hasOwnProperty("TargetEntry")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.TargetEntry.verify(message.TargetEntry); + if (error) + return "TargetEntry." + error; + } + } + if (message.RangeTblRef != null && message.hasOwnProperty("RangeTblRef")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RangeTblRef.verify(message.RangeTblRef); + if (error) + return "RangeTblRef." + error; + } + } + if (message.JoinExpr != null && message.hasOwnProperty("JoinExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.JoinExpr.verify(message.JoinExpr); + if (error) + return "JoinExpr." + error; + } + } + if (message.FromExpr != null && message.hasOwnProperty("FromExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.FromExpr.verify(message.FromExpr); + if (error) + return "FromExpr." + error; + } + } + if (message.OnConflictExpr != null && message.hasOwnProperty("OnConflictExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.OnConflictExpr.verify(message.OnConflictExpr); + if (error) + return "OnConflictExpr." + error; + } + } + if (message.IntoClause != null && message.hasOwnProperty("IntoClause")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.IntoClause.verify(message.IntoClause); + if (error) + return "IntoClause." + error; + } + } + if (message.RawStmt != null && message.hasOwnProperty("RawStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RawStmt.verify(message.RawStmt); + if (error) + return "RawStmt." + error; + } + } + if (message.Query != null && message.hasOwnProperty("Query")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.Query.verify(message.Query); + if (error) + return "Query." + error; + } + } + if (message.InsertStmt != null && message.hasOwnProperty("InsertStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.InsertStmt.verify(message.InsertStmt); + if (error) + return "InsertStmt." + error; + } + } + if (message.DeleteStmt != null && message.hasOwnProperty("DeleteStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DeleteStmt.verify(message.DeleteStmt); + if (error) + return "DeleteStmt." + error; + } + } + if (message.UpdateStmt != null && message.hasOwnProperty("UpdateStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.UpdateStmt.verify(message.UpdateStmt); + if (error) + return "UpdateStmt." + error; + } + } + if (message.SelectStmt != null && message.hasOwnProperty("SelectStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.SelectStmt.verify(message.SelectStmt); + if (error) + return "SelectStmt." + error; + } + } + if (message.AlterTableStmt != null && message.hasOwnProperty("AlterTableStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterTableStmt.verify(message.AlterTableStmt); + if (error) + return "AlterTableStmt." + error; + } + } + if (message.AlterTableCmd != null && message.hasOwnProperty("AlterTableCmd")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterTableCmd.verify(message.AlterTableCmd); + if (error) + return "AlterTableCmd." + error; + } + } + if (message.AlterDomainStmt != null && message.hasOwnProperty("AlterDomainStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterDomainStmt.verify(message.AlterDomainStmt); + if (error) + return "AlterDomainStmt." + error; + } + } + if (message.SetOperationStmt != null && message.hasOwnProperty("SetOperationStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.SetOperationStmt.verify(message.SetOperationStmt); + if (error) + return "SetOperationStmt." + error; + } + } + if (message.GrantStmt != null && message.hasOwnProperty("GrantStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.GrantStmt.verify(message.GrantStmt); + if (error) + return "GrantStmt." + error; + } + } + if (message.GrantRoleStmt != null && message.hasOwnProperty("GrantRoleStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.GrantRoleStmt.verify(message.GrantRoleStmt); + if (error) + return "GrantRoleStmt." + error; + } + } + if (message.AlterDefaultPrivilegesStmt != null && message.hasOwnProperty("AlterDefaultPrivilegesStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterDefaultPrivilegesStmt.verify(message.AlterDefaultPrivilegesStmt); + if (error) + return "AlterDefaultPrivilegesStmt." + error; + } + } + if (message.ClosePortalStmt != null && message.hasOwnProperty("ClosePortalStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ClosePortalStmt.verify(message.ClosePortalStmt); + if (error) + return "ClosePortalStmt." + error; + } + } + if (message.ClusterStmt != null && message.hasOwnProperty("ClusterStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ClusterStmt.verify(message.ClusterStmt); + if (error) + return "ClusterStmt." + error; + } + } + if (message.CopyStmt != null && message.hasOwnProperty("CopyStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CopyStmt.verify(message.CopyStmt); + if (error) + return "CopyStmt." + error; + } + } + if (message.CreateStmt != null && message.hasOwnProperty("CreateStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateStmt.verify(message.CreateStmt); + if (error) + return "CreateStmt." + error; + } + } + if (message.DefineStmt != null && message.hasOwnProperty("DefineStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DefineStmt.verify(message.DefineStmt); + if (error) + return "DefineStmt." + error; + } + } + if (message.DropStmt != null && message.hasOwnProperty("DropStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DropStmt.verify(message.DropStmt); + if (error) + return "DropStmt." + error; + } + } + if (message.TruncateStmt != null && message.hasOwnProperty("TruncateStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.TruncateStmt.verify(message.TruncateStmt); + if (error) + return "TruncateStmt." + error; + } + } + if (message.CommentStmt != null && message.hasOwnProperty("CommentStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CommentStmt.verify(message.CommentStmt); + if (error) + return "CommentStmt." + error; + } + } + if (message.FetchStmt != null && message.hasOwnProperty("FetchStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.FetchStmt.verify(message.FetchStmt); + if (error) + return "FetchStmt." + error; + } + } + if (message.IndexStmt != null && message.hasOwnProperty("IndexStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.IndexStmt.verify(message.IndexStmt); + if (error) + return "IndexStmt." + error; + } + } + if (message.CreateFunctionStmt != null && message.hasOwnProperty("CreateFunctionStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateFunctionStmt.verify(message.CreateFunctionStmt); + if (error) + return "CreateFunctionStmt." + error; + } + } + if (message.AlterFunctionStmt != null && message.hasOwnProperty("AlterFunctionStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterFunctionStmt.verify(message.AlterFunctionStmt); + if (error) + return "AlterFunctionStmt." + error; + } + } + if (message.DoStmt != null && message.hasOwnProperty("DoStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DoStmt.verify(message.DoStmt); + if (error) + return "DoStmt." + error; + } + } + if (message.RenameStmt != null && message.hasOwnProperty("RenameStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RenameStmt.verify(message.RenameStmt); + if (error) + return "RenameStmt." + error; + } + } + if (message.RuleStmt != null && message.hasOwnProperty("RuleStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RuleStmt.verify(message.RuleStmt); + if (error) + return "RuleStmt." + error; + } + } + if (message.NotifyStmt != null && message.hasOwnProperty("NotifyStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.NotifyStmt.verify(message.NotifyStmt); + if (error) + return "NotifyStmt." + error; + } + } + if (message.ListenStmt != null && message.hasOwnProperty("ListenStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ListenStmt.verify(message.ListenStmt); + if (error) + return "ListenStmt." + error; + } + } + if (message.UnlistenStmt != null && message.hasOwnProperty("UnlistenStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.UnlistenStmt.verify(message.UnlistenStmt); + if (error) + return "UnlistenStmt." + error; + } + } + if (message.TransactionStmt != null && message.hasOwnProperty("TransactionStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.TransactionStmt.verify(message.TransactionStmt); + if (error) + return "TransactionStmt." + error; + } + } + if (message.ViewStmt != null && message.hasOwnProperty("ViewStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ViewStmt.verify(message.ViewStmt); + if (error) + return "ViewStmt." + error; + } + } + if (message.LoadStmt != null && message.hasOwnProperty("LoadStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.LoadStmt.verify(message.LoadStmt); + if (error) + return "LoadStmt." + error; + } + } + if (message.CreateDomainStmt != null && message.hasOwnProperty("CreateDomainStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateDomainStmt.verify(message.CreateDomainStmt); + if (error) + return "CreateDomainStmt." + error; + } + } + if (message.CreatedbStmt != null && message.hasOwnProperty("CreatedbStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreatedbStmt.verify(message.CreatedbStmt); + if (error) + return "CreatedbStmt." + error; + } + } + if (message.DropdbStmt != null && message.hasOwnProperty("DropdbStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DropdbStmt.verify(message.DropdbStmt); + if (error) + return "DropdbStmt." + error; + } + } + if (message.VacuumStmt != null && message.hasOwnProperty("VacuumStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.VacuumStmt.verify(message.VacuumStmt); + if (error) + return "VacuumStmt." + error; + } + } + if (message.ExplainStmt != null && message.hasOwnProperty("ExplainStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ExplainStmt.verify(message.ExplainStmt); + if (error) + return "ExplainStmt." + error; + } + } + if (message.CreateTableAsStmt != null && message.hasOwnProperty("CreateTableAsStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateTableAsStmt.verify(message.CreateTableAsStmt); + if (error) + return "CreateTableAsStmt." + error; + } + } + if (message.CreateSeqStmt != null && message.hasOwnProperty("CreateSeqStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateSeqStmt.verify(message.CreateSeqStmt); + if (error) + return "CreateSeqStmt." + error; + } + } + if (message.AlterSeqStmt != null && message.hasOwnProperty("AlterSeqStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterSeqStmt.verify(message.AlterSeqStmt); + if (error) + return "AlterSeqStmt." + error; + } + } + if (message.VariableSetStmt != null && message.hasOwnProperty("VariableSetStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.VariableSetStmt.verify(message.VariableSetStmt); + if (error) + return "VariableSetStmt." + error; + } + } + if (message.VariableShowStmt != null && message.hasOwnProperty("VariableShowStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.VariableShowStmt.verify(message.VariableShowStmt); + if (error) + return "VariableShowStmt." + error; + } + } + if (message.DiscardStmt != null && message.hasOwnProperty("DiscardStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DiscardStmt.verify(message.DiscardStmt); + if (error) + return "DiscardStmt." + error; + } + } + if (message.CreateTrigStmt != null && message.hasOwnProperty("CreateTrigStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateTrigStmt.verify(message.CreateTrigStmt); + if (error) + return "CreateTrigStmt." + error; + } + } + if (message.CreatePLangStmt != null && message.hasOwnProperty("CreatePLangStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreatePLangStmt.verify(message.CreatePLangStmt); + if (error) + return "CreatePLangStmt." + error; + } + } + if (message.CreateRoleStmt != null && message.hasOwnProperty("CreateRoleStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateRoleStmt.verify(message.CreateRoleStmt); + if (error) + return "CreateRoleStmt." + error; + } + } + if (message.AlterRoleStmt != null && message.hasOwnProperty("AlterRoleStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterRoleStmt.verify(message.AlterRoleStmt); + if (error) + return "AlterRoleStmt." + error; + } + } + if (message.DropRoleStmt != null && message.hasOwnProperty("DropRoleStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DropRoleStmt.verify(message.DropRoleStmt); + if (error) + return "DropRoleStmt." + error; + } + } + if (message.LockStmt != null && message.hasOwnProperty("LockStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.LockStmt.verify(message.LockStmt); + if (error) + return "LockStmt." + error; + } + } + if (message.ConstraintsSetStmt != null && message.hasOwnProperty("ConstraintsSetStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ConstraintsSetStmt.verify(message.ConstraintsSetStmt); + if (error) + return "ConstraintsSetStmt." + error; + } + } + if (message.ReindexStmt != null && message.hasOwnProperty("ReindexStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ReindexStmt.verify(message.ReindexStmt); + if (error) + return "ReindexStmt." + error; + } + } + if (message.CheckPointStmt != null && message.hasOwnProperty("CheckPointStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CheckPointStmt.verify(message.CheckPointStmt); + if (error) + return "CheckPointStmt." + error; + } + } + if (message.CreateSchemaStmt != null && message.hasOwnProperty("CreateSchemaStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateSchemaStmt.verify(message.CreateSchemaStmt); + if (error) + return "CreateSchemaStmt." + error; + } + } + if (message.AlterDatabaseStmt != null && message.hasOwnProperty("AlterDatabaseStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterDatabaseStmt.verify(message.AlterDatabaseStmt); + if (error) + return "AlterDatabaseStmt." + error; + } + } + if (message.AlterDatabaseSetStmt != null && message.hasOwnProperty("AlterDatabaseSetStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterDatabaseSetStmt.verify(message.AlterDatabaseSetStmt); + if (error) + return "AlterDatabaseSetStmt." + error; + } + } + if (message.AlterRoleSetStmt != null && message.hasOwnProperty("AlterRoleSetStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterRoleSetStmt.verify(message.AlterRoleSetStmt); + if (error) + return "AlterRoleSetStmt." + error; + } + } + if (message.CreateConversionStmt != null && message.hasOwnProperty("CreateConversionStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateConversionStmt.verify(message.CreateConversionStmt); + if (error) + return "CreateConversionStmt." + error; + } + } + if (message.CreateCastStmt != null && message.hasOwnProperty("CreateCastStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateCastStmt.verify(message.CreateCastStmt); + if (error) + return "CreateCastStmt." + error; + } + } + if (message.CreateOpClassStmt != null && message.hasOwnProperty("CreateOpClassStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateOpClassStmt.verify(message.CreateOpClassStmt); + if (error) + return "CreateOpClassStmt." + error; + } + } + if (message.CreateOpFamilyStmt != null && message.hasOwnProperty("CreateOpFamilyStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateOpFamilyStmt.verify(message.CreateOpFamilyStmt); + if (error) + return "CreateOpFamilyStmt." + error; + } + } + if (message.AlterOpFamilyStmt != null && message.hasOwnProperty("AlterOpFamilyStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterOpFamilyStmt.verify(message.AlterOpFamilyStmt); + if (error) + return "AlterOpFamilyStmt." + error; + } + } + if (message.PrepareStmt != null && message.hasOwnProperty("PrepareStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.PrepareStmt.verify(message.PrepareStmt); + if (error) + return "PrepareStmt." + error; + } + } + if (message.ExecuteStmt != null && message.hasOwnProperty("ExecuteStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ExecuteStmt.verify(message.ExecuteStmt); + if (error) + return "ExecuteStmt." + error; + } + } + if (message.DeallocateStmt != null && message.hasOwnProperty("DeallocateStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DeallocateStmt.verify(message.DeallocateStmt); + if (error) + return "DeallocateStmt." + error; + } + } + if (message.DeclareCursorStmt != null && message.hasOwnProperty("DeclareCursorStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DeclareCursorStmt.verify(message.DeclareCursorStmt); + if (error) + return "DeclareCursorStmt." + error; + } + } + if (message.CreateTableSpaceStmt != null && message.hasOwnProperty("CreateTableSpaceStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateTableSpaceStmt.verify(message.CreateTableSpaceStmt); + if (error) + return "CreateTableSpaceStmt." + error; + } + } + if (message.DropTableSpaceStmt != null && message.hasOwnProperty("DropTableSpaceStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DropTableSpaceStmt.verify(message.DropTableSpaceStmt); + if (error) + return "DropTableSpaceStmt." + error; + } + } + if (message.AlterObjectDependsStmt != null && message.hasOwnProperty("AlterObjectDependsStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterObjectDependsStmt.verify(message.AlterObjectDependsStmt); + if (error) + return "AlterObjectDependsStmt." + error; + } + } + if (message.AlterObjectSchemaStmt != null && message.hasOwnProperty("AlterObjectSchemaStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterObjectSchemaStmt.verify(message.AlterObjectSchemaStmt); + if (error) + return "AlterObjectSchemaStmt." + error; + } + } + if (message.AlterOwnerStmt != null && message.hasOwnProperty("AlterOwnerStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterOwnerStmt.verify(message.AlterOwnerStmt); + if (error) + return "AlterOwnerStmt." + error; + } + } + if (message.AlterOperatorStmt != null && message.hasOwnProperty("AlterOperatorStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterOperatorStmt.verify(message.AlterOperatorStmt); + if (error) + return "AlterOperatorStmt." + error; + } + } + if (message.AlterTypeStmt != null && message.hasOwnProperty("AlterTypeStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterTypeStmt.verify(message.AlterTypeStmt); + if (error) + return "AlterTypeStmt." + error; + } + } + if (message.DropOwnedStmt != null && message.hasOwnProperty("DropOwnedStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DropOwnedStmt.verify(message.DropOwnedStmt); + if (error) + return "DropOwnedStmt." + error; + } + } + if (message.ReassignOwnedStmt != null && message.hasOwnProperty("ReassignOwnedStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ReassignOwnedStmt.verify(message.ReassignOwnedStmt); + if (error) + return "ReassignOwnedStmt." + error; + } + } + if (message.CompositeTypeStmt != null && message.hasOwnProperty("CompositeTypeStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CompositeTypeStmt.verify(message.CompositeTypeStmt); + if (error) + return "CompositeTypeStmt." + error; + } + } + if (message.CreateEnumStmt != null && message.hasOwnProperty("CreateEnumStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateEnumStmt.verify(message.CreateEnumStmt); + if (error) + return "CreateEnumStmt." + error; + } + } + if (message.CreateRangeStmt != null && message.hasOwnProperty("CreateRangeStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateRangeStmt.verify(message.CreateRangeStmt); + if (error) + return "CreateRangeStmt." + error; + } + } + if (message.AlterEnumStmt != null && message.hasOwnProperty("AlterEnumStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterEnumStmt.verify(message.AlterEnumStmt); + if (error) + return "AlterEnumStmt." + error; + } + } + if (message.AlterTSDictionaryStmt != null && message.hasOwnProperty("AlterTSDictionaryStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterTSDictionaryStmt.verify(message.AlterTSDictionaryStmt); + if (error) + return "AlterTSDictionaryStmt." + error; + } + } + if (message.AlterTSConfigurationStmt != null && message.hasOwnProperty("AlterTSConfigurationStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterTSConfigurationStmt.verify(message.AlterTSConfigurationStmt); + if (error) + return "AlterTSConfigurationStmt." + error; + } + } + if (message.CreateFdwStmt != null && message.hasOwnProperty("CreateFdwStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateFdwStmt.verify(message.CreateFdwStmt); + if (error) + return "CreateFdwStmt." + error; + } + } + if (message.AlterFdwStmt != null && message.hasOwnProperty("AlterFdwStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterFdwStmt.verify(message.AlterFdwStmt); + if (error) + return "AlterFdwStmt." + error; + } + } + if (message.CreateForeignServerStmt != null && message.hasOwnProperty("CreateForeignServerStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateForeignServerStmt.verify(message.CreateForeignServerStmt); + if (error) + return "CreateForeignServerStmt." + error; + } + } + if (message.AlterForeignServerStmt != null && message.hasOwnProperty("AlterForeignServerStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterForeignServerStmt.verify(message.AlterForeignServerStmt); + if (error) + return "AlterForeignServerStmt." + error; + } + } + if (message.CreateUserMappingStmt != null && message.hasOwnProperty("CreateUserMappingStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateUserMappingStmt.verify(message.CreateUserMappingStmt); + if (error) + return "CreateUserMappingStmt." + error; + } + } + if (message.AlterUserMappingStmt != null && message.hasOwnProperty("AlterUserMappingStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterUserMappingStmt.verify(message.AlterUserMappingStmt); + if (error) + return "AlterUserMappingStmt." + error; + } + } + if (message.DropUserMappingStmt != null && message.hasOwnProperty("DropUserMappingStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DropUserMappingStmt.verify(message.DropUserMappingStmt); + if (error) + return "DropUserMappingStmt." + error; + } + } + if (message.AlterTableSpaceOptionsStmt != null && message.hasOwnProperty("AlterTableSpaceOptionsStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterTableSpaceOptionsStmt.verify(message.AlterTableSpaceOptionsStmt); + if (error) + return "AlterTableSpaceOptionsStmt." + error; + } + } + if (message.AlterTableMoveAllStmt != null && message.hasOwnProperty("AlterTableMoveAllStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterTableMoveAllStmt.verify(message.AlterTableMoveAllStmt); + if (error) + return "AlterTableMoveAllStmt." + error; + } + } + if (message.SecLabelStmt != null && message.hasOwnProperty("SecLabelStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.SecLabelStmt.verify(message.SecLabelStmt); + if (error) + return "SecLabelStmt." + error; + } + } + if (message.CreateForeignTableStmt != null && message.hasOwnProperty("CreateForeignTableStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateForeignTableStmt.verify(message.CreateForeignTableStmt); + if (error) + return "CreateForeignTableStmt." + error; + } + } + if (message.ImportForeignSchemaStmt != null && message.hasOwnProperty("ImportForeignSchemaStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ImportForeignSchemaStmt.verify(message.ImportForeignSchemaStmt); + if (error) + return "ImportForeignSchemaStmt." + error; + } + } + if (message.CreateExtensionStmt != null && message.hasOwnProperty("CreateExtensionStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateExtensionStmt.verify(message.CreateExtensionStmt); + if (error) + return "CreateExtensionStmt." + error; + } + } + if (message.AlterExtensionStmt != null && message.hasOwnProperty("AlterExtensionStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterExtensionStmt.verify(message.AlterExtensionStmt); + if (error) + return "AlterExtensionStmt." + error; + } + } + if (message.AlterExtensionContentsStmt != null && message.hasOwnProperty("AlterExtensionContentsStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterExtensionContentsStmt.verify(message.AlterExtensionContentsStmt); + if (error) + return "AlterExtensionContentsStmt." + error; + } + } + if (message.CreateEventTrigStmt != null && message.hasOwnProperty("CreateEventTrigStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateEventTrigStmt.verify(message.CreateEventTrigStmt); + if (error) + return "CreateEventTrigStmt." + error; + } + } + if (message.AlterEventTrigStmt != null && message.hasOwnProperty("AlterEventTrigStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterEventTrigStmt.verify(message.AlterEventTrigStmt); + if (error) + return "AlterEventTrigStmt." + error; + } + } + if (message.RefreshMatViewStmt != null && message.hasOwnProperty("RefreshMatViewStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RefreshMatViewStmt.verify(message.RefreshMatViewStmt); + if (error) + return "RefreshMatViewStmt." + error; + } + } + if (message.ReplicaIdentityStmt != null && message.hasOwnProperty("ReplicaIdentityStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ReplicaIdentityStmt.verify(message.ReplicaIdentityStmt); + if (error) + return "ReplicaIdentityStmt." + error; + } + } + if (message.AlterSystemStmt != null && message.hasOwnProperty("AlterSystemStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterSystemStmt.verify(message.AlterSystemStmt); + if (error) + return "AlterSystemStmt." + error; + } + } + if (message.CreatePolicyStmt != null && message.hasOwnProperty("CreatePolicyStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreatePolicyStmt.verify(message.CreatePolicyStmt); + if (error) + return "CreatePolicyStmt." + error; + } + } + if (message.AlterPolicyStmt != null && message.hasOwnProperty("AlterPolicyStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterPolicyStmt.verify(message.AlterPolicyStmt); + if (error) + return "AlterPolicyStmt." + error; + } + } + if (message.CreateTransformStmt != null && message.hasOwnProperty("CreateTransformStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateTransformStmt.verify(message.CreateTransformStmt); + if (error) + return "CreateTransformStmt." + error; + } + } + if (message.CreateAmStmt != null && message.hasOwnProperty("CreateAmStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateAmStmt.verify(message.CreateAmStmt); + if (error) + return "CreateAmStmt." + error; + } + } + if (message.CreatePublicationStmt != null && message.hasOwnProperty("CreatePublicationStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreatePublicationStmt.verify(message.CreatePublicationStmt); + if (error) + return "CreatePublicationStmt." + error; + } + } + if (message.AlterPublicationStmt != null && message.hasOwnProperty("AlterPublicationStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterPublicationStmt.verify(message.AlterPublicationStmt); + if (error) + return "AlterPublicationStmt." + error; + } + } + if (message.CreateSubscriptionStmt != null && message.hasOwnProperty("CreateSubscriptionStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateSubscriptionStmt.verify(message.CreateSubscriptionStmt); + if (error) + return "CreateSubscriptionStmt." + error; + } + } + if (message.AlterSubscriptionStmt != null && message.hasOwnProperty("AlterSubscriptionStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterSubscriptionStmt.verify(message.AlterSubscriptionStmt); + if (error) + return "AlterSubscriptionStmt." + error; + } + } + if (message.DropSubscriptionStmt != null && message.hasOwnProperty("DropSubscriptionStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DropSubscriptionStmt.verify(message.DropSubscriptionStmt); + if (error) + return "DropSubscriptionStmt." + error; + } + } + if (message.CreateStatsStmt != null && message.hasOwnProperty("CreateStatsStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateStatsStmt.verify(message.CreateStatsStmt); + if (error) + return "CreateStatsStmt." + error; + } + } + if (message.AlterCollationStmt != null && message.hasOwnProperty("AlterCollationStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterCollationStmt.verify(message.AlterCollationStmt); + if (error) + return "AlterCollationStmt." + error; + } + } + if (message.CallStmt != null && message.hasOwnProperty("CallStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CallStmt.verify(message.CallStmt); + if (error) + return "CallStmt." + error; + } + } + if (message.AlterStatsStmt != null && message.hasOwnProperty("AlterStatsStmt")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AlterStatsStmt.verify(message.AlterStatsStmt); + if (error) + return "AlterStatsStmt." + error; + } + } + if (message.A_Expr != null && message.hasOwnProperty("A_Expr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.A_Expr.verify(message.A_Expr); + if (error) + return "A_Expr." + error; + } + } + if (message.ColumnRef != null && message.hasOwnProperty("ColumnRef")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ColumnRef.verify(message.ColumnRef); + if (error) + return "ColumnRef." + error; + } + } + if (message.ParamRef != null && message.hasOwnProperty("ParamRef")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ParamRef.verify(message.ParamRef); + if (error) + return "ParamRef." + error; + } + } + if (message.A_Const != null && message.hasOwnProperty("A_Const")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.A_Const.verify(message.A_Const); + if (error) + return "A_Const." + error; + } + } + if (message.FuncCall != null && message.hasOwnProperty("FuncCall")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.FuncCall.verify(message.FuncCall); + if (error) + return "FuncCall." + error; + } + } + if (message.A_Star != null && message.hasOwnProperty("A_Star")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.A_Star.verify(message.A_Star); + if (error) + return "A_Star." + error; + } + } + if (message.A_Indices != null && message.hasOwnProperty("A_Indices")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.A_Indices.verify(message.A_Indices); + if (error) + return "A_Indices." + error; + } + } + if (message.A_Indirection != null && message.hasOwnProperty("A_Indirection")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.A_Indirection.verify(message.A_Indirection); + if (error) + return "A_Indirection." + error; + } + } + if (message.A_ArrayExpr != null && message.hasOwnProperty("A_ArrayExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.A_ArrayExpr.verify(message.A_ArrayExpr); + if (error) + return "A_ArrayExpr." + error; + } + } + if (message.ResTarget != null && message.hasOwnProperty("ResTarget")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ResTarget.verify(message.ResTarget); + if (error) + return "ResTarget." + error; + } + } + if (message.MultiAssignRef != null && message.hasOwnProperty("MultiAssignRef")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.MultiAssignRef.verify(message.MultiAssignRef); + if (error) + return "MultiAssignRef." + error; + } + } + if (message.TypeCast != null && message.hasOwnProperty("TypeCast")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.TypeCast.verify(message.TypeCast); + if (error) + return "TypeCast." + error; + } + } + if (message.CollateClause != null && message.hasOwnProperty("CollateClause")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CollateClause.verify(message.CollateClause); + if (error) + return "CollateClause." + error; + } + } + if (message.SortBy != null && message.hasOwnProperty("SortBy")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.SortBy.verify(message.SortBy); + if (error) + return "SortBy." + error; + } + } + if (message.WindowDef != null && message.hasOwnProperty("WindowDef")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.WindowDef.verify(message.WindowDef); + if (error) + return "WindowDef." + error; + } + } + if (message.RangeSubselect != null && message.hasOwnProperty("RangeSubselect")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RangeSubselect.verify(message.RangeSubselect); + if (error) + return "RangeSubselect." + error; + } + } + if (message.RangeFunction != null && message.hasOwnProperty("RangeFunction")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RangeFunction.verify(message.RangeFunction); + if (error) + return "RangeFunction." + error; + } + } + if (message.RangeTableSample != null && message.hasOwnProperty("RangeTableSample")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RangeTableSample.verify(message.RangeTableSample); + if (error) + return "RangeTableSample." + error; + } + } + if (message.RangeTableFunc != null && message.hasOwnProperty("RangeTableFunc")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RangeTableFunc.verify(message.RangeTableFunc); + if (error) + return "RangeTableFunc." + error; + } + } + if (message.RangeTableFuncCol != null && message.hasOwnProperty("RangeTableFuncCol")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RangeTableFuncCol.verify(message.RangeTableFuncCol); + if (error) + return "RangeTableFuncCol." + error; + } + } + if (message.TypeName != null && message.hasOwnProperty("TypeName")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.TypeName.verify(message.TypeName); + if (error) + return "TypeName." + error; + } + } + if (message.ColumnDef != null && message.hasOwnProperty("ColumnDef")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ColumnDef.verify(message.ColumnDef); + if (error) + return "ColumnDef." + error; + } + } + if (message.IndexElem != null && message.hasOwnProperty("IndexElem")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.IndexElem.verify(message.IndexElem); + if (error) + return "IndexElem." + error; + } + } + if (message.Constraint != null && message.hasOwnProperty("Constraint")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.Constraint.verify(message.Constraint); + if (error) + return "Constraint." + error; + } + } + if (message.DefElem != null && message.hasOwnProperty("DefElem")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.DefElem.verify(message.DefElem); + if (error) + return "DefElem." + error; + } + } + if (message.RangeTblEntry != null && message.hasOwnProperty("RangeTblEntry")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RangeTblEntry.verify(message.RangeTblEntry); + if (error) + return "RangeTblEntry." + error; + } + } + if (message.RangeTblFunction != null && message.hasOwnProperty("RangeTblFunction")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RangeTblFunction.verify(message.RangeTblFunction); + if (error) + return "RangeTblFunction." + error; + } + } + if (message.TableSampleClause != null && message.hasOwnProperty("TableSampleClause")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.TableSampleClause.verify(message.TableSampleClause); + if (error) + return "TableSampleClause." + error; + } + } + if (message.WithCheckOption != null && message.hasOwnProperty("WithCheckOption")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.WithCheckOption.verify(message.WithCheckOption); + if (error) + return "WithCheckOption." + error; + } + } + if (message.SortGroupClause != null && message.hasOwnProperty("SortGroupClause")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.SortGroupClause.verify(message.SortGroupClause); + if (error) + return "SortGroupClause." + error; + } + } + if (message.GroupingSet != null && message.hasOwnProperty("GroupingSet")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.GroupingSet.verify(message.GroupingSet); + if (error) + return "GroupingSet." + error; + } + } + if (message.WindowClause != null && message.hasOwnProperty("WindowClause")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.WindowClause.verify(message.WindowClause); + if (error) + return "WindowClause." + error; + } + } + if (message.ObjectWithArgs != null && message.hasOwnProperty("ObjectWithArgs")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.ObjectWithArgs.verify(message.ObjectWithArgs); + if (error) + return "ObjectWithArgs." + error; + } + } + if (message.AccessPriv != null && message.hasOwnProperty("AccessPriv")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.AccessPriv.verify(message.AccessPriv); + if (error) + return "AccessPriv." + error; + } + } + if (message.CreateOpClassItem != null && message.hasOwnProperty("CreateOpClassItem")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CreateOpClassItem.verify(message.CreateOpClassItem); + if (error) + return "CreateOpClassItem." + error; + } + } + if (message.TableLikeClause != null && message.hasOwnProperty("TableLikeClause")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.TableLikeClause.verify(message.TableLikeClause); + if (error) + return "TableLikeClause." + error; + } + } + if (message.FunctionParameter != null && message.hasOwnProperty("FunctionParameter")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.FunctionParameter.verify(message.FunctionParameter); + if (error) + return "FunctionParameter." + error; + } + } + if (message.LockingClause != null && message.hasOwnProperty("LockingClause")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.LockingClause.verify(message.LockingClause); + if (error) + return "LockingClause." + error; + } + } + if (message.RowMarkClause != null && message.hasOwnProperty("RowMarkClause")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RowMarkClause.verify(message.RowMarkClause); + if (error) + return "RowMarkClause." + error; + } + } + if (message.XmlSerialize != null && message.hasOwnProperty("XmlSerialize")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.XmlSerialize.verify(message.XmlSerialize); + if (error) + return "XmlSerialize." + error; + } + } + if (message.WithClause != null && message.hasOwnProperty("WithClause")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.WithClause.verify(message.WithClause); + if (error) + return "WithClause." + error; + } + } + if (message.InferClause != null && message.hasOwnProperty("InferClause")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.InferClause.verify(message.InferClause); + if (error) + return "InferClause." + error; + } + } + if (message.OnConflictClause != null && message.hasOwnProperty("OnConflictClause")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.OnConflictClause.verify(message.OnConflictClause); + if (error) + return "OnConflictClause." + error; + } + } + if (message.CommonTableExpr != null && message.hasOwnProperty("CommonTableExpr")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CommonTableExpr.verify(message.CommonTableExpr); + if (error) + return "CommonTableExpr." + error; + } + } + if (message.RoleSpec != null && message.hasOwnProperty("RoleSpec")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.RoleSpec.verify(message.RoleSpec); + if (error) + return "RoleSpec." + error; + } + } + if (message.TriggerTransition != null && message.hasOwnProperty("TriggerTransition")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.TriggerTransition.verify(message.TriggerTransition); + if (error) + return "TriggerTransition." + error; + } + } + if (message.PartitionElem != null && message.hasOwnProperty("PartitionElem")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.PartitionElem.verify(message.PartitionElem); + if (error) + return "PartitionElem." + error; + } + } + if (message.PartitionSpec != null && message.hasOwnProperty("PartitionSpec")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.PartitionSpec.verify(message.PartitionSpec); + if (error) + return "PartitionSpec." + error; + } + } + if (message.PartitionBoundSpec != null && message.hasOwnProperty("PartitionBoundSpec")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.PartitionBoundSpec.verify(message.PartitionBoundSpec); + if (error) + return "PartitionBoundSpec." + error; + } + } + if (message.PartitionRangeDatum != null && message.hasOwnProperty("PartitionRangeDatum")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.PartitionRangeDatum.verify(message.PartitionRangeDatum); + if (error) + return "PartitionRangeDatum." + error; + } + } + if (message.PartitionCmd != null && message.hasOwnProperty("PartitionCmd")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.PartitionCmd.verify(message.PartitionCmd); + if (error) + return "PartitionCmd." + error; + } + } + if (message.VacuumRelation != null && message.hasOwnProperty("VacuumRelation")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.VacuumRelation.verify(message.VacuumRelation); + if (error) + return "VacuumRelation." + error; + } + } + if (message.InlineCodeBlock != null && message.hasOwnProperty("InlineCodeBlock")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.InlineCodeBlock.verify(message.InlineCodeBlock); + if (error) + return "InlineCodeBlock." + error; + } + } + if (message.CallContext != null && message.hasOwnProperty("CallContext")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.CallContext.verify(message.CallContext); + if (error) + return "CallContext." + error; + } + } + if (message.Integer != null && message.hasOwnProperty("Integer")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.Integer.verify(message.Integer); + if (error) + return "Integer." + error; + } + } + if (message.Float != null && message.hasOwnProperty("Float")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.Float.verify(message.Float); + if (error) + return "Float." + error; + } + } + if (message.String != null && message.hasOwnProperty("String")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.String.verify(message.String); + if (error) + return "String." + error; + } + } + if (message.BitString != null && message.hasOwnProperty("BitString")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.BitString.verify(message.BitString); + if (error) + return "BitString." + error; + } + } + if (message.Null != null && message.hasOwnProperty("Null")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.Null.verify(message.Null); + if (error) + return "Null." + error; + } + } + if (message.List != null && message.hasOwnProperty("List")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.List.verify(message.List); + if (error) + return "List." + error; + } + } + if (message.IntList != null && message.hasOwnProperty("IntList")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.IntList.verify(message.IntList); + if (error) + return "IntList." + error; + } + } + if (message.OidList != null && message.hasOwnProperty("OidList")) { + if (properties.node === 1) + return "node: multiple values"; + properties.node = 1; + { + var error = $root.pg_query.OidList.verify(message.OidList); + if (error) + return "OidList." + error; + } + } + return null; + }; + + /** + * Creates a Node message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.Node + * @static + * @param {Object.} object Plain object + * @returns {pg_query.Node} Node + */ + Node.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.Node) + return object; + var message = new $root.pg_query.Node(); + if (object.Alias != null) { + if (typeof object.Alias !== "object") + throw TypeError(".pg_query.Node.Alias: object expected"); + message.Alias = $root.pg_query.Alias.fromObject(object.Alias); + } + if (object.RangeVar != null) { + if (typeof object.RangeVar !== "object") + throw TypeError(".pg_query.Node.RangeVar: object expected"); + message.RangeVar = $root.pg_query.RangeVar.fromObject(object.RangeVar); + } + if (object.TableFunc != null) { + if (typeof object.TableFunc !== "object") + throw TypeError(".pg_query.Node.TableFunc: object expected"); + message.TableFunc = $root.pg_query.TableFunc.fromObject(object.TableFunc); + } + if (object.Expr != null) { + if (typeof object.Expr !== "object") + throw TypeError(".pg_query.Node.Expr: object expected"); + message.Expr = $root.pg_query.Expr.fromObject(object.Expr); + } + if (object.Var != null) { + if (typeof object.Var !== "object") + throw TypeError(".pg_query.Node.Var: object expected"); + message.Var = $root.pg_query.Var.fromObject(object.Var); + } + if (object.Param != null) { + if (typeof object.Param !== "object") + throw TypeError(".pg_query.Node.Param: object expected"); + message.Param = $root.pg_query.Param.fromObject(object.Param); + } + if (object.Aggref != null) { + if (typeof object.Aggref !== "object") + throw TypeError(".pg_query.Node.Aggref: object expected"); + message.Aggref = $root.pg_query.Aggref.fromObject(object.Aggref); + } + if (object.GroupingFunc != null) { + if (typeof object.GroupingFunc !== "object") + throw TypeError(".pg_query.Node.GroupingFunc: object expected"); + message.GroupingFunc = $root.pg_query.GroupingFunc.fromObject(object.GroupingFunc); + } + if (object.WindowFunc != null) { + if (typeof object.WindowFunc !== "object") + throw TypeError(".pg_query.Node.WindowFunc: object expected"); + message.WindowFunc = $root.pg_query.WindowFunc.fromObject(object.WindowFunc); + } + if (object.SubscriptingRef != null) { + if (typeof object.SubscriptingRef !== "object") + throw TypeError(".pg_query.Node.SubscriptingRef: object expected"); + message.SubscriptingRef = $root.pg_query.SubscriptingRef.fromObject(object.SubscriptingRef); + } + if (object.FuncExpr != null) { + if (typeof object.FuncExpr !== "object") + throw TypeError(".pg_query.Node.FuncExpr: object expected"); + message.FuncExpr = $root.pg_query.FuncExpr.fromObject(object.FuncExpr); + } + if (object.NamedArgExpr != null) { + if (typeof object.NamedArgExpr !== "object") + throw TypeError(".pg_query.Node.NamedArgExpr: object expected"); + message.NamedArgExpr = $root.pg_query.NamedArgExpr.fromObject(object.NamedArgExpr); + } + if (object.OpExpr != null) { + if (typeof object.OpExpr !== "object") + throw TypeError(".pg_query.Node.OpExpr: object expected"); + message.OpExpr = $root.pg_query.OpExpr.fromObject(object.OpExpr); + } + if (object.DistinctExpr != null) { + if (typeof object.DistinctExpr !== "object") + throw TypeError(".pg_query.Node.DistinctExpr: object expected"); + message.DistinctExpr = $root.pg_query.DistinctExpr.fromObject(object.DistinctExpr); + } + if (object.NullIfExpr != null) { + if (typeof object.NullIfExpr !== "object") + throw TypeError(".pg_query.Node.NullIfExpr: object expected"); + message.NullIfExpr = $root.pg_query.NullIfExpr.fromObject(object.NullIfExpr); + } + if (object.ScalarArrayOpExpr != null) { + if (typeof object.ScalarArrayOpExpr !== "object") + throw TypeError(".pg_query.Node.ScalarArrayOpExpr: object expected"); + message.ScalarArrayOpExpr = $root.pg_query.ScalarArrayOpExpr.fromObject(object.ScalarArrayOpExpr); + } + if (object.BoolExpr != null) { + if (typeof object.BoolExpr !== "object") + throw TypeError(".pg_query.Node.BoolExpr: object expected"); + message.BoolExpr = $root.pg_query.BoolExpr.fromObject(object.BoolExpr); + } + if (object.SubLink != null) { + if (typeof object.SubLink !== "object") + throw TypeError(".pg_query.Node.SubLink: object expected"); + message.SubLink = $root.pg_query.SubLink.fromObject(object.SubLink); + } + if (object.SubPlan != null) { + if (typeof object.SubPlan !== "object") + throw TypeError(".pg_query.Node.SubPlan: object expected"); + message.SubPlan = $root.pg_query.SubPlan.fromObject(object.SubPlan); + } + if (object.AlternativeSubPlan != null) { + if (typeof object.AlternativeSubPlan !== "object") + throw TypeError(".pg_query.Node.AlternativeSubPlan: object expected"); + message.AlternativeSubPlan = $root.pg_query.AlternativeSubPlan.fromObject(object.AlternativeSubPlan); + } + if (object.FieldSelect != null) { + if (typeof object.FieldSelect !== "object") + throw TypeError(".pg_query.Node.FieldSelect: object expected"); + message.FieldSelect = $root.pg_query.FieldSelect.fromObject(object.FieldSelect); + } + if (object.FieldStore != null) { + if (typeof object.FieldStore !== "object") + throw TypeError(".pg_query.Node.FieldStore: object expected"); + message.FieldStore = $root.pg_query.FieldStore.fromObject(object.FieldStore); + } + if (object.RelabelType != null) { + if (typeof object.RelabelType !== "object") + throw TypeError(".pg_query.Node.RelabelType: object expected"); + message.RelabelType = $root.pg_query.RelabelType.fromObject(object.RelabelType); + } + if (object.CoerceViaIO != null) { + if (typeof object.CoerceViaIO !== "object") + throw TypeError(".pg_query.Node.CoerceViaIO: object expected"); + message.CoerceViaIO = $root.pg_query.CoerceViaIO.fromObject(object.CoerceViaIO); + } + if (object.ArrayCoerceExpr != null) { + if (typeof object.ArrayCoerceExpr !== "object") + throw TypeError(".pg_query.Node.ArrayCoerceExpr: object expected"); + message.ArrayCoerceExpr = $root.pg_query.ArrayCoerceExpr.fromObject(object.ArrayCoerceExpr); + } + if (object.ConvertRowtypeExpr != null) { + if (typeof object.ConvertRowtypeExpr !== "object") + throw TypeError(".pg_query.Node.ConvertRowtypeExpr: object expected"); + message.ConvertRowtypeExpr = $root.pg_query.ConvertRowtypeExpr.fromObject(object.ConvertRowtypeExpr); + } + if (object.CollateExpr != null) { + if (typeof object.CollateExpr !== "object") + throw TypeError(".pg_query.Node.CollateExpr: object expected"); + message.CollateExpr = $root.pg_query.CollateExpr.fromObject(object.CollateExpr); + } + if (object.CaseExpr != null) { + if (typeof object.CaseExpr !== "object") + throw TypeError(".pg_query.Node.CaseExpr: object expected"); + message.CaseExpr = $root.pg_query.CaseExpr.fromObject(object.CaseExpr); + } + if (object.CaseWhen != null) { + if (typeof object.CaseWhen !== "object") + throw TypeError(".pg_query.Node.CaseWhen: object expected"); + message.CaseWhen = $root.pg_query.CaseWhen.fromObject(object.CaseWhen); + } + if (object.CaseTestExpr != null) { + if (typeof object.CaseTestExpr !== "object") + throw TypeError(".pg_query.Node.CaseTestExpr: object expected"); + message.CaseTestExpr = $root.pg_query.CaseTestExpr.fromObject(object.CaseTestExpr); + } + if (object.ArrayExpr != null) { + if (typeof object.ArrayExpr !== "object") + throw TypeError(".pg_query.Node.ArrayExpr: object expected"); + message.ArrayExpr = $root.pg_query.ArrayExpr.fromObject(object.ArrayExpr); + } + if (object.RowExpr != null) { + if (typeof object.RowExpr !== "object") + throw TypeError(".pg_query.Node.RowExpr: object expected"); + message.RowExpr = $root.pg_query.RowExpr.fromObject(object.RowExpr); + } + if (object.RowCompareExpr != null) { + if (typeof object.RowCompareExpr !== "object") + throw TypeError(".pg_query.Node.RowCompareExpr: object expected"); + message.RowCompareExpr = $root.pg_query.RowCompareExpr.fromObject(object.RowCompareExpr); + } + if (object.CoalesceExpr != null) { + if (typeof object.CoalesceExpr !== "object") + throw TypeError(".pg_query.Node.CoalesceExpr: object expected"); + message.CoalesceExpr = $root.pg_query.CoalesceExpr.fromObject(object.CoalesceExpr); + } + if (object.MinMaxExpr != null) { + if (typeof object.MinMaxExpr !== "object") + throw TypeError(".pg_query.Node.MinMaxExpr: object expected"); + message.MinMaxExpr = $root.pg_query.MinMaxExpr.fromObject(object.MinMaxExpr); + } + if (object.SQLValueFunction != null) { + if (typeof object.SQLValueFunction !== "object") + throw TypeError(".pg_query.Node.SQLValueFunction: object expected"); + message.SQLValueFunction = $root.pg_query.SQLValueFunction.fromObject(object.SQLValueFunction); + } + if (object.XmlExpr != null) { + if (typeof object.XmlExpr !== "object") + throw TypeError(".pg_query.Node.XmlExpr: object expected"); + message.XmlExpr = $root.pg_query.XmlExpr.fromObject(object.XmlExpr); + } + if (object.NullTest != null) { + if (typeof object.NullTest !== "object") + throw TypeError(".pg_query.Node.NullTest: object expected"); + message.NullTest = $root.pg_query.NullTest.fromObject(object.NullTest); + } + if (object.BooleanTest != null) { + if (typeof object.BooleanTest !== "object") + throw TypeError(".pg_query.Node.BooleanTest: object expected"); + message.BooleanTest = $root.pg_query.BooleanTest.fromObject(object.BooleanTest); + } + if (object.CoerceToDomain != null) { + if (typeof object.CoerceToDomain !== "object") + throw TypeError(".pg_query.Node.CoerceToDomain: object expected"); + message.CoerceToDomain = $root.pg_query.CoerceToDomain.fromObject(object.CoerceToDomain); + } + if (object.CoerceToDomainValue != null) { + if (typeof object.CoerceToDomainValue !== "object") + throw TypeError(".pg_query.Node.CoerceToDomainValue: object expected"); + message.CoerceToDomainValue = $root.pg_query.CoerceToDomainValue.fromObject(object.CoerceToDomainValue); + } + if (object.SetToDefault != null) { + if (typeof object.SetToDefault !== "object") + throw TypeError(".pg_query.Node.SetToDefault: object expected"); + message.SetToDefault = $root.pg_query.SetToDefault.fromObject(object.SetToDefault); + } + if (object.CurrentOfExpr != null) { + if (typeof object.CurrentOfExpr !== "object") + throw TypeError(".pg_query.Node.CurrentOfExpr: object expected"); + message.CurrentOfExpr = $root.pg_query.CurrentOfExpr.fromObject(object.CurrentOfExpr); + } + if (object.NextValueExpr != null) { + if (typeof object.NextValueExpr !== "object") + throw TypeError(".pg_query.Node.NextValueExpr: object expected"); + message.NextValueExpr = $root.pg_query.NextValueExpr.fromObject(object.NextValueExpr); + } + if (object.InferenceElem != null) { + if (typeof object.InferenceElem !== "object") + throw TypeError(".pg_query.Node.InferenceElem: object expected"); + message.InferenceElem = $root.pg_query.InferenceElem.fromObject(object.InferenceElem); + } + if (object.TargetEntry != null) { + if (typeof object.TargetEntry !== "object") + throw TypeError(".pg_query.Node.TargetEntry: object expected"); + message.TargetEntry = $root.pg_query.TargetEntry.fromObject(object.TargetEntry); + } + if (object.RangeTblRef != null) { + if (typeof object.RangeTblRef !== "object") + throw TypeError(".pg_query.Node.RangeTblRef: object expected"); + message.RangeTblRef = $root.pg_query.RangeTblRef.fromObject(object.RangeTblRef); + } + if (object.JoinExpr != null) { + if (typeof object.JoinExpr !== "object") + throw TypeError(".pg_query.Node.JoinExpr: object expected"); + message.JoinExpr = $root.pg_query.JoinExpr.fromObject(object.JoinExpr); + } + if (object.FromExpr != null) { + if (typeof object.FromExpr !== "object") + throw TypeError(".pg_query.Node.FromExpr: object expected"); + message.FromExpr = $root.pg_query.FromExpr.fromObject(object.FromExpr); + } + if (object.OnConflictExpr != null) { + if (typeof object.OnConflictExpr !== "object") + throw TypeError(".pg_query.Node.OnConflictExpr: object expected"); + message.OnConflictExpr = $root.pg_query.OnConflictExpr.fromObject(object.OnConflictExpr); + } + if (object.IntoClause != null) { + if (typeof object.IntoClause !== "object") + throw TypeError(".pg_query.Node.IntoClause: object expected"); + message.IntoClause = $root.pg_query.IntoClause.fromObject(object.IntoClause); + } + if (object.RawStmt != null) { + if (typeof object.RawStmt !== "object") + throw TypeError(".pg_query.Node.RawStmt: object expected"); + message.RawStmt = $root.pg_query.RawStmt.fromObject(object.RawStmt); + } + if (object.Query != null) { + if (typeof object.Query !== "object") + throw TypeError(".pg_query.Node.Query: object expected"); + message.Query = $root.pg_query.Query.fromObject(object.Query); + } + if (object.InsertStmt != null) { + if (typeof object.InsertStmt !== "object") + throw TypeError(".pg_query.Node.InsertStmt: object expected"); + message.InsertStmt = $root.pg_query.InsertStmt.fromObject(object.InsertStmt); + } + if (object.DeleteStmt != null) { + if (typeof object.DeleteStmt !== "object") + throw TypeError(".pg_query.Node.DeleteStmt: object expected"); + message.DeleteStmt = $root.pg_query.DeleteStmt.fromObject(object.DeleteStmt); + } + if (object.UpdateStmt != null) { + if (typeof object.UpdateStmt !== "object") + throw TypeError(".pg_query.Node.UpdateStmt: object expected"); + message.UpdateStmt = $root.pg_query.UpdateStmt.fromObject(object.UpdateStmt); + } + if (object.SelectStmt != null) { + if (typeof object.SelectStmt !== "object") + throw TypeError(".pg_query.Node.SelectStmt: object expected"); + message.SelectStmt = $root.pg_query.SelectStmt.fromObject(object.SelectStmt); + } + if (object.AlterTableStmt != null) { + if (typeof object.AlterTableStmt !== "object") + throw TypeError(".pg_query.Node.AlterTableStmt: object expected"); + message.AlterTableStmt = $root.pg_query.AlterTableStmt.fromObject(object.AlterTableStmt); + } + if (object.AlterTableCmd != null) { + if (typeof object.AlterTableCmd !== "object") + throw TypeError(".pg_query.Node.AlterTableCmd: object expected"); + message.AlterTableCmd = $root.pg_query.AlterTableCmd.fromObject(object.AlterTableCmd); + } + if (object.AlterDomainStmt != null) { + if (typeof object.AlterDomainStmt !== "object") + throw TypeError(".pg_query.Node.AlterDomainStmt: object expected"); + message.AlterDomainStmt = $root.pg_query.AlterDomainStmt.fromObject(object.AlterDomainStmt); + } + if (object.SetOperationStmt != null) { + if (typeof object.SetOperationStmt !== "object") + throw TypeError(".pg_query.Node.SetOperationStmt: object expected"); + message.SetOperationStmt = $root.pg_query.SetOperationStmt.fromObject(object.SetOperationStmt); + } + if (object.GrantStmt != null) { + if (typeof object.GrantStmt !== "object") + throw TypeError(".pg_query.Node.GrantStmt: object expected"); + message.GrantStmt = $root.pg_query.GrantStmt.fromObject(object.GrantStmt); + } + if (object.GrantRoleStmt != null) { + if (typeof object.GrantRoleStmt !== "object") + throw TypeError(".pg_query.Node.GrantRoleStmt: object expected"); + message.GrantRoleStmt = $root.pg_query.GrantRoleStmt.fromObject(object.GrantRoleStmt); + } + if (object.AlterDefaultPrivilegesStmt != null) { + if (typeof object.AlterDefaultPrivilegesStmt !== "object") + throw TypeError(".pg_query.Node.AlterDefaultPrivilegesStmt: object expected"); + message.AlterDefaultPrivilegesStmt = $root.pg_query.AlterDefaultPrivilegesStmt.fromObject(object.AlterDefaultPrivilegesStmt); + } + if (object.ClosePortalStmt != null) { + if (typeof object.ClosePortalStmt !== "object") + throw TypeError(".pg_query.Node.ClosePortalStmt: object expected"); + message.ClosePortalStmt = $root.pg_query.ClosePortalStmt.fromObject(object.ClosePortalStmt); + } + if (object.ClusterStmt != null) { + if (typeof object.ClusterStmt !== "object") + throw TypeError(".pg_query.Node.ClusterStmt: object expected"); + message.ClusterStmt = $root.pg_query.ClusterStmt.fromObject(object.ClusterStmt); + } + if (object.CopyStmt != null) { + if (typeof object.CopyStmt !== "object") + throw TypeError(".pg_query.Node.CopyStmt: object expected"); + message.CopyStmt = $root.pg_query.CopyStmt.fromObject(object.CopyStmt); + } + if (object.CreateStmt != null) { + if (typeof object.CreateStmt !== "object") + throw TypeError(".pg_query.Node.CreateStmt: object expected"); + message.CreateStmt = $root.pg_query.CreateStmt.fromObject(object.CreateStmt); + } + if (object.DefineStmt != null) { + if (typeof object.DefineStmt !== "object") + throw TypeError(".pg_query.Node.DefineStmt: object expected"); + message.DefineStmt = $root.pg_query.DefineStmt.fromObject(object.DefineStmt); + } + if (object.DropStmt != null) { + if (typeof object.DropStmt !== "object") + throw TypeError(".pg_query.Node.DropStmt: object expected"); + message.DropStmt = $root.pg_query.DropStmt.fromObject(object.DropStmt); + } + if (object.TruncateStmt != null) { + if (typeof object.TruncateStmt !== "object") + throw TypeError(".pg_query.Node.TruncateStmt: object expected"); + message.TruncateStmt = $root.pg_query.TruncateStmt.fromObject(object.TruncateStmt); + } + if (object.CommentStmt != null) { + if (typeof object.CommentStmt !== "object") + throw TypeError(".pg_query.Node.CommentStmt: object expected"); + message.CommentStmt = $root.pg_query.CommentStmt.fromObject(object.CommentStmt); + } + if (object.FetchStmt != null) { + if (typeof object.FetchStmt !== "object") + throw TypeError(".pg_query.Node.FetchStmt: object expected"); + message.FetchStmt = $root.pg_query.FetchStmt.fromObject(object.FetchStmt); + } + if (object.IndexStmt != null) { + if (typeof object.IndexStmt !== "object") + throw TypeError(".pg_query.Node.IndexStmt: object expected"); + message.IndexStmt = $root.pg_query.IndexStmt.fromObject(object.IndexStmt); + } + if (object.CreateFunctionStmt != null) { + if (typeof object.CreateFunctionStmt !== "object") + throw TypeError(".pg_query.Node.CreateFunctionStmt: object expected"); + message.CreateFunctionStmt = $root.pg_query.CreateFunctionStmt.fromObject(object.CreateFunctionStmt); + } + if (object.AlterFunctionStmt != null) { + if (typeof object.AlterFunctionStmt !== "object") + throw TypeError(".pg_query.Node.AlterFunctionStmt: object expected"); + message.AlterFunctionStmt = $root.pg_query.AlterFunctionStmt.fromObject(object.AlterFunctionStmt); + } + if (object.DoStmt != null) { + if (typeof object.DoStmt !== "object") + throw TypeError(".pg_query.Node.DoStmt: object expected"); + message.DoStmt = $root.pg_query.DoStmt.fromObject(object.DoStmt); + } + if (object.RenameStmt != null) { + if (typeof object.RenameStmt !== "object") + throw TypeError(".pg_query.Node.RenameStmt: object expected"); + message.RenameStmt = $root.pg_query.RenameStmt.fromObject(object.RenameStmt); + } + if (object.RuleStmt != null) { + if (typeof object.RuleStmt !== "object") + throw TypeError(".pg_query.Node.RuleStmt: object expected"); + message.RuleStmt = $root.pg_query.RuleStmt.fromObject(object.RuleStmt); + } + if (object.NotifyStmt != null) { + if (typeof object.NotifyStmt !== "object") + throw TypeError(".pg_query.Node.NotifyStmt: object expected"); + message.NotifyStmt = $root.pg_query.NotifyStmt.fromObject(object.NotifyStmt); + } + if (object.ListenStmt != null) { + if (typeof object.ListenStmt !== "object") + throw TypeError(".pg_query.Node.ListenStmt: object expected"); + message.ListenStmt = $root.pg_query.ListenStmt.fromObject(object.ListenStmt); + } + if (object.UnlistenStmt != null) { + if (typeof object.UnlistenStmt !== "object") + throw TypeError(".pg_query.Node.UnlistenStmt: object expected"); + message.UnlistenStmt = $root.pg_query.UnlistenStmt.fromObject(object.UnlistenStmt); + } + if (object.TransactionStmt != null) { + if (typeof object.TransactionStmt !== "object") + throw TypeError(".pg_query.Node.TransactionStmt: object expected"); + message.TransactionStmt = $root.pg_query.TransactionStmt.fromObject(object.TransactionStmt); + } + if (object.ViewStmt != null) { + if (typeof object.ViewStmt !== "object") + throw TypeError(".pg_query.Node.ViewStmt: object expected"); + message.ViewStmt = $root.pg_query.ViewStmt.fromObject(object.ViewStmt); + } + if (object.LoadStmt != null) { + if (typeof object.LoadStmt !== "object") + throw TypeError(".pg_query.Node.LoadStmt: object expected"); + message.LoadStmt = $root.pg_query.LoadStmt.fromObject(object.LoadStmt); + } + if (object.CreateDomainStmt != null) { + if (typeof object.CreateDomainStmt !== "object") + throw TypeError(".pg_query.Node.CreateDomainStmt: object expected"); + message.CreateDomainStmt = $root.pg_query.CreateDomainStmt.fromObject(object.CreateDomainStmt); + } + if (object.CreatedbStmt != null) { + if (typeof object.CreatedbStmt !== "object") + throw TypeError(".pg_query.Node.CreatedbStmt: object expected"); + message.CreatedbStmt = $root.pg_query.CreatedbStmt.fromObject(object.CreatedbStmt); + } + if (object.DropdbStmt != null) { + if (typeof object.DropdbStmt !== "object") + throw TypeError(".pg_query.Node.DropdbStmt: object expected"); + message.DropdbStmt = $root.pg_query.DropdbStmt.fromObject(object.DropdbStmt); + } + if (object.VacuumStmt != null) { + if (typeof object.VacuumStmt !== "object") + throw TypeError(".pg_query.Node.VacuumStmt: object expected"); + message.VacuumStmt = $root.pg_query.VacuumStmt.fromObject(object.VacuumStmt); + } + if (object.ExplainStmt != null) { + if (typeof object.ExplainStmt !== "object") + throw TypeError(".pg_query.Node.ExplainStmt: object expected"); + message.ExplainStmt = $root.pg_query.ExplainStmt.fromObject(object.ExplainStmt); + } + if (object.CreateTableAsStmt != null) { + if (typeof object.CreateTableAsStmt !== "object") + throw TypeError(".pg_query.Node.CreateTableAsStmt: object expected"); + message.CreateTableAsStmt = $root.pg_query.CreateTableAsStmt.fromObject(object.CreateTableAsStmt); + } + if (object.CreateSeqStmt != null) { + if (typeof object.CreateSeqStmt !== "object") + throw TypeError(".pg_query.Node.CreateSeqStmt: object expected"); + message.CreateSeqStmt = $root.pg_query.CreateSeqStmt.fromObject(object.CreateSeqStmt); + } + if (object.AlterSeqStmt != null) { + if (typeof object.AlterSeqStmt !== "object") + throw TypeError(".pg_query.Node.AlterSeqStmt: object expected"); + message.AlterSeqStmt = $root.pg_query.AlterSeqStmt.fromObject(object.AlterSeqStmt); + } + if (object.VariableSetStmt != null) { + if (typeof object.VariableSetStmt !== "object") + throw TypeError(".pg_query.Node.VariableSetStmt: object expected"); + message.VariableSetStmt = $root.pg_query.VariableSetStmt.fromObject(object.VariableSetStmt); + } + if (object.VariableShowStmt != null) { + if (typeof object.VariableShowStmt !== "object") + throw TypeError(".pg_query.Node.VariableShowStmt: object expected"); + message.VariableShowStmt = $root.pg_query.VariableShowStmt.fromObject(object.VariableShowStmt); + } + if (object.DiscardStmt != null) { + if (typeof object.DiscardStmt !== "object") + throw TypeError(".pg_query.Node.DiscardStmt: object expected"); + message.DiscardStmt = $root.pg_query.DiscardStmt.fromObject(object.DiscardStmt); + } + if (object.CreateTrigStmt != null) { + if (typeof object.CreateTrigStmt !== "object") + throw TypeError(".pg_query.Node.CreateTrigStmt: object expected"); + message.CreateTrigStmt = $root.pg_query.CreateTrigStmt.fromObject(object.CreateTrigStmt); + } + if (object.CreatePLangStmt != null) { + if (typeof object.CreatePLangStmt !== "object") + throw TypeError(".pg_query.Node.CreatePLangStmt: object expected"); + message.CreatePLangStmt = $root.pg_query.CreatePLangStmt.fromObject(object.CreatePLangStmt); + } + if (object.CreateRoleStmt != null) { + if (typeof object.CreateRoleStmt !== "object") + throw TypeError(".pg_query.Node.CreateRoleStmt: object expected"); + message.CreateRoleStmt = $root.pg_query.CreateRoleStmt.fromObject(object.CreateRoleStmt); + } + if (object.AlterRoleStmt != null) { + if (typeof object.AlterRoleStmt !== "object") + throw TypeError(".pg_query.Node.AlterRoleStmt: object expected"); + message.AlterRoleStmt = $root.pg_query.AlterRoleStmt.fromObject(object.AlterRoleStmt); + } + if (object.DropRoleStmt != null) { + if (typeof object.DropRoleStmt !== "object") + throw TypeError(".pg_query.Node.DropRoleStmt: object expected"); + message.DropRoleStmt = $root.pg_query.DropRoleStmt.fromObject(object.DropRoleStmt); + } + if (object.LockStmt != null) { + if (typeof object.LockStmt !== "object") + throw TypeError(".pg_query.Node.LockStmt: object expected"); + message.LockStmt = $root.pg_query.LockStmt.fromObject(object.LockStmt); + } + if (object.ConstraintsSetStmt != null) { + if (typeof object.ConstraintsSetStmt !== "object") + throw TypeError(".pg_query.Node.ConstraintsSetStmt: object expected"); + message.ConstraintsSetStmt = $root.pg_query.ConstraintsSetStmt.fromObject(object.ConstraintsSetStmt); + } + if (object.ReindexStmt != null) { + if (typeof object.ReindexStmt !== "object") + throw TypeError(".pg_query.Node.ReindexStmt: object expected"); + message.ReindexStmt = $root.pg_query.ReindexStmt.fromObject(object.ReindexStmt); + } + if (object.CheckPointStmt != null) { + if (typeof object.CheckPointStmt !== "object") + throw TypeError(".pg_query.Node.CheckPointStmt: object expected"); + message.CheckPointStmt = $root.pg_query.CheckPointStmt.fromObject(object.CheckPointStmt); + } + if (object.CreateSchemaStmt != null) { + if (typeof object.CreateSchemaStmt !== "object") + throw TypeError(".pg_query.Node.CreateSchemaStmt: object expected"); + message.CreateSchemaStmt = $root.pg_query.CreateSchemaStmt.fromObject(object.CreateSchemaStmt); + } + if (object.AlterDatabaseStmt != null) { + if (typeof object.AlterDatabaseStmt !== "object") + throw TypeError(".pg_query.Node.AlterDatabaseStmt: object expected"); + message.AlterDatabaseStmt = $root.pg_query.AlterDatabaseStmt.fromObject(object.AlterDatabaseStmt); + } + if (object.AlterDatabaseSetStmt != null) { + if (typeof object.AlterDatabaseSetStmt !== "object") + throw TypeError(".pg_query.Node.AlterDatabaseSetStmt: object expected"); + message.AlterDatabaseSetStmt = $root.pg_query.AlterDatabaseSetStmt.fromObject(object.AlterDatabaseSetStmt); + } + if (object.AlterRoleSetStmt != null) { + if (typeof object.AlterRoleSetStmt !== "object") + throw TypeError(".pg_query.Node.AlterRoleSetStmt: object expected"); + message.AlterRoleSetStmt = $root.pg_query.AlterRoleSetStmt.fromObject(object.AlterRoleSetStmt); + } + if (object.CreateConversionStmt != null) { + if (typeof object.CreateConversionStmt !== "object") + throw TypeError(".pg_query.Node.CreateConversionStmt: object expected"); + message.CreateConversionStmt = $root.pg_query.CreateConversionStmt.fromObject(object.CreateConversionStmt); + } + if (object.CreateCastStmt != null) { + if (typeof object.CreateCastStmt !== "object") + throw TypeError(".pg_query.Node.CreateCastStmt: object expected"); + message.CreateCastStmt = $root.pg_query.CreateCastStmt.fromObject(object.CreateCastStmt); + } + if (object.CreateOpClassStmt != null) { + if (typeof object.CreateOpClassStmt !== "object") + throw TypeError(".pg_query.Node.CreateOpClassStmt: object expected"); + message.CreateOpClassStmt = $root.pg_query.CreateOpClassStmt.fromObject(object.CreateOpClassStmt); + } + if (object.CreateOpFamilyStmt != null) { + if (typeof object.CreateOpFamilyStmt !== "object") + throw TypeError(".pg_query.Node.CreateOpFamilyStmt: object expected"); + message.CreateOpFamilyStmt = $root.pg_query.CreateOpFamilyStmt.fromObject(object.CreateOpFamilyStmt); + } + if (object.AlterOpFamilyStmt != null) { + if (typeof object.AlterOpFamilyStmt !== "object") + throw TypeError(".pg_query.Node.AlterOpFamilyStmt: object expected"); + message.AlterOpFamilyStmt = $root.pg_query.AlterOpFamilyStmt.fromObject(object.AlterOpFamilyStmt); + } + if (object.PrepareStmt != null) { + if (typeof object.PrepareStmt !== "object") + throw TypeError(".pg_query.Node.PrepareStmt: object expected"); + message.PrepareStmt = $root.pg_query.PrepareStmt.fromObject(object.PrepareStmt); + } + if (object.ExecuteStmt != null) { + if (typeof object.ExecuteStmt !== "object") + throw TypeError(".pg_query.Node.ExecuteStmt: object expected"); + message.ExecuteStmt = $root.pg_query.ExecuteStmt.fromObject(object.ExecuteStmt); + } + if (object.DeallocateStmt != null) { + if (typeof object.DeallocateStmt !== "object") + throw TypeError(".pg_query.Node.DeallocateStmt: object expected"); + message.DeallocateStmt = $root.pg_query.DeallocateStmt.fromObject(object.DeallocateStmt); + } + if (object.DeclareCursorStmt != null) { + if (typeof object.DeclareCursorStmt !== "object") + throw TypeError(".pg_query.Node.DeclareCursorStmt: object expected"); + message.DeclareCursorStmt = $root.pg_query.DeclareCursorStmt.fromObject(object.DeclareCursorStmt); + } + if (object.CreateTableSpaceStmt != null) { + if (typeof object.CreateTableSpaceStmt !== "object") + throw TypeError(".pg_query.Node.CreateTableSpaceStmt: object expected"); + message.CreateTableSpaceStmt = $root.pg_query.CreateTableSpaceStmt.fromObject(object.CreateTableSpaceStmt); + } + if (object.DropTableSpaceStmt != null) { + if (typeof object.DropTableSpaceStmt !== "object") + throw TypeError(".pg_query.Node.DropTableSpaceStmt: object expected"); + message.DropTableSpaceStmt = $root.pg_query.DropTableSpaceStmt.fromObject(object.DropTableSpaceStmt); + } + if (object.AlterObjectDependsStmt != null) { + if (typeof object.AlterObjectDependsStmt !== "object") + throw TypeError(".pg_query.Node.AlterObjectDependsStmt: object expected"); + message.AlterObjectDependsStmt = $root.pg_query.AlterObjectDependsStmt.fromObject(object.AlterObjectDependsStmt); + } + if (object.AlterObjectSchemaStmt != null) { + if (typeof object.AlterObjectSchemaStmt !== "object") + throw TypeError(".pg_query.Node.AlterObjectSchemaStmt: object expected"); + message.AlterObjectSchemaStmt = $root.pg_query.AlterObjectSchemaStmt.fromObject(object.AlterObjectSchemaStmt); + } + if (object.AlterOwnerStmt != null) { + if (typeof object.AlterOwnerStmt !== "object") + throw TypeError(".pg_query.Node.AlterOwnerStmt: object expected"); + message.AlterOwnerStmt = $root.pg_query.AlterOwnerStmt.fromObject(object.AlterOwnerStmt); + } + if (object.AlterOperatorStmt != null) { + if (typeof object.AlterOperatorStmt !== "object") + throw TypeError(".pg_query.Node.AlterOperatorStmt: object expected"); + message.AlterOperatorStmt = $root.pg_query.AlterOperatorStmt.fromObject(object.AlterOperatorStmt); + } + if (object.AlterTypeStmt != null) { + if (typeof object.AlterTypeStmt !== "object") + throw TypeError(".pg_query.Node.AlterTypeStmt: object expected"); + message.AlterTypeStmt = $root.pg_query.AlterTypeStmt.fromObject(object.AlterTypeStmt); + } + if (object.DropOwnedStmt != null) { + if (typeof object.DropOwnedStmt !== "object") + throw TypeError(".pg_query.Node.DropOwnedStmt: object expected"); + message.DropOwnedStmt = $root.pg_query.DropOwnedStmt.fromObject(object.DropOwnedStmt); + } + if (object.ReassignOwnedStmt != null) { + if (typeof object.ReassignOwnedStmt !== "object") + throw TypeError(".pg_query.Node.ReassignOwnedStmt: object expected"); + message.ReassignOwnedStmt = $root.pg_query.ReassignOwnedStmt.fromObject(object.ReassignOwnedStmt); + } + if (object.CompositeTypeStmt != null) { + if (typeof object.CompositeTypeStmt !== "object") + throw TypeError(".pg_query.Node.CompositeTypeStmt: object expected"); + message.CompositeTypeStmt = $root.pg_query.CompositeTypeStmt.fromObject(object.CompositeTypeStmt); + } + if (object.CreateEnumStmt != null) { + if (typeof object.CreateEnumStmt !== "object") + throw TypeError(".pg_query.Node.CreateEnumStmt: object expected"); + message.CreateEnumStmt = $root.pg_query.CreateEnumStmt.fromObject(object.CreateEnumStmt); + } + if (object.CreateRangeStmt != null) { + if (typeof object.CreateRangeStmt !== "object") + throw TypeError(".pg_query.Node.CreateRangeStmt: object expected"); + message.CreateRangeStmt = $root.pg_query.CreateRangeStmt.fromObject(object.CreateRangeStmt); + } + if (object.AlterEnumStmt != null) { + if (typeof object.AlterEnumStmt !== "object") + throw TypeError(".pg_query.Node.AlterEnumStmt: object expected"); + message.AlterEnumStmt = $root.pg_query.AlterEnumStmt.fromObject(object.AlterEnumStmt); + } + if (object.AlterTSDictionaryStmt != null) { + if (typeof object.AlterTSDictionaryStmt !== "object") + throw TypeError(".pg_query.Node.AlterTSDictionaryStmt: object expected"); + message.AlterTSDictionaryStmt = $root.pg_query.AlterTSDictionaryStmt.fromObject(object.AlterTSDictionaryStmt); + } + if (object.AlterTSConfigurationStmt != null) { + if (typeof object.AlterTSConfigurationStmt !== "object") + throw TypeError(".pg_query.Node.AlterTSConfigurationStmt: object expected"); + message.AlterTSConfigurationStmt = $root.pg_query.AlterTSConfigurationStmt.fromObject(object.AlterTSConfigurationStmt); + } + if (object.CreateFdwStmt != null) { + if (typeof object.CreateFdwStmt !== "object") + throw TypeError(".pg_query.Node.CreateFdwStmt: object expected"); + message.CreateFdwStmt = $root.pg_query.CreateFdwStmt.fromObject(object.CreateFdwStmt); + } + if (object.AlterFdwStmt != null) { + if (typeof object.AlterFdwStmt !== "object") + throw TypeError(".pg_query.Node.AlterFdwStmt: object expected"); + message.AlterFdwStmt = $root.pg_query.AlterFdwStmt.fromObject(object.AlterFdwStmt); + } + if (object.CreateForeignServerStmt != null) { + if (typeof object.CreateForeignServerStmt !== "object") + throw TypeError(".pg_query.Node.CreateForeignServerStmt: object expected"); + message.CreateForeignServerStmt = $root.pg_query.CreateForeignServerStmt.fromObject(object.CreateForeignServerStmt); + } + if (object.AlterForeignServerStmt != null) { + if (typeof object.AlterForeignServerStmt !== "object") + throw TypeError(".pg_query.Node.AlterForeignServerStmt: object expected"); + message.AlterForeignServerStmt = $root.pg_query.AlterForeignServerStmt.fromObject(object.AlterForeignServerStmt); + } + if (object.CreateUserMappingStmt != null) { + if (typeof object.CreateUserMappingStmt !== "object") + throw TypeError(".pg_query.Node.CreateUserMappingStmt: object expected"); + message.CreateUserMappingStmt = $root.pg_query.CreateUserMappingStmt.fromObject(object.CreateUserMappingStmt); + } + if (object.AlterUserMappingStmt != null) { + if (typeof object.AlterUserMappingStmt !== "object") + throw TypeError(".pg_query.Node.AlterUserMappingStmt: object expected"); + message.AlterUserMappingStmt = $root.pg_query.AlterUserMappingStmt.fromObject(object.AlterUserMappingStmt); + } + if (object.DropUserMappingStmt != null) { + if (typeof object.DropUserMappingStmt !== "object") + throw TypeError(".pg_query.Node.DropUserMappingStmt: object expected"); + message.DropUserMappingStmt = $root.pg_query.DropUserMappingStmt.fromObject(object.DropUserMappingStmt); + } + if (object.AlterTableSpaceOptionsStmt != null) { + if (typeof object.AlterTableSpaceOptionsStmt !== "object") + throw TypeError(".pg_query.Node.AlterTableSpaceOptionsStmt: object expected"); + message.AlterTableSpaceOptionsStmt = $root.pg_query.AlterTableSpaceOptionsStmt.fromObject(object.AlterTableSpaceOptionsStmt); + } + if (object.AlterTableMoveAllStmt != null) { + if (typeof object.AlterTableMoveAllStmt !== "object") + throw TypeError(".pg_query.Node.AlterTableMoveAllStmt: object expected"); + message.AlterTableMoveAllStmt = $root.pg_query.AlterTableMoveAllStmt.fromObject(object.AlterTableMoveAllStmt); + } + if (object.SecLabelStmt != null) { + if (typeof object.SecLabelStmt !== "object") + throw TypeError(".pg_query.Node.SecLabelStmt: object expected"); + message.SecLabelStmt = $root.pg_query.SecLabelStmt.fromObject(object.SecLabelStmt); + } + if (object.CreateForeignTableStmt != null) { + if (typeof object.CreateForeignTableStmt !== "object") + throw TypeError(".pg_query.Node.CreateForeignTableStmt: object expected"); + message.CreateForeignTableStmt = $root.pg_query.CreateForeignTableStmt.fromObject(object.CreateForeignTableStmt); + } + if (object.ImportForeignSchemaStmt != null) { + if (typeof object.ImportForeignSchemaStmt !== "object") + throw TypeError(".pg_query.Node.ImportForeignSchemaStmt: object expected"); + message.ImportForeignSchemaStmt = $root.pg_query.ImportForeignSchemaStmt.fromObject(object.ImportForeignSchemaStmt); + } + if (object.CreateExtensionStmt != null) { + if (typeof object.CreateExtensionStmt !== "object") + throw TypeError(".pg_query.Node.CreateExtensionStmt: object expected"); + message.CreateExtensionStmt = $root.pg_query.CreateExtensionStmt.fromObject(object.CreateExtensionStmt); + } + if (object.AlterExtensionStmt != null) { + if (typeof object.AlterExtensionStmt !== "object") + throw TypeError(".pg_query.Node.AlterExtensionStmt: object expected"); + message.AlterExtensionStmt = $root.pg_query.AlterExtensionStmt.fromObject(object.AlterExtensionStmt); + } + if (object.AlterExtensionContentsStmt != null) { + if (typeof object.AlterExtensionContentsStmt !== "object") + throw TypeError(".pg_query.Node.AlterExtensionContentsStmt: object expected"); + message.AlterExtensionContentsStmt = $root.pg_query.AlterExtensionContentsStmt.fromObject(object.AlterExtensionContentsStmt); + } + if (object.CreateEventTrigStmt != null) { + if (typeof object.CreateEventTrigStmt !== "object") + throw TypeError(".pg_query.Node.CreateEventTrigStmt: object expected"); + message.CreateEventTrigStmt = $root.pg_query.CreateEventTrigStmt.fromObject(object.CreateEventTrigStmt); + } + if (object.AlterEventTrigStmt != null) { + if (typeof object.AlterEventTrigStmt !== "object") + throw TypeError(".pg_query.Node.AlterEventTrigStmt: object expected"); + message.AlterEventTrigStmt = $root.pg_query.AlterEventTrigStmt.fromObject(object.AlterEventTrigStmt); + } + if (object.RefreshMatViewStmt != null) { + if (typeof object.RefreshMatViewStmt !== "object") + throw TypeError(".pg_query.Node.RefreshMatViewStmt: object expected"); + message.RefreshMatViewStmt = $root.pg_query.RefreshMatViewStmt.fromObject(object.RefreshMatViewStmt); + } + if (object.ReplicaIdentityStmt != null) { + if (typeof object.ReplicaIdentityStmt !== "object") + throw TypeError(".pg_query.Node.ReplicaIdentityStmt: object expected"); + message.ReplicaIdentityStmt = $root.pg_query.ReplicaIdentityStmt.fromObject(object.ReplicaIdentityStmt); + } + if (object.AlterSystemStmt != null) { + if (typeof object.AlterSystemStmt !== "object") + throw TypeError(".pg_query.Node.AlterSystemStmt: object expected"); + message.AlterSystemStmt = $root.pg_query.AlterSystemStmt.fromObject(object.AlterSystemStmt); + } + if (object.CreatePolicyStmt != null) { + if (typeof object.CreatePolicyStmt !== "object") + throw TypeError(".pg_query.Node.CreatePolicyStmt: object expected"); + message.CreatePolicyStmt = $root.pg_query.CreatePolicyStmt.fromObject(object.CreatePolicyStmt); + } + if (object.AlterPolicyStmt != null) { + if (typeof object.AlterPolicyStmt !== "object") + throw TypeError(".pg_query.Node.AlterPolicyStmt: object expected"); + message.AlterPolicyStmt = $root.pg_query.AlterPolicyStmt.fromObject(object.AlterPolicyStmt); + } + if (object.CreateTransformStmt != null) { + if (typeof object.CreateTransformStmt !== "object") + throw TypeError(".pg_query.Node.CreateTransformStmt: object expected"); + message.CreateTransformStmt = $root.pg_query.CreateTransformStmt.fromObject(object.CreateTransformStmt); + } + if (object.CreateAmStmt != null) { + if (typeof object.CreateAmStmt !== "object") + throw TypeError(".pg_query.Node.CreateAmStmt: object expected"); + message.CreateAmStmt = $root.pg_query.CreateAmStmt.fromObject(object.CreateAmStmt); + } + if (object.CreatePublicationStmt != null) { + if (typeof object.CreatePublicationStmt !== "object") + throw TypeError(".pg_query.Node.CreatePublicationStmt: object expected"); + message.CreatePublicationStmt = $root.pg_query.CreatePublicationStmt.fromObject(object.CreatePublicationStmt); + } + if (object.AlterPublicationStmt != null) { + if (typeof object.AlterPublicationStmt !== "object") + throw TypeError(".pg_query.Node.AlterPublicationStmt: object expected"); + message.AlterPublicationStmt = $root.pg_query.AlterPublicationStmt.fromObject(object.AlterPublicationStmt); + } + if (object.CreateSubscriptionStmt != null) { + if (typeof object.CreateSubscriptionStmt !== "object") + throw TypeError(".pg_query.Node.CreateSubscriptionStmt: object expected"); + message.CreateSubscriptionStmt = $root.pg_query.CreateSubscriptionStmt.fromObject(object.CreateSubscriptionStmt); + } + if (object.AlterSubscriptionStmt != null) { + if (typeof object.AlterSubscriptionStmt !== "object") + throw TypeError(".pg_query.Node.AlterSubscriptionStmt: object expected"); + message.AlterSubscriptionStmt = $root.pg_query.AlterSubscriptionStmt.fromObject(object.AlterSubscriptionStmt); + } + if (object.DropSubscriptionStmt != null) { + if (typeof object.DropSubscriptionStmt !== "object") + throw TypeError(".pg_query.Node.DropSubscriptionStmt: object expected"); + message.DropSubscriptionStmt = $root.pg_query.DropSubscriptionStmt.fromObject(object.DropSubscriptionStmt); + } + if (object.CreateStatsStmt != null) { + if (typeof object.CreateStatsStmt !== "object") + throw TypeError(".pg_query.Node.CreateStatsStmt: object expected"); + message.CreateStatsStmt = $root.pg_query.CreateStatsStmt.fromObject(object.CreateStatsStmt); + } + if (object.AlterCollationStmt != null) { + if (typeof object.AlterCollationStmt !== "object") + throw TypeError(".pg_query.Node.AlterCollationStmt: object expected"); + message.AlterCollationStmt = $root.pg_query.AlterCollationStmt.fromObject(object.AlterCollationStmt); + } + if (object.CallStmt != null) { + if (typeof object.CallStmt !== "object") + throw TypeError(".pg_query.Node.CallStmt: object expected"); + message.CallStmt = $root.pg_query.CallStmt.fromObject(object.CallStmt); + } + if (object.AlterStatsStmt != null) { + if (typeof object.AlterStatsStmt !== "object") + throw TypeError(".pg_query.Node.AlterStatsStmt: object expected"); + message.AlterStatsStmt = $root.pg_query.AlterStatsStmt.fromObject(object.AlterStatsStmt); + } + if (object.A_Expr != null) { + if (typeof object.A_Expr !== "object") + throw TypeError(".pg_query.Node.A_Expr: object expected"); + message.A_Expr = $root.pg_query.A_Expr.fromObject(object.A_Expr); + } + if (object.ColumnRef != null) { + if (typeof object.ColumnRef !== "object") + throw TypeError(".pg_query.Node.ColumnRef: object expected"); + message.ColumnRef = $root.pg_query.ColumnRef.fromObject(object.ColumnRef); + } + if (object.ParamRef != null) { + if (typeof object.ParamRef !== "object") + throw TypeError(".pg_query.Node.ParamRef: object expected"); + message.ParamRef = $root.pg_query.ParamRef.fromObject(object.ParamRef); + } + if (object.A_Const != null) { + if (typeof object.A_Const !== "object") + throw TypeError(".pg_query.Node.A_Const: object expected"); + message.A_Const = $root.pg_query.A_Const.fromObject(object.A_Const); + } + if (object.FuncCall != null) { + if (typeof object.FuncCall !== "object") + throw TypeError(".pg_query.Node.FuncCall: object expected"); + message.FuncCall = $root.pg_query.FuncCall.fromObject(object.FuncCall); + } + if (object.A_Star != null) { + if (typeof object.A_Star !== "object") + throw TypeError(".pg_query.Node.A_Star: object expected"); + message.A_Star = $root.pg_query.A_Star.fromObject(object.A_Star); + } + if (object.A_Indices != null) { + if (typeof object.A_Indices !== "object") + throw TypeError(".pg_query.Node.A_Indices: object expected"); + message.A_Indices = $root.pg_query.A_Indices.fromObject(object.A_Indices); + } + if (object.A_Indirection != null) { + if (typeof object.A_Indirection !== "object") + throw TypeError(".pg_query.Node.A_Indirection: object expected"); + message.A_Indirection = $root.pg_query.A_Indirection.fromObject(object.A_Indirection); + } + if (object.A_ArrayExpr != null) { + if (typeof object.A_ArrayExpr !== "object") + throw TypeError(".pg_query.Node.A_ArrayExpr: object expected"); + message.A_ArrayExpr = $root.pg_query.A_ArrayExpr.fromObject(object.A_ArrayExpr); + } + if (object.ResTarget != null) { + if (typeof object.ResTarget !== "object") + throw TypeError(".pg_query.Node.ResTarget: object expected"); + message.ResTarget = $root.pg_query.ResTarget.fromObject(object.ResTarget); + } + if (object.MultiAssignRef != null) { + if (typeof object.MultiAssignRef !== "object") + throw TypeError(".pg_query.Node.MultiAssignRef: object expected"); + message.MultiAssignRef = $root.pg_query.MultiAssignRef.fromObject(object.MultiAssignRef); + } + if (object.TypeCast != null) { + if (typeof object.TypeCast !== "object") + throw TypeError(".pg_query.Node.TypeCast: object expected"); + message.TypeCast = $root.pg_query.TypeCast.fromObject(object.TypeCast); + } + if (object.CollateClause != null) { + if (typeof object.CollateClause !== "object") + throw TypeError(".pg_query.Node.CollateClause: object expected"); + message.CollateClause = $root.pg_query.CollateClause.fromObject(object.CollateClause); + } + if (object.SortBy != null) { + if (typeof object.SortBy !== "object") + throw TypeError(".pg_query.Node.SortBy: object expected"); + message.SortBy = $root.pg_query.SortBy.fromObject(object.SortBy); + } + if (object.WindowDef != null) { + if (typeof object.WindowDef !== "object") + throw TypeError(".pg_query.Node.WindowDef: object expected"); + message.WindowDef = $root.pg_query.WindowDef.fromObject(object.WindowDef); + } + if (object.RangeSubselect != null) { + if (typeof object.RangeSubselect !== "object") + throw TypeError(".pg_query.Node.RangeSubselect: object expected"); + message.RangeSubselect = $root.pg_query.RangeSubselect.fromObject(object.RangeSubselect); + } + if (object.RangeFunction != null) { + if (typeof object.RangeFunction !== "object") + throw TypeError(".pg_query.Node.RangeFunction: object expected"); + message.RangeFunction = $root.pg_query.RangeFunction.fromObject(object.RangeFunction); + } + if (object.RangeTableSample != null) { + if (typeof object.RangeTableSample !== "object") + throw TypeError(".pg_query.Node.RangeTableSample: object expected"); + message.RangeTableSample = $root.pg_query.RangeTableSample.fromObject(object.RangeTableSample); + } + if (object.RangeTableFunc != null) { + if (typeof object.RangeTableFunc !== "object") + throw TypeError(".pg_query.Node.RangeTableFunc: object expected"); + message.RangeTableFunc = $root.pg_query.RangeTableFunc.fromObject(object.RangeTableFunc); + } + if (object.RangeTableFuncCol != null) { + if (typeof object.RangeTableFuncCol !== "object") + throw TypeError(".pg_query.Node.RangeTableFuncCol: object expected"); + message.RangeTableFuncCol = $root.pg_query.RangeTableFuncCol.fromObject(object.RangeTableFuncCol); + } + if (object.TypeName != null) { + if (typeof object.TypeName !== "object") + throw TypeError(".pg_query.Node.TypeName: object expected"); + message.TypeName = $root.pg_query.TypeName.fromObject(object.TypeName); + } + if (object.ColumnDef != null) { + if (typeof object.ColumnDef !== "object") + throw TypeError(".pg_query.Node.ColumnDef: object expected"); + message.ColumnDef = $root.pg_query.ColumnDef.fromObject(object.ColumnDef); + } + if (object.IndexElem != null) { + if (typeof object.IndexElem !== "object") + throw TypeError(".pg_query.Node.IndexElem: object expected"); + message.IndexElem = $root.pg_query.IndexElem.fromObject(object.IndexElem); + } + if (object.Constraint != null) { + if (typeof object.Constraint !== "object") + throw TypeError(".pg_query.Node.Constraint: object expected"); + message.Constraint = $root.pg_query.Constraint.fromObject(object.Constraint); + } + if (object.DefElem != null) { + if (typeof object.DefElem !== "object") + throw TypeError(".pg_query.Node.DefElem: object expected"); + message.DefElem = $root.pg_query.DefElem.fromObject(object.DefElem); + } + if (object.RangeTblEntry != null) { + if (typeof object.RangeTblEntry !== "object") + throw TypeError(".pg_query.Node.RangeTblEntry: object expected"); + message.RangeTblEntry = $root.pg_query.RangeTblEntry.fromObject(object.RangeTblEntry); + } + if (object.RangeTblFunction != null) { + if (typeof object.RangeTblFunction !== "object") + throw TypeError(".pg_query.Node.RangeTblFunction: object expected"); + message.RangeTblFunction = $root.pg_query.RangeTblFunction.fromObject(object.RangeTblFunction); + } + if (object.TableSampleClause != null) { + if (typeof object.TableSampleClause !== "object") + throw TypeError(".pg_query.Node.TableSampleClause: object expected"); + message.TableSampleClause = $root.pg_query.TableSampleClause.fromObject(object.TableSampleClause); + } + if (object.WithCheckOption != null) { + if (typeof object.WithCheckOption !== "object") + throw TypeError(".pg_query.Node.WithCheckOption: object expected"); + message.WithCheckOption = $root.pg_query.WithCheckOption.fromObject(object.WithCheckOption); + } + if (object.SortGroupClause != null) { + if (typeof object.SortGroupClause !== "object") + throw TypeError(".pg_query.Node.SortGroupClause: object expected"); + message.SortGroupClause = $root.pg_query.SortGroupClause.fromObject(object.SortGroupClause); + } + if (object.GroupingSet != null) { + if (typeof object.GroupingSet !== "object") + throw TypeError(".pg_query.Node.GroupingSet: object expected"); + message.GroupingSet = $root.pg_query.GroupingSet.fromObject(object.GroupingSet); + } + if (object.WindowClause != null) { + if (typeof object.WindowClause !== "object") + throw TypeError(".pg_query.Node.WindowClause: object expected"); + message.WindowClause = $root.pg_query.WindowClause.fromObject(object.WindowClause); + } + if (object.ObjectWithArgs != null) { + if (typeof object.ObjectWithArgs !== "object") + throw TypeError(".pg_query.Node.ObjectWithArgs: object expected"); + message.ObjectWithArgs = $root.pg_query.ObjectWithArgs.fromObject(object.ObjectWithArgs); + } + if (object.AccessPriv != null) { + if (typeof object.AccessPriv !== "object") + throw TypeError(".pg_query.Node.AccessPriv: object expected"); + message.AccessPriv = $root.pg_query.AccessPriv.fromObject(object.AccessPriv); + } + if (object.CreateOpClassItem != null) { + if (typeof object.CreateOpClassItem !== "object") + throw TypeError(".pg_query.Node.CreateOpClassItem: object expected"); + message.CreateOpClassItem = $root.pg_query.CreateOpClassItem.fromObject(object.CreateOpClassItem); + } + if (object.TableLikeClause != null) { + if (typeof object.TableLikeClause !== "object") + throw TypeError(".pg_query.Node.TableLikeClause: object expected"); + message.TableLikeClause = $root.pg_query.TableLikeClause.fromObject(object.TableLikeClause); + } + if (object.FunctionParameter != null) { + if (typeof object.FunctionParameter !== "object") + throw TypeError(".pg_query.Node.FunctionParameter: object expected"); + message.FunctionParameter = $root.pg_query.FunctionParameter.fromObject(object.FunctionParameter); + } + if (object.LockingClause != null) { + if (typeof object.LockingClause !== "object") + throw TypeError(".pg_query.Node.LockingClause: object expected"); + message.LockingClause = $root.pg_query.LockingClause.fromObject(object.LockingClause); + } + if (object.RowMarkClause != null) { + if (typeof object.RowMarkClause !== "object") + throw TypeError(".pg_query.Node.RowMarkClause: object expected"); + message.RowMarkClause = $root.pg_query.RowMarkClause.fromObject(object.RowMarkClause); + } + if (object.XmlSerialize != null) { + if (typeof object.XmlSerialize !== "object") + throw TypeError(".pg_query.Node.XmlSerialize: object expected"); + message.XmlSerialize = $root.pg_query.XmlSerialize.fromObject(object.XmlSerialize); + } + if (object.WithClause != null) { + if (typeof object.WithClause !== "object") + throw TypeError(".pg_query.Node.WithClause: object expected"); + message.WithClause = $root.pg_query.WithClause.fromObject(object.WithClause); + } + if (object.InferClause != null) { + if (typeof object.InferClause !== "object") + throw TypeError(".pg_query.Node.InferClause: object expected"); + message.InferClause = $root.pg_query.InferClause.fromObject(object.InferClause); + } + if (object.OnConflictClause != null) { + if (typeof object.OnConflictClause !== "object") + throw TypeError(".pg_query.Node.OnConflictClause: object expected"); + message.OnConflictClause = $root.pg_query.OnConflictClause.fromObject(object.OnConflictClause); + } + if (object.CommonTableExpr != null) { + if (typeof object.CommonTableExpr !== "object") + throw TypeError(".pg_query.Node.CommonTableExpr: object expected"); + message.CommonTableExpr = $root.pg_query.CommonTableExpr.fromObject(object.CommonTableExpr); + } + if (object.RoleSpec != null) { + if (typeof object.RoleSpec !== "object") + throw TypeError(".pg_query.Node.RoleSpec: object expected"); + message.RoleSpec = $root.pg_query.RoleSpec.fromObject(object.RoleSpec); + } + if (object.TriggerTransition != null) { + if (typeof object.TriggerTransition !== "object") + throw TypeError(".pg_query.Node.TriggerTransition: object expected"); + message.TriggerTransition = $root.pg_query.TriggerTransition.fromObject(object.TriggerTransition); + } + if (object.PartitionElem != null) { + if (typeof object.PartitionElem !== "object") + throw TypeError(".pg_query.Node.PartitionElem: object expected"); + message.PartitionElem = $root.pg_query.PartitionElem.fromObject(object.PartitionElem); + } + if (object.PartitionSpec != null) { + if (typeof object.PartitionSpec !== "object") + throw TypeError(".pg_query.Node.PartitionSpec: object expected"); + message.PartitionSpec = $root.pg_query.PartitionSpec.fromObject(object.PartitionSpec); + } + if (object.PartitionBoundSpec != null) { + if (typeof object.PartitionBoundSpec !== "object") + throw TypeError(".pg_query.Node.PartitionBoundSpec: object expected"); + message.PartitionBoundSpec = $root.pg_query.PartitionBoundSpec.fromObject(object.PartitionBoundSpec); + } + if (object.PartitionRangeDatum != null) { + if (typeof object.PartitionRangeDatum !== "object") + throw TypeError(".pg_query.Node.PartitionRangeDatum: object expected"); + message.PartitionRangeDatum = $root.pg_query.PartitionRangeDatum.fromObject(object.PartitionRangeDatum); + } + if (object.PartitionCmd != null) { + if (typeof object.PartitionCmd !== "object") + throw TypeError(".pg_query.Node.PartitionCmd: object expected"); + message.PartitionCmd = $root.pg_query.PartitionCmd.fromObject(object.PartitionCmd); + } + if (object.VacuumRelation != null) { + if (typeof object.VacuumRelation !== "object") + throw TypeError(".pg_query.Node.VacuumRelation: object expected"); + message.VacuumRelation = $root.pg_query.VacuumRelation.fromObject(object.VacuumRelation); + } + if (object.InlineCodeBlock != null) { + if (typeof object.InlineCodeBlock !== "object") + throw TypeError(".pg_query.Node.InlineCodeBlock: object expected"); + message.InlineCodeBlock = $root.pg_query.InlineCodeBlock.fromObject(object.InlineCodeBlock); + } + if (object.CallContext != null) { + if (typeof object.CallContext !== "object") + throw TypeError(".pg_query.Node.CallContext: object expected"); + message.CallContext = $root.pg_query.CallContext.fromObject(object.CallContext); + } + if (object.Integer != null) { + if (typeof object.Integer !== "object") + throw TypeError(".pg_query.Node.Integer: object expected"); + message.Integer = $root.pg_query.Integer.fromObject(object.Integer); + } + if (object.Float != null) { + if (typeof object.Float !== "object") + throw TypeError(".pg_query.Node.Float: object expected"); + message.Float = $root.pg_query.Float.fromObject(object.Float); + } + if (object.String != null) { + if (typeof object.String !== "object") + throw TypeError(".pg_query.Node.String: object expected"); + message.String = $root.pg_query.String.fromObject(object.String); + } + if (object.BitString != null) { + if (typeof object.BitString !== "object") + throw TypeError(".pg_query.Node.BitString: object expected"); + message.BitString = $root.pg_query.BitString.fromObject(object.BitString); + } + if (object.Null != null) { + if (typeof object.Null !== "object") + throw TypeError(".pg_query.Node.Null: object expected"); + message.Null = $root.pg_query.Null.fromObject(object.Null); + } + if (object.List != null) { + if (typeof object.List !== "object") + throw TypeError(".pg_query.Node.List: object expected"); + message.List = $root.pg_query.List.fromObject(object.List); + } + if (object.IntList != null) { + if (typeof object.IntList !== "object") + throw TypeError(".pg_query.Node.IntList: object expected"); + message.IntList = $root.pg_query.IntList.fromObject(object.IntList); + } + if (object.OidList != null) { + if (typeof object.OidList !== "object") + throw TypeError(".pg_query.Node.OidList: object expected"); + message.OidList = $root.pg_query.OidList.fromObject(object.OidList); + } + return message; + }; + + /** + * Creates a plain object from a Node message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.Node + * @static + * @param {pg_query.Node} message Node + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Node.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.Alias != null && message.hasOwnProperty("Alias")) { + object.Alias = $root.pg_query.Alias.toObject(message.Alias, options); + if (options.oneofs) + object.node = "Alias"; + } + if (message.RangeVar != null && message.hasOwnProperty("RangeVar")) { + object.RangeVar = $root.pg_query.RangeVar.toObject(message.RangeVar, options); + if (options.oneofs) + object.node = "RangeVar"; + } + if (message.TableFunc != null && message.hasOwnProperty("TableFunc")) { + object.TableFunc = $root.pg_query.TableFunc.toObject(message.TableFunc, options); + if (options.oneofs) + object.node = "TableFunc"; + } + if (message.Expr != null && message.hasOwnProperty("Expr")) { + object.Expr = $root.pg_query.Expr.toObject(message.Expr, options); + if (options.oneofs) + object.node = "Expr"; + } + if (message.Var != null && message.hasOwnProperty("Var")) { + object.Var = $root.pg_query.Var.toObject(message.Var, options); + if (options.oneofs) + object.node = "Var"; + } + if (message.Param != null && message.hasOwnProperty("Param")) { + object.Param = $root.pg_query.Param.toObject(message.Param, options); + if (options.oneofs) + object.node = "Param"; + } + if (message.Aggref != null && message.hasOwnProperty("Aggref")) { + object.Aggref = $root.pg_query.Aggref.toObject(message.Aggref, options); + if (options.oneofs) + object.node = "Aggref"; + } + if (message.GroupingFunc != null && message.hasOwnProperty("GroupingFunc")) { + object.GroupingFunc = $root.pg_query.GroupingFunc.toObject(message.GroupingFunc, options); + if (options.oneofs) + object.node = "GroupingFunc"; + } + if (message.WindowFunc != null && message.hasOwnProperty("WindowFunc")) { + object.WindowFunc = $root.pg_query.WindowFunc.toObject(message.WindowFunc, options); + if (options.oneofs) + object.node = "WindowFunc"; + } + if (message.SubscriptingRef != null && message.hasOwnProperty("SubscriptingRef")) { + object.SubscriptingRef = $root.pg_query.SubscriptingRef.toObject(message.SubscriptingRef, options); + if (options.oneofs) + object.node = "SubscriptingRef"; + } + if (message.FuncExpr != null && message.hasOwnProperty("FuncExpr")) { + object.FuncExpr = $root.pg_query.FuncExpr.toObject(message.FuncExpr, options); + if (options.oneofs) + object.node = "FuncExpr"; + } + if (message.NamedArgExpr != null && message.hasOwnProperty("NamedArgExpr")) { + object.NamedArgExpr = $root.pg_query.NamedArgExpr.toObject(message.NamedArgExpr, options); + if (options.oneofs) + object.node = "NamedArgExpr"; + } + if (message.OpExpr != null && message.hasOwnProperty("OpExpr")) { + object.OpExpr = $root.pg_query.OpExpr.toObject(message.OpExpr, options); + if (options.oneofs) + object.node = "OpExpr"; + } + if (message.DistinctExpr != null && message.hasOwnProperty("DistinctExpr")) { + object.DistinctExpr = $root.pg_query.DistinctExpr.toObject(message.DistinctExpr, options); + if (options.oneofs) + object.node = "DistinctExpr"; + } + if (message.NullIfExpr != null && message.hasOwnProperty("NullIfExpr")) { + object.NullIfExpr = $root.pg_query.NullIfExpr.toObject(message.NullIfExpr, options); + if (options.oneofs) + object.node = "NullIfExpr"; + } + if (message.ScalarArrayOpExpr != null && message.hasOwnProperty("ScalarArrayOpExpr")) { + object.ScalarArrayOpExpr = $root.pg_query.ScalarArrayOpExpr.toObject(message.ScalarArrayOpExpr, options); + if (options.oneofs) + object.node = "ScalarArrayOpExpr"; + } + if (message.BoolExpr != null && message.hasOwnProperty("BoolExpr")) { + object.BoolExpr = $root.pg_query.BoolExpr.toObject(message.BoolExpr, options); + if (options.oneofs) + object.node = "BoolExpr"; + } + if (message.SubLink != null && message.hasOwnProperty("SubLink")) { + object.SubLink = $root.pg_query.SubLink.toObject(message.SubLink, options); + if (options.oneofs) + object.node = "SubLink"; + } + if (message.SubPlan != null && message.hasOwnProperty("SubPlan")) { + object.SubPlan = $root.pg_query.SubPlan.toObject(message.SubPlan, options); + if (options.oneofs) + object.node = "SubPlan"; + } + if (message.AlternativeSubPlan != null && message.hasOwnProperty("AlternativeSubPlan")) { + object.AlternativeSubPlan = $root.pg_query.AlternativeSubPlan.toObject(message.AlternativeSubPlan, options); + if (options.oneofs) + object.node = "AlternativeSubPlan"; + } + if (message.FieldSelect != null && message.hasOwnProperty("FieldSelect")) { + object.FieldSelect = $root.pg_query.FieldSelect.toObject(message.FieldSelect, options); + if (options.oneofs) + object.node = "FieldSelect"; + } + if (message.FieldStore != null && message.hasOwnProperty("FieldStore")) { + object.FieldStore = $root.pg_query.FieldStore.toObject(message.FieldStore, options); + if (options.oneofs) + object.node = "FieldStore"; + } + if (message.RelabelType != null && message.hasOwnProperty("RelabelType")) { + object.RelabelType = $root.pg_query.RelabelType.toObject(message.RelabelType, options); + if (options.oneofs) + object.node = "RelabelType"; + } + if (message.CoerceViaIO != null && message.hasOwnProperty("CoerceViaIO")) { + object.CoerceViaIO = $root.pg_query.CoerceViaIO.toObject(message.CoerceViaIO, options); + if (options.oneofs) + object.node = "CoerceViaIO"; + } + if (message.ArrayCoerceExpr != null && message.hasOwnProperty("ArrayCoerceExpr")) { + object.ArrayCoerceExpr = $root.pg_query.ArrayCoerceExpr.toObject(message.ArrayCoerceExpr, options); + if (options.oneofs) + object.node = "ArrayCoerceExpr"; + } + if (message.ConvertRowtypeExpr != null && message.hasOwnProperty("ConvertRowtypeExpr")) { + object.ConvertRowtypeExpr = $root.pg_query.ConvertRowtypeExpr.toObject(message.ConvertRowtypeExpr, options); + if (options.oneofs) + object.node = "ConvertRowtypeExpr"; + } + if (message.CollateExpr != null && message.hasOwnProperty("CollateExpr")) { + object.CollateExpr = $root.pg_query.CollateExpr.toObject(message.CollateExpr, options); + if (options.oneofs) + object.node = "CollateExpr"; + } + if (message.CaseExpr != null && message.hasOwnProperty("CaseExpr")) { + object.CaseExpr = $root.pg_query.CaseExpr.toObject(message.CaseExpr, options); + if (options.oneofs) + object.node = "CaseExpr"; + } + if (message.CaseWhen != null && message.hasOwnProperty("CaseWhen")) { + object.CaseWhen = $root.pg_query.CaseWhen.toObject(message.CaseWhen, options); + if (options.oneofs) + object.node = "CaseWhen"; + } + if (message.CaseTestExpr != null && message.hasOwnProperty("CaseTestExpr")) { + object.CaseTestExpr = $root.pg_query.CaseTestExpr.toObject(message.CaseTestExpr, options); + if (options.oneofs) + object.node = "CaseTestExpr"; + } + if (message.ArrayExpr != null && message.hasOwnProperty("ArrayExpr")) { + object.ArrayExpr = $root.pg_query.ArrayExpr.toObject(message.ArrayExpr, options); + if (options.oneofs) + object.node = "ArrayExpr"; + } + if (message.RowExpr != null && message.hasOwnProperty("RowExpr")) { + object.RowExpr = $root.pg_query.RowExpr.toObject(message.RowExpr, options); + if (options.oneofs) + object.node = "RowExpr"; + } + if (message.RowCompareExpr != null && message.hasOwnProperty("RowCompareExpr")) { + object.RowCompareExpr = $root.pg_query.RowCompareExpr.toObject(message.RowCompareExpr, options); + if (options.oneofs) + object.node = "RowCompareExpr"; + } + if (message.CoalesceExpr != null && message.hasOwnProperty("CoalesceExpr")) { + object.CoalesceExpr = $root.pg_query.CoalesceExpr.toObject(message.CoalesceExpr, options); + if (options.oneofs) + object.node = "CoalesceExpr"; + } + if (message.MinMaxExpr != null && message.hasOwnProperty("MinMaxExpr")) { + object.MinMaxExpr = $root.pg_query.MinMaxExpr.toObject(message.MinMaxExpr, options); + if (options.oneofs) + object.node = "MinMaxExpr"; + } + if (message.SQLValueFunction != null && message.hasOwnProperty("SQLValueFunction")) { + object.SQLValueFunction = $root.pg_query.SQLValueFunction.toObject(message.SQLValueFunction, options); + if (options.oneofs) + object.node = "SQLValueFunction"; + } + if (message.XmlExpr != null && message.hasOwnProperty("XmlExpr")) { + object.XmlExpr = $root.pg_query.XmlExpr.toObject(message.XmlExpr, options); + if (options.oneofs) + object.node = "XmlExpr"; + } + if (message.NullTest != null && message.hasOwnProperty("NullTest")) { + object.NullTest = $root.pg_query.NullTest.toObject(message.NullTest, options); + if (options.oneofs) + object.node = "NullTest"; + } + if (message.BooleanTest != null && message.hasOwnProperty("BooleanTest")) { + object.BooleanTest = $root.pg_query.BooleanTest.toObject(message.BooleanTest, options); + if (options.oneofs) + object.node = "BooleanTest"; + } + if (message.CoerceToDomain != null && message.hasOwnProperty("CoerceToDomain")) { + object.CoerceToDomain = $root.pg_query.CoerceToDomain.toObject(message.CoerceToDomain, options); + if (options.oneofs) + object.node = "CoerceToDomain"; + } + if (message.CoerceToDomainValue != null && message.hasOwnProperty("CoerceToDomainValue")) { + object.CoerceToDomainValue = $root.pg_query.CoerceToDomainValue.toObject(message.CoerceToDomainValue, options); + if (options.oneofs) + object.node = "CoerceToDomainValue"; + } + if (message.SetToDefault != null && message.hasOwnProperty("SetToDefault")) { + object.SetToDefault = $root.pg_query.SetToDefault.toObject(message.SetToDefault, options); + if (options.oneofs) + object.node = "SetToDefault"; + } + if (message.CurrentOfExpr != null && message.hasOwnProperty("CurrentOfExpr")) { + object.CurrentOfExpr = $root.pg_query.CurrentOfExpr.toObject(message.CurrentOfExpr, options); + if (options.oneofs) + object.node = "CurrentOfExpr"; + } + if (message.NextValueExpr != null && message.hasOwnProperty("NextValueExpr")) { + object.NextValueExpr = $root.pg_query.NextValueExpr.toObject(message.NextValueExpr, options); + if (options.oneofs) + object.node = "NextValueExpr"; + } + if (message.InferenceElem != null && message.hasOwnProperty("InferenceElem")) { + object.InferenceElem = $root.pg_query.InferenceElem.toObject(message.InferenceElem, options); + if (options.oneofs) + object.node = "InferenceElem"; + } + if (message.TargetEntry != null && message.hasOwnProperty("TargetEntry")) { + object.TargetEntry = $root.pg_query.TargetEntry.toObject(message.TargetEntry, options); + if (options.oneofs) + object.node = "TargetEntry"; + } + if (message.RangeTblRef != null && message.hasOwnProperty("RangeTblRef")) { + object.RangeTblRef = $root.pg_query.RangeTblRef.toObject(message.RangeTblRef, options); + if (options.oneofs) + object.node = "RangeTblRef"; + } + if (message.JoinExpr != null && message.hasOwnProperty("JoinExpr")) { + object.JoinExpr = $root.pg_query.JoinExpr.toObject(message.JoinExpr, options); + if (options.oneofs) + object.node = "JoinExpr"; + } + if (message.FromExpr != null && message.hasOwnProperty("FromExpr")) { + object.FromExpr = $root.pg_query.FromExpr.toObject(message.FromExpr, options); + if (options.oneofs) + object.node = "FromExpr"; + } + if (message.OnConflictExpr != null && message.hasOwnProperty("OnConflictExpr")) { + object.OnConflictExpr = $root.pg_query.OnConflictExpr.toObject(message.OnConflictExpr, options); + if (options.oneofs) + object.node = "OnConflictExpr"; + } + if (message.IntoClause != null && message.hasOwnProperty("IntoClause")) { + object.IntoClause = $root.pg_query.IntoClause.toObject(message.IntoClause, options); + if (options.oneofs) + object.node = "IntoClause"; + } + if (message.RawStmt != null && message.hasOwnProperty("RawStmt")) { + object.RawStmt = $root.pg_query.RawStmt.toObject(message.RawStmt, options); + if (options.oneofs) + object.node = "RawStmt"; + } + if (message.Query != null && message.hasOwnProperty("Query")) { + object.Query = $root.pg_query.Query.toObject(message.Query, options); + if (options.oneofs) + object.node = "Query"; + } + if (message.InsertStmt != null && message.hasOwnProperty("InsertStmt")) { + object.InsertStmt = $root.pg_query.InsertStmt.toObject(message.InsertStmt, options); + if (options.oneofs) + object.node = "InsertStmt"; + } + if (message.DeleteStmt != null && message.hasOwnProperty("DeleteStmt")) { + object.DeleteStmt = $root.pg_query.DeleteStmt.toObject(message.DeleteStmt, options); + if (options.oneofs) + object.node = "DeleteStmt"; + } + if (message.UpdateStmt != null && message.hasOwnProperty("UpdateStmt")) { + object.UpdateStmt = $root.pg_query.UpdateStmt.toObject(message.UpdateStmt, options); + if (options.oneofs) + object.node = "UpdateStmt"; + } + if (message.SelectStmt != null && message.hasOwnProperty("SelectStmt")) { + object.SelectStmt = $root.pg_query.SelectStmt.toObject(message.SelectStmt, options); + if (options.oneofs) + object.node = "SelectStmt"; + } + if (message.AlterTableStmt != null && message.hasOwnProperty("AlterTableStmt")) { + object.AlterTableStmt = $root.pg_query.AlterTableStmt.toObject(message.AlterTableStmt, options); + if (options.oneofs) + object.node = "AlterTableStmt"; + } + if (message.AlterTableCmd != null && message.hasOwnProperty("AlterTableCmd")) { + object.AlterTableCmd = $root.pg_query.AlterTableCmd.toObject(message.AlterTableCmd, options); + if (options.oneofs) + object.node = "AlterTableCmd"; + } + if (message.AlterDomainStmt != null && message.hasOwnProperty("AlterDomainStmt")) { + object.AlterDomainStmt = $root.pg_query.AlterDomainStmt.toObject(message.AlterDomainStmt, options); + if (options.oneofs) + object.node = "AlterDomainStmt"; + } + if (message.SetOperationStmt != null && message.hasOwnProperty("SetOperationStmt")) { + object.SetOperationStmt = $root.pg_query.SetOperationStmt.toObject(message.SetOperationStmt, options); + if (options.oneofs) + object.node = "SetOperationStmt"; + } + if (message.GrantStmt != null && message.hasOwnProperty("GrantStmt")) { + object.GrantStmt = $root.pg_query.GrantStmt.toObject(message.GrantStmt, options); + if (options.oneofs) + object.node = "GrantStmt"; + } + if (message.GrantRoleStmt != null && message.hasOwnProperty("GrantRoleStmt")) { + object.GrantRoleStmt = $root.pg_query.GrantRoleStmt.toObject(message.GrantRoleStmt, options); + if (options.oneofs) + object.node = "GrantRoleStmt"; + } + if (message.AlterDefaultPrivilegesStmt != null && message.hasOwnProperty("AlterDefaultPrivilegesStmt")) { + object.AlterDefaultPrivilegesStmt = $root.pg_query.AlterDefaultPrivilegesStmt.toObject(message.AlterDefaultPrivilegesStmt, options); + if (options.oneofs) + object.node = "AlterDefaultPrivilegesStmt"; + } + if (message.ClosePortalStmt != null && message.hasOwnProperty("ClosePortalStmt")) { + object.ClosePortalStmt = $root.pg_query.ClosePortalStmt.toObject(message.ClosePortalStmt, options); + if (options.oneofs) + object.node = "ClosePortalStmt"; + } + if (message.ClusterStmt != null && message.hasOwnProperty("ClusterStmt")) { + object.ClusterStmt = $root.pg_query.ClusterStmt.toObject(message.ClusterStmt, options); + if (options.oneofs) + object.node = "ClusterStmt"; + } + if (message.CopyStmt != null && message.hasOwnProperty("CopyStmt")) { + object.CopyStmt = $root.pg_query.CopyStmt.toObject(message.CopyStmt, options); + if (options.oneofs) + object.node = "CopyStmt"; + } + if (message.CreateStmt != null && message.hasOwnProperty("CreateStmt")) { + object.CreateStmt = $root.pg_query.CreateStmt.toObject(message.CreateStmt, options); + if (options.oneofs) + object.node = "CreateStmt"; + } + if (message.DefineStmt != null && message.hasOwnProperty("DefineStmt")) { + object.DefineStmt = $root.pg_query.DefineStmt.toObject(message.DefineStmt, options); + if (options.oneofs) + object.node = "DefineStmt"; + } + if (message.DropStmt != null && message.hasOwnProperty("DropStmt")) { + object.DropStmt = $root.pg_query.DropStmt.toObject(message.DropStmt, options); + if (options.oneofs) + object.node = "DropStmt"; + } + if (message.TruncateStmt != null && message.hasOwnProperty("TruncateStmt")) { + object.TruncateStmt = $root.pg_query.TruncateStmt.toObject(message.TruncateStmt, options); + if (options.oneofs) + object.node = "TruncateStmt"; + } + if (message.CommentStmt != null && message.hasOwnProperty("CommentStmt")) { + object.CommentStmt = $root.pg_query.CommentStmt.toObject(message.CommentStmt, options); + if (options.oneofs) + object.node = "CommentStmt"; + } + if (message.FetchStmt != null && message.hasOwnProperty("FetchStmt")) { + object.FetchStmt = $root.pg_query.FetchStmt.toObject(message.FetchStmt, options); + if (options.oneofs) + object.node = "FetchStmt"; + } + if (message.IndexStmt != null && message.hasOwnProperty("IndexStmt")) { + object.IndexStmt = $root.pg_query.IndexStmt.toObject(message.IndexStmt, options); + if (options.oneofs) + object.node = "IndexStmt"; + } + if (message.CreateFunctionStmt != null && message.hasOwnProperty("CreateFunctionStmt")) { + object.CreateFunctionStmt = $root.pg_query.CreateFunctionStmt.toObject(message.CreateFunctionStmt, options); + if (options.oneofs) + object.node = "CreateFunctionStmt"; + } + if (message.AlterFunctionStmt != null && message.hasOwnProperty("AlterFunctionStmt")) { + object.AlterFunctionStmt = $root.pg_query.AlterFunctionStmt.toObject(message.AlterFunctionStmt, options); + if (options.oneofs) + object.node = "AlterFunctionStmt"; + } + if (message.DoStmt != null && message.hasOwnProperty("DoStmt")) { + object.DoStmt = $root.pg_query.DoStmt.toObject(message.DoStmt, options); + if (options.oneofs) + object.node = "DoStmt"; + } + if (message.RenameStmt != null && message.hasOwnProperty("RenameStmt")) { + object.RenameStmt = $root.pg_query.RenameStmt.toObject(message.RenameStmt, options); + if (options.oneofs) + object.node = "RenameStmt"; + } + if (message.RuleStmt != null && message.hasOwnProperty("RuleStmt")) { + object.RuleStmt = $root.pg_query.RuleStmt.toObject(message.RuleStmt, options); + if (options.oneofs) + object.node = "RuleStmt"; + } + if (message.NotifyStmt != null && message.hasOwnProperty("NotifyStmt")) { + object.NotifyStmt = $root.pg_query.NotifyStmt.toObject(message.NotifyStmt, options); + if (options.oneofs) + object.node = "NotifyStmt"; + } + if (message.ListenStmt != null && message.hasOwnProperty("ListenStmt")) { + object.ListenStmt = $root.pg_query.ListenStmt.toObject(message.ListenStmt, options); + if (options.oneofs) + object.node = "ListenStmt"; + } + if (message.UnlistenStmt != null && message.hasOwnProperty("UnlistenStmt")) { + object.UnlistenStmt = $root.pg_query.UnlistenStmt.toObject(message.UnlistenStmt, options); + if (options.oneofs) + object.node = "UnlistenStmt"; + } + if (message.TransactionStmt != null && message.hasOwnProperty("TransactionStmt")) { + object.TransactionStmt = $root.pg_query.TransactionStmt.toObject(message.TransactionStmt, options); + if (options.oneofs) + object.node = "TransactionStmt"; + } + if (message.ViewStmt != null && message.hasOwnProperty("ViewStmt")) { + object.ViewStmt = $root.pg_query.ViewStmt.toObject(message.ViewStmt, options); + if (options.oneofs) + object.node = "ViewStmt"; + } + if (message.LoadStmt != null && message.hasOwnProperty("LoadStmt")) { + object.LoadStmt = $root.pg_query.LoadStmt.toObject(message.LoadStmt, options); + if (options.oneofs) + object.node = "LoadStmt"; + } + if (message.CreateDomainStmt != null && message.hasOwnProperty("CreateDomainStmt")) { + object.CreateDomainStmt = $root.pg_query.CreateDomainStmt.toObject(message.CreateDomainStmt, options); + if (options.oneofs) + object.node = "CreateDomainStmt"; + } + if (message.CreatedbStmt != null && message.hasOwnProperty("CreatedbStmt")) { + object.CreatedbStmt = $root.pg_query.CreatedbStmt.toObject(message.CreatedbStmt, options); + if (options.oneofs) + object.node = "CreatedbStmt"; + } + if (message.DropdbStmt != null && message.hasOwnProperty("DropdbStmt")) { + object.DropdbStmt = $root.pg_query.DropdbStmt.toObject(message.DropdbStmt, options); + if (options.oneofs) + object.node = "DropdbStmt"; + } + if (message.VacuumStmt != null && message.hasOwnProperty("VacuumStmt")) { + object.VacuumStmt = $root.pg_query.VacuumStmt.toObject(message.VacuumStmt, options); + if (options.oneofs) + object.node = "VacuumStmt"; + } + if (message.ExplainStmt != null && message.hasOwnProperty("ExplainStmt")) { + object.ExplainStmt = $root.pg_query.ExplainStmt.toObject(message.ExplainStmt, options); + if (options.oneofs) + object.node = "ExplainStmt"; + } + if (message.CreateTableAsStmt != null && message.hasOwnProperty("CreateTableAsStmt")) { + object.CreateTableAsStmt = $root.pg_query.CreateTableAsStmt.toObject(message.CreateTableAsStmt, options); + if (options.oneofs) + object.node = "CreateTableAsStmt"; + } + if (message.CreateSeqStmt != null && message.hasOwnProperty("CreateSeqStmt")) { + object.CreateSeqStmt = $root.pg_query.CreateSeqStmt.toObject(message.CreateSeqStmt, options); + if (options.oneofs) + object.node = "CreateSeqStmt"; + } + if (message.AlterSeqStmt != null && message.hasOwnProperty("AlterSeqStmt")) { + object.AlterSeqStmt = $root.pg_query.AlterSeqStmt.toObject(message.AlterSeqStmt, options); + if (options.oneofs) + object.node = "AlterSeqStmt"; + } + if (message.VariableSetStmt != null && message.hasOwnProperty("VariableSetStmt")) { + object.VariableSetStmt = $root.pg_query.VariableSetStmt.toObject(message.VariableSetStmt, options); + if (options.oneofs) + object.node = "VariableSetStmt"; + } + if (message.VariableShowStmt != null && message.hasOwnProperty("VariableShowStmt")) { + object.VariableShowStmt = $root.pg_query.VariableShowStmt.toObject(message.VariableShowStmt, options); + if (options.oneofs) + object.node = "VariableShowStmt"; + } + if (message.DiscardStmt != null && message.hasOwnProperty("DiscardStmt")) { + object.DiscardStmt = $root.pg_query.DiscardStmt.toObject(message.DiscardStmt, options); + if (options.oneofs) + object.node = "DiscardStmt"; + } + if (message.CreateTrigStmt != null && message.hasOwnProperty("CreateTrigStmt")) { + object.CreateTrigStmt = $root.pg_query.CreateTrigStmt.toObject(message.CreateTrigStmt, options); + if (options.oneofs) + object.node = "CreateTrigStmt"; + } + if (message.CreatePLangStmt != null && message.hasOwnProperty("CreatePLangStmt")) { + object.CreatePLangStmt = $root.pg_query.CreatePLangStmt.toObject(message.CreatePLangStmt, options); + if (options.oneofs) + object.node = "CreatePLangStmt"; + } + if (message.CreateRoleStmt != null && message.hasOwnProperty("CreateRoleStmt")) { + object.CreateRoleStmt = $root.pg_query.CreateRoleStmt.toObject(message.CreateRoleStmt, options); + if (options.oneofs) + object.node = "CreateRoleStmt"; + } + if (message.AlterRoleStmt != null && message.hasOwnProperty("AlterRoleStmt")) { + object.AlterRoleStmt = $root.pg_query.AlterRoleStmt.toObject(message.AlterRoleStmt, options); + if (options.oneofs) + object.node = "AlterRoleStmt"; + } + if (message.DropRoleStmt != null && message.hasOwnProperty("DropRoleStmt")) { + object.DropRoleStmt = $root.pg_query.DropRoleStmt.toObject(message.DropRoleStmt, options); + if (options.oneofs) + object.node = "DropRoleStmt"; + } + if (message.LockStmt != null && message.hasOwnProperty("LockStmt")) { + object.LockStmt = $root.pg_query.LockStmt.toObject(message.LockStmt, options); + if (options.oneofs) + object.node = "LockStmt"; + } + if (message.ConstraintsSetStmt != null && message.hasOwnProperty("ConstraintsSetStmt")) { + object.ConstraintsSetStmt = $root.pg_query.ConstraintsSetStmt.toObject(message.ConstraintsSetStmt, options); + if (options.oneofs) + object.node = "ConstraintsSetStmt"; + } + if (message.ReindexStmt != null && message.hasOwnProperty("ReindexStmt")) { + object.ReindexStmt = $root.pg_query.ReindexStmt.toObject(message.ReindexStmt, options); + if (options.oneofs) + object.node = "ReindexStmt"; + } + if (message.CheckPointStmt != null && message.hasOwnProperty("CheckPointStmt")) { + object.CheckPointStmt = $root.pg_query.CheckPointStmt.toObject(message.CheckPointStmt, options); + if (options.oneofs) + object.node = "CheckPointStmt"; + } + if (message.CreateSchemaStmt != null && message.hasOwnProperty("CreateSchemaStmt")) { + object.CreateSchemaStmt = $root.pg_query.CreateSchemaStmt.toObject(message.CreateSchemaStmt, options); + if (options.oneofs) + object.node = "CreateSchemaStmt"; + } + if (message.AlterDatabaseStmt != null && message.hasOwnProperty("AlterDatabaseStmt")) { + object.AlterDatabaseStmt = $root.pg_query.AlterDatabaseStmt.toObject(message.AlterDatabaseStmt, options); + if (options.oneofs) + object.node = "AlterDatabaseStmt"; + } + if (message.AlterDatabaseSetStmt != null && message.hasOwnProperty("AlterDatabaseSetStmt")) { + object.AlterDatabaseSetStmt = $root.pg_query.AlterDatabaseSetStmt.toObject(message.AlterDatabaseSetStmt, options); + if (options.oneofs) + object.node = "AlterDatabaseSetStmt"; + } + if (message.AlterRoleSetStmt != null && message.hasOwnProperty("AlterRoleSetStmt")) { + object.AlterRoleSetStmt = $root.pg_query.AlterRoleSetStmt.toObject(message.AlterRoleSetStmt, options); + if (options.oneofs) + object.node = "AlterRoleSetStmt"; + } + if (message.CreateConversionStmt != null && message.hasOwnProperty("CreateConversionStmt")) { + object.CreateConversionStmt = $root.pg_query.CreateConversionStmt.toObject(message.CreateConversionStmt, options); + if (options.oneofs) + object.node = "CreateConversionStmt"; + } + if (message.CreateCastStmt != null && message.hasOwnProperty("CreateCastStmt")) { + object.CreateCastStmt = $root.pg_query.CreateCastStmt.toObject(message.CreateCastStmt, options); + if (options.oneofs) + object.node = "CreateCastStmt"; + } + if (message.CreateOpClassStmt != null && message.hasOwnProperty("CreateOpClassStmt")) { + object.CreateOpClassStmt = $root.pg_query.CreateOpClassStmt.toObject(message.CreateOpClassStmt, options); + if (options.oneofs) + object.node = "CreateOpClassStmt"; + } + if (message.CreateOpFamilyStmt != null && message.hasOwnProperty("CreateOpFamilyStmt")) { + object.CreateOpFamilyStmt = $root.pg_query.CreateOpFamilyStmt.toObject(message.CreateOpFamilyStmt, options); + if (options.oneofs) + object.node = "CreateOpFamilyStmt"; + } + if (message.AlterOpFamilyStmt != null && message.hasOwnProperty("AlterOpFamilyStmt")) { + object.AlterOpFamilyStmt = $root.pg_query.AlterOpFamilyStmt.toObject(message.AlterOpFamilyStmt, options); + if (options.oneofs) + object.node = "AlterOpFamilyStmt"; + } + if (message.PrepareStmt != null && message.hasOwnProperty("PrepareStmt")) { + object.PrepareStmt = $root.pg_query.PrepareStmt.toObject(message.PrepareStmt, options); + if (options.oneofs) + object.node = "PrepareStmt"; + } + if (message.ExecuteStmt != null && message.hasOwnProperty("ExecuteStmt")) { + object.ExecuteStmt = $root.pg_query.ExecuteStmt.toObject(message.ExecuteStmt, options); + if (options.oneofs) + object.node = "ExecuteStmt"; + } + if (message.DeallocateStmt != null && message.hasOwnProperty("DeallocateStmt")) { + object.DeallocateStmt = $root.pg_query.DeallocateStmt.toObject(message.DeallocateStmt, options); + if (options.oneofs) + object.node = "DeallocateStmt"; + } + if (message.DeclareCursorStmt != null && message.hasOwnProperty("DeclareCursorStmt")) { + object.DeclareCursorStmt = $root.pg_query.DeclareCursorStmt.toObject(message.DeclareCursorStmt, options); + if (options.oneofs) + object.node = "DeclareCursorStmt"; + } + if (message.CreateTableSpaceStmt != null && message.hasOwnProperty("CreateTableSpaceStmt")) { + object.CreateTableSpaceStmt = $root.pg_query.CreateTableSpaceStmt.toObject(message.CreateTableSpaceStmt, options); + if (options.oneofs) + object.node = "CreateTableSpaceStmt"; + } + if (message.DropTableSpaceStmt != null && message.hasOwnProperty("DropTableSpaceStmt")) { + object.DropTableSpaceStmt = $root.pg_query.DropTableSpaceStmt.toObject(message.DropTableSpaceStmt, options); + if (options.oneofs) + object.node = "DropTableSpaceStmt"; + } + if (message.AlterObjectDependsStmt != null && message.hasOwnProperty("AlterObjectDependsStmt")) { + object.AlterObjectDependsStmt = $root.pg_query.AlterObjectDependsStmt.toObject(message.AlterObjectDependsStmt, options); + if (options.oneofs) + object.node = "AlterObjectDependsStmt"; + } + if (message.AlterObjectSchemaStmt != null && message.hasOwnProperty("AlterObjectSchemaStmt")) { + object.AlterObjectSchemaStmt = $root.pg_query.AlterObjectSchemaStmt.toObject(message.AlterObjectSchemaStmt, options); + if (options.oneofs) + object.node = "AlterObjectSchemaStmt"; + } + if (message.AlterOwnerStmt != null && message.hasOwnProperty("AlterOwnerStmt")) { + object.AlterOwnerStmt = $root.pg_query.AlterOwnerStmt.toObject(message.AlterOwnerStmt, options); + if (options.oneofs) + object.node = "AlterOwnerStmt"; + } + if (message.AlterOperatorStmt != null && message.hasOwnProperty("AlterOperatorStmt")) { + object.AlterOperatorStmt = $root.pg_query.AlterOperatorStmt.toObject(message.AlterOperatorStmt, options); + if (options.oneofs) + object.node = "AlterOperatorStmt"; + } + if (message.AlterTypeStmt != null && message.hasOwnProperty("AlterTypeStmt")) { + object.AlterTypeStmt = $root.pg_query.AlterTypeStmt.toObject(message.AlterTypeStmt, options); + if (options.oneofs) + object.node = "AlterTypeStmt"; + } + if (message.DropOwnedStmt != null && message.hasOwnProperty("DropOwnedStmt")) { + object.DropOwnedStmt = $root.pg_query.DropOwnedStmt.toObject(message.DropOwnedStmt, options); + if (options.oneofs) + object.node = "DropOwnedStmt"; + } + if (message.ReassignOwnedStmt != null && message.hasOwnProperty("ReassignOwnedStmt")) { + object.ReassignOwnedStmt = $root.pg_query.ReassignOwnedStmt.toObject(message.ReassignOwnedStmt, options); + if (options.oneofs) + object.node = "ReassignOwnedStmt"; + } + if (message.CompositeTypeStmt != null && message.hasOwnProperty("CompositeTypeStmt")) { + object.CompositeTypeStmt = $root.pg_query.CompositeTypeStmt.toObject(message.CompositeTypeStmt, options); + if (options.oneofs) + object.node = "CompositeTypeStmt"; + } + if (message.CreateEnumStmt != null && message.hasOwnProperty("CreateEnumStmt")) { + object.CreateEnumStmt = $root.pg_query.CreateEnumStmt.toObject(message.CreateEnumStmt, options); + if (options.oneofs) + object.node = "CreateEnumStmt"; + } + if (message.CreateRangeStmt != null && message.hasOwnProperty("CreateRangeStmt")) { + object.CreateRangeStmt = $root.pg_query.CreateRangeStmt.toObject(message.CreateRangeStmt, options); + if (options.oneofs) + object.node = "CreateRangeStmt"; + } + if (message.AlterEnumStmt != null && message.hasOwnProperty("AlterEnumStmt")) { + object.AlterEnumStmt = $root.pg_query.AlterEnumStmt.toObject(message.AlterEnumStmt, options); + if (options.oneofs) + object.node = "AlterEnumStmt"; + } + if (message.AlterTSDictionaryStmt != null && message.hasOwnProperty("AlterTSDictionaryStmt")) { + object.AlterTSDictionaryStmt = $root.pg_query.AlterTSDictionaryStmt.toObject(message.AlterTSDictionaryStmt, options); + if (options.oneofs) + object.node = "AlterTSDictionaryStmt"; + } + if (message.AlterTSConfigurationStmt != null && message.hasOwnProperty("AlterTSConfigurationStmt")) { + object.AlterTSConfigurationStmt = $root.pg_query.AlterTSConfigurationStmt.toObject(message.AlterTSConfigurationStmt, options); + if (options.oneofs) + object.node = "AlterTSConfigurationStmt"; + } + if (message.CreateFdwStmt != null && message.hasOwnProperty("CreateFdwStmt")) { + object.CreateFdwStmt = $root.pg_query.CreateFdwStmt.toObject(message.CreateFdwStmt, options); + if (options.oneofs) + object.node = "CreateFdwStmt"; + } + if (message.AlterFdwStmt != null && message.hasOwnProperty("AlterFdwStmt")) { + object.AlterFdwStmt = $root.pg_query.AlterFdwStmt.toObject(message.AlterFdwStmt, options); + if (options.oneofs) + object.node = "AlterFdwStmt"; + } + if (message.CreateForeignServerStmt != null && message.hasOwnProperty("CreateForeignServerStmt")) { + object.CreateForeignServerStmt = $root.pg_query.CreateForeignServerStmt.toObject(message.CreateForeignServerStmt, options); + if (options.oneofs) + object.node = "CreateForeignServerStmt"; + } + if (message.AlterForeignServerStmt != null && message.hasOwnProperty("AlterForeignServerStmt")) { + object.AlterForeignServerStmt = $root.pg_query.AlterForeignServerStmt.toObject(message.AlterForeignServerStmt, options); + if (options.oneofs) + object.node = "AlterForeignServerStmt"; + } + if (message.CreateUserMappingStmt != null && message.hasOwnProperty("CreateUserMappingStmt")) { + object.CreateUserMappingStmt = $root.pg_query.CreateUserMappingStmt.toObject(message.CreateUserMappingStmt, options); + if (options.oneofs) + object.node = "CreateUserMappingStmt"; + } + if (message.AlterUserMappingStmt != null && message.hasOwnProperty("AlterUserMappingStmt")) { + object.AlterUserMappingStmt = $root.pg_query.AlterUserMappingStmt.toObject(message.AlterUserMappingStmt, options); + if (options.oneofs) + object.node = "AlterUserMappingStmt"; + } + if (message.DropUserMappingStmt != null && message.hasOwnProperty("DropUserMappingStmt")) { + object.DropUserMappingStmt = $root.pg_query.DropUserMappingStmt.toObject(message.DropUserMappingStmt, options); + if (options.oneofs) + object.node = "DropUserMappingStmt"; + } + if (message.AlterTableSpaceOptionsStmt != null && message.hasOwnProperty("AlterTableSpaceOptionsStmt")) { + object.AlterTableSpaceOptionsStmt = $root.pg_query.AlterTableSpaceOptionsStmt.toObject(message.AlterTableSpaceOptionsStmt, options); + if (options.oneofs) + object.node = "AlterTableSpaceOptionsStmt"; + } + if (message.AlterTableMoveAllStmt != null && message.hasOwnProperty("AlterTableMoveAllStmt")) { + object.AlterTableMoveAllStmt = $root.pg_query.AlterTableMoveAllStmt.toObject(message.AlterTableMoveAllStmt, options); + if (options.oneofs) + object.node = "AlterTableMoveAllStmt"; + } + if (message.SecLabelStmt != null && message.hasOwnProperty("SecLabelStmt")) { + object.SecLabelStmt = $root.pg_query.SecLabelStmt.toObject(message.SecLabelStmt, options); + if (options.oneofs) + object.node = "SecLabelStmt"; + } + if (message.CreateForeignTableStmt != null && message.hasOwnProperty("CreateForeignTableStmt")) { + object.CreateForeignTableStmt = $root.pg_query.CreateForeignTableStmt.toObject(message.CreateForeignTableStmt, options); + if (options.oneofs) + object.node = "CreateForeignTableStmt"; + } + if (message.ImportForeignSchemaStmt != null && message.hasOwnProperty("ImportForeignSchemaStmt")) { + object.ImportForeignSchemaStmt = $root.pg_query.ImportForeignSchemaStmt.toObject(message.ImportForeignSchemaStmt, options); + if (options.oneofs) + object.node = "ImportForeignSchemaStmt"; + } + if (message.CreateExtensionStmt != null && message.hasOwnProperty("CreateExtensionStmt")) { + object.CreateExtensionStmt = $root.pg_query.CreateExtensionStmt.toObject(message.CreateExtensionStmt, options); + if (options.oneofs) + object.node = "CreateExtensionStmt"; + } + if (message.AlterExtensionStmt != null && message.hasOwnProperty("AlterExtensionStmt")) { + object.AlterExtensionStmt = $root.pg_query.AlterExtensionStmt.toObject(message.AlterExtensionStmt, options); + if (options.oneofs) + object.node = "AlterExtensionStmt"; + } + if (message.AlterExtensionContentsStmt != null && message.hasOwnProperty("AlterExtensionContentsStmt")) { + object.AlterExtensionContentsStmt = $root.pg_query.AlterExtensionContentsStmt.toObject(message.AlterExtensionContentsStmt, options); + if (options.oneofs) + object.node = "AlterExtensionContentsStmt"; + } + if (message.CreateEventTrigStmt != null && message.hasOwnProperty("CreateEventTrigStmt")) { + object.CreateEventTrigStmt = $root.pg_query.CreateEventTrigStmt.toObject(message.CreateEventTrigStmt, options); + if (options.oneofs) + object.node = "CreateEventTrigStmt"; + } + if (message.AlterEventTrigStmt != null && message.hasOwnProperty("AlterEventTrigStmt")) { + object.AlterEventTrigStmt = $root.pg_query.AlterEventTrigStmt.toObject(message.AlterEventTrigStmt, options); + if (options.oneofs) + object.node = "AlterEventTrigStmt"; + } + if (message.RefreshMatViewStmt != null && message.hasOwnProperty("RefreshMatViewStmt")) { + object.RefreshMatViewStmt = $root.pg_query.RefreshMatViewStmt.toObject(message.RefreshMatViewStmt, options); + if (options.oneofs) + object.node = "RefreshMatViewStmt"; + } + if (message.ReplicaIdentityStmt != null && message.hasOwnProperty("ReplicaIdentityStmt")) { + object.ReplicaIdentityStmt = $root.pg_query.ReplicaIdentityStmt.toObject(message.ReplicaIdentityStmt, options); + if (options.oneofs) + object.node = "ReplicaIdentityStmt"; + } + if (message.AlterSystemStmt != null && message.hasOwnProperty("AlterSystemStmt")) { + object.AlterSystemStmt = $root.pg_query.AlterSystemStmt.toObject(message.AlterSystemStmt, options); + if (options.oneofs) + object.node = "AlterSystemStmt"; + } + if (message.CreatePolicyStmt != null && message.hasOwnProperty("CreatePolicyStmt")) { + object.CreatePolicyStmt = $root.pg_query.CreatePolicyStmt.toObject(message.CreatePolicyStmt, options); + if (options.oneofs) + object.node = "CreatePolicyStmt"; + } + if (message.AlterPolicyStmt != null && message.hasOwnProperty("AlterPolicyStmt")) { + object.AlterPolicyStmt = $root.pg_query.AlterPolicyStmt.toObject(message.AlterPolicyStmt, options); + if (options.oneofs) + object.node = "AlterPolicyStmt"; + } + if (message.CreateTransformStmt != null && message.hasOwnProperty("CreateTransformStmt")) { + object.CreateTransformStmt = $root.pg_query.CreateTransformStmt.toObject(message.CreateTransformStmt, options); + if (options.oneofs) + object.node = "CreateTransformStmt"; + } + if (message.CreateAmStmt != null && message.hasOwnProperty("CreateAmStmt")) { + object.CreateAmStmt = $root.pg_query.CreateAmStmt.toObject(message.CreateAmStmt, options); + if (options.oneofs) + object.node = "CreateAmStmt"; + } + if (message.CreatePublicationStmt != null && message.hasOwnProperty("CreatePublicationStmt")) { + object.CreatePublicationStmt = $root.pg_query.CreatePublicationStmt.toObject(message.CreatePublicationStmt, options); + if (options.oneofs) + object.node = "CreatePublicationStmt"; + } + if (message.AlterPublicationStmt != null && message.hasOwnProperty("AlterPublicationStmt")) { + object.AlterPublicationStmt = $root.pg_query.AlterPublicationStmt.toObject(message.AlterPublicationStmt, options); + if (options.oneofs) + object.node = "AlterPublicationStmt"; + } + if (message.CreateSubscriptionStmt != null && message.hasOwnProperty("CreateSubscriptionStmt")) { + object.CreateSubscriptionStmt = $root.pg_query.CreateSubscriptionStmt.toObject(message.CreateSubscriptionStmt, options); + if (options.oneofs) + object.node = "CreateSubscriptionStmt"; + } + if (message.AlterSubscriptionStmt != null && message.hasOwnProperty("AlterSubscriptionStmt")) { + object.AlterSubscriptionStmt = $root.pg_query.AlterSubscriptionStmt.toObject(message.AlterSubscriptionStmt, options); + if (options.oneofs) + object.node = "AlterSubscriptionStmt"; + } + if (message.DropSubscriptionStmt != null && message.hasOwnProperty("DropSubscriptionStmt")) { + object.DropSubscriptionStmt = $root.pg_query.DropSubscriptionStmt.toObject(message.DropSubscriptionStmt, options); + if (options.oneofs) + object.node = "DropSubscriptionStmt"; + } + if (message.CreateStatsStmt != null && message.hasOwnProperty("CreateStatsStmt")) { + object.CreateStatsStmt = $root.pg_query.CreateStatsStmt.toObject(message.CreateStatsStmt, options); + if (options.oneofs) + object.node = "CreateStatsStmt"; + } + if (message.AlterCollationStmt != null && message.hasOwnProperty("AlterCollationStmt")) { + object.AlterCollationStmt = $root.pg_query.AlterCollationStmt.toObject(message.AlterCollationStmt, options); + if (options.oneofs) + object.node = "AlterCollationStmt"; + } + if (message.CallStmt != null && message.hasOwnProperty("CallStmt")) { + object.CallStmt = $root.pg_query.CallStmt.toObject(message.CallStmt, options); + if (options.oneofs) + object.node = "CallStmt"; + } + if (message.AlterStatsStmt != null && message.hasOwnProperty("AlterStatsStmt")) { + object.AlterStatsStmt = $root.pg_query.AlterStatsStmt.toObject(message.AlterStatsStmt, options); + if (options.oneofs) + object.node = "AlterStatsStmt"; + } + if (message.A_Expr != null && message.hasOwnProperty("A_Expr")) { + object.A_Expr = $root.pg_query.A_Expr.toObject(message.A_Expr, options); + if (options.oneofs) + object.node = "A_Expr"; + } + if (message.ColumnRef != null && message.hasOwnProperty("ColumnRef")) { + object.ColumnRef = $root.pg_query.ColumnRef.toObject(message.ColumnRef, options); + if (options.oneofs) + object.node = "ColumnRef"; + } + if (message.ParamRef != null && message.hasOwnProperty("ParamRef")) { + object.ParamRef = $root.pg_query.ParamRef.toObject(message.ParamRef, options); + if (options.oneofs) + object.node = "ParamRef"; + } + if (message.A_Const != null && message.hasOwnProperty("A_Const")) { + object.A_Const = $root.pg_query.A_Const.toObject(message.A_Const, options); + if (options.oneofs) + object.node = "A_Const"; + } + if (message.FuncCall != null && message.hasOwnProperty("FuncCall")) { + object.FuncCall = $root.pg_query.FuncCall.toObject(message.FuncCall, options); + if (options.oneofs) + object.node = "FuncCall"; + } + if (message.A_Star != null && message.hasOwnProperty("A_Star")) { + object.A_Star = $root.pg_query.A_Star.toObject(message.A_Star, options); + if (options.oneofs) + object.node = "A_Star"; + } + if (message.A_Indices != null && message.hasOwnProperty("A_Indices")) { + object.A_Indices = $root.pg_query.A_Indices.toObject(message.A_Indices, options); + if (options.oneofs) + object.node = "A_Indices"; + } + if (message.A_Indirection != null && message.hasOwnProperty("A_Indirection")) { + object.A_Indirection = $root.pg_query.A_Indirection.toObject(message.A_Indirection, options); + if (options.oneofs) + object.node = "A_Indirection"; + } + if (message.A_ArrayExpr != null && message.hasOwnProperty("A_ArrayExpr")) { + object.A_ArrayExpr = $root.pg_query.A_ArrayExpr.toObject(message.A_ArrayExpr, options); + if (options.oneofs) + object.node = "A_ArrayExpr"; + } + if (message.ResTarget != null && message.hasOwnProperty("ResTarget")) { + object.ResTarget = $root.pg_query.ResTarget.toObject(message.ResTarget, options); + if (options.oneofs) + object.node = "ResTarget"; + } + if (message.MultiAssignRef != null && message.hasOwnProperty("MultiAssignRef")) { + object.MultiAssignRef = $root.pg_query.MultiAssignRef.toObject(message.MultiAssignRef, options); + if (options.oneofs) + object.node = "MultiAssignRef"; + } + if (message.TypeCast != null && message.hasOwnProperty("TypeCast")) { + object.TypeCast = $root.pg_query.TypeCast.toObject(message.TypeCast, options); + if (options.oneofs) + object.node = "TypeCast"; + } + if (message.CollateClause != null && message.hasOwnProperty("CollateClause")) { + object.CollateClause = $root.pg_query.CollateClause.toObject(message.CollateClause, options); + if (options.oneofs) + object.node = "CollateClause"; + } + if (message.SortBy != null && message.hasOwnProperty("SortBy")) { + object.SortBy = $root.pg_query.SortBy.toObject(message.SortBy, options); + if (options.oneofs) + object.node = "SortBy"; + } + if (message.WindowDef != null && message.hasOwnProperty("WindowDef")) { + object.WindowDef = $root.pg_query.WindowDef.toObject(message.WindowDef, options); + if (options.oneofs) + object.node = "WindowDef"; + } + if (message.RangeSubselect != null && message.hasOwnProperty("RangeSubselect")) { + object.RangeSubselect = $root.pg_query.RangeSubselect.toObject(message.RangeSubselect, options); + if (options.oneofs) + object.node = "RangeSubselect"; + } + if (message.RangeFunction != null && message.hasOwnProperty("RangeFunction")) { + object.RangeFunction = $root.pg_query.RangeFunction.toObject(message.RangeFunction, options); + if (options.oneofs) + object.node = "RangeFunction"; + } + if (message.RangeTableSample != null && message.hasOwnProperty("RangeTableSample")) { + object.RangeTableSample = $root.pg_query.RangeTableSample.toObject(message.RangeTableSample, options); + if (options.oneofs) + object.node = "RangeTableSample"; + } + if (message.RangeTableFunc != null && message.hasOwnProperty("RangeTableFunc")) { + object.RangeTableFunc = $root.pg_query.RangeTableFunc.toObject(message.RangeTableFunc, options); + if (options.oneofs) + object.node = "RangeTableFunc"; + } + if (message.RangeTableFuncCol != null && message.hasOwnProperty("RangeTableFuncCol")) { + object.RangeTableFuncCol = $root.pg_query.RangeTableFuncCol.toObject(message.RangeTableFuncCol, options); + if (options.oneofs) + object.node = "RangeTableFuncCol"; + } + if (message.TypeName != null && message.hasOwnProperty("TypeName")) { + object.TypeName = $root.pg_query.TypeName.toObject(message.TypeName, options); + if (options.oneofs) + object.node = "TypeName"; + } + if (message.ColumnDef != null && message.hasOwnProperty("ColumnDef")) { + object.ColumnDef = $root.pg_query.ColumnDef.toObject(message.ColumnDef, options); + if (options.oneofs) + object.node = "ColumnDef"; + } + if (message.IndexElem != null && message.hasOwnProperty("IndexElem")) { + object.IndexElem = $root.pg_query.IndexElem.toObject(message.IndexElem, options); + if (options.oneofs) + object.node = "IndexElem"; + } + if (message.Constraint != null && message.hasOwnProperty("Constraint")) { + object.Constraint = $root.pg_query.Constraint.toObject(message.Constraint, options); + if (options.oneofs) + object.node = "Constraint"; + } + if (message.DefElem != null && message.hasOwnProperty("DefElem")) { + object.DefElem = $root.pg_query.DefElem.toObject(message.DefElem, options); + if (options.oneofs) + object.node = "DefElem"; + } + if (message.RangeTblEntry != null && message.hasOwnProperty("RangeTblEntry")) { + object.RangeTblEntry = $root.pg_query.RangeTblEntry.toObject(message.RangeTblEntry, options); + if (options.oneofs) + object.node = "RangeTblEntry"; + } + if (message.RangeTblFunction != null && message.hasOwnProperty("RangeTblFunction")) { + object.RangeTblFunction = $root.pg_query.RangeTblFunction.toObject(message.RangeTblFunction, options); + if (options.oneofs) + object.node = "RangeTblFunction"; + } + if (message.TableSampleClause != null && message.hasOwnProperty("TableSampleClause")) { + object.TableSampleClause = $root.pg_query.TableSampleClause.toObject(message.TableSampleClause, options); + if (options.oneofs) + object.node = "TableSampleClause"; + } + if (message.WithCheckOption != null && message.hasOwnProperty("WithCheckOption")) { + object.WithCheckOption = $root.pg_query.WithCheckOption.toObject(message.WithCheckOption, options); + if (options.oneofs) + object.node = "WithCheckOption"; + } + if (message.SortGroupClause != null && message.hasOwnProperty("SortGroupClause")) { + object.SortGroupClause = $root.pg_query.SortGroupClause.toObject(message.SortGroupClause, options); + if (options.oneofs) + object.node = "SortGroupClause"; + } + if (message.GroupingSet != null && message.hasOwnProperty("GroupingSet")) { + object.GroupingSet = $root.pg_query.GroupingSet.toObject(message.GroupingSet, options); + if (options.oneofs) + object.node = "GroupingSet"; + } + if (message.WindowClause != null && message.hasOwnProperty("WindowClause")) { + object.WindowClause = $root.pg_query.WindowClause.toObject(message.WindowClause, options); + if (options.oneofs) + object.node = "WindowClause"; + } + if (message.ObjectWithArgs != null && message.hasOwnProperty("ObjectWithArgs")) { + object.ObjectWithArgs = $root.pg_query.ObjectWithArgs.toObject(message.ObjectWithArgs, options); + if (options.oneofs) + object.node = "ObjectWithArgs"; + } + if (message.AccessPriv != null && message.hasOwnProperty("AccessPriv")) { + object.AccessPriv = $root.pg_query.AccessPriv.toObject(message.AccessPriv, options); + if (options.oneofs) + object.node = "AccessPriv"; + } + if (message.CreateOpClassItem != null && message.hasOwnProperty("CreateOpClassItem")) { + object.CreateOpClassItem = $root.pg_query.CreateOpClassItem.toObject(message.CreateOpClassItem, options); + if (options.oneofs) + object.node = "CreateOpClassItem"; + } + if (message.TableLikeClause != null && message.hasOwnProperty("TableLikeClause")) { + object.TableLikeClause = $root.pg_query.TableLikeClause.toObject(message.TableLikeClause, options); + if (options.oneofs) + object.node = "TableLikeClause"; + } + if (message.FunctionParameter != null && message.hasOwnProperty("FunctionParameter")) { + object.FunctionParameter = $root.pg_query.FunctionParameter.toObject(message.FunctionParameter, options); + if (options.oneofs) + object.node = "FunctionParameter"; + } + if (message.LockingClause != null && message.hasOwnProperty("LockingClause")) { + object.LockingClause = $root.pg_query.LockingClause.toObject(message.LockingClause, options); + if (options.oneofs) + object.node = "LockingClause"; + } + if (message.RowMarkClause != null && message.hasOwnProperty("RowMarkClause")) { + object.RowMarkClause = $root.pg_query.RowMarkClause.toObject(message.RowMarkClause, options); + if (options.oneofs) + object.node = "RowMarkClause"; + } + if (message.XmlSerialize != null && message.hasOwnProperty("XmlSerialize")) { + object.XmlSerialize = $root.pg_query.XmlSerialize.toObject(message.XmlSerialize, options); + if (options.oneofs) + object.node = "XmlSerialize"; + } + if (message.WithClause != null && message.hasOwnProperty("WithClause")) { + object.WithClause = $root.pg_query.WithClause.toObject(message.WithClause, options); + if (options.oneofs) + object.node = "WithClause"; + } + if (message.InferClause != null && message.hasOwnProperty("InferClause")) { + object.InferClause = $root.pg_query.InferClause.toObject(message.InferClause, options); + if (options.oneofs) + object.node = "InferClause"; + } + if (message.OnConflictClause != null && message.hasOwnProperty("OnConflictClause")) { + object.OnConflictClause = $root.pg_query.OnConflictClause.toObject(message.OnConflictClause, options); + if (options.oneofs) + object.node = "OnConflictClause"; + } + if (message.CommonTableExpr != null && message.hasOwnProperty("CommonTableExpr")) { + object.CommonTableExpr = $root.pg_query.CommonTableExpr.toObject(message.CommonTableExpr, options); + if (options.oneofs) + object.node = "CommonTableExpr"; + } + if (message.RoleSpec != null && message.hasOwnProperty("RoleSpec")) { + object.RoleSpec = $root.pg_query.RoleSpec.toObject(message.RoleSpec, options); + if (options.oneofs) + object.node = "RoleSpec"; + } + if (message.TriggerTransition != null && message.hasOwnProperty("TriggerTransition")) { + object.TriggerTransition = $root.pg_query.TriggerTransition.toObject(message.TriggerTransition, options); + if (options.oneofs) + object.node = "TriggerTransition"; + } + if (message.PartitionElem != null && message.hasOwnProperty("PartitionElem")) { + object.PartitionElem = $root.pg_query.PartitionElem.toObject(message.PartitionElem, options); + if (options.oneofs) + object.node = "PartitionElem"; + } + if (message.PartitionSpec != null && message.hasOwnProperty("PartitionSpec")) { + object.PartitionSpec = $root.pg_query.PartitionSpec.toObject(message.PartitionSpec, options); + if (options.oneofs) + object.node = "PartitionSpec"; + } + if (message.PartitionBoundSpec != null && message.hasOwnProperty("PartitionBoundSpec")) { + object.PartitionBoundSpec = $root.pg_query.PartitionBoundSpec.toObject(message.PartitionBoundSpec, options); + if (options.oneofs) + object.node = "PartitionBoundSpec"; + } + if (message.PartitionRangeDatum != null && message.hasOwnProperty("PartitionRangeDatum")) { + object.PartitionRangeDatum = $root.pg_query.PartitionRangeDatum.toObject(message.PartitionRangeDatum, options); + if (options.oneofs) + object.node = "PartitionRangeDatum"; + } + if (message.PartitionCmd != null && message.hasOwnProperty("PartitionCmd")) { + object.PartitionCmd = $root.pg_query.PartitionCmd.toObject(message.PartitionCmd, options); + if (options.oneofs) + object.node = "PartitionCmd"; + } + if (message.VacuumRelation != null && message.hasOwnProperty("VacuumRelation")) { + object.VacuumRelation = $root.pg_query.VacuumRelation.toObject(message.VacuumRelation, options); + if (options.oneofs) + object.node = "VacuumRelation"; + } + if (message.InlineCodeBlock != null && message.hasOwnProperty("InlineCodeBlock")) { + object.InlineCodeBlock = $root.pg_query.InlineCodeBlock.toObject(message.InlineCodeBlock, options); + if (options.oneofs) + object.node = "InlineCodeBlock"; + } + if (message.CallContext != null && message.hasOwnProperty("CallContext")) { + object.CallContext = $root.pg_query.CallContext.toObject(message.CallContext, options); + if (options.oneofs) + object.node = "CallContext"; + } + if (message.Integer != null && message.hasOwnProperty("Integer")) { + object.Integer = $root.pg_query.Integer.toObject(message.Integer, options); + if (options.oneofs) + object.node = "Integer"; + } + if (message.Float != null && message.hasOwnProperty("Float")) { + object.Float = $root.pg_query.Float.toObject(message.Float, options); + if (options.oneofs) + object.node = "Float"; + } + if (message.String != null && message.hasOwnProperty("String")) { + object.String = $root.pg_query.String.toObject(message.String, options); + if (options.oneofs) + object.node = "String"; + } + if (message.BitString != null && message.hasOwnProperty("BitString")) { + object.BitString = $root.pg_query.BitString.toObject(message.BitString, options); + if (options.oneofs) + object.node = "BitString"; + } + if (message.Null != null && message.hasOwnProperty("Null")) { + object.Null = $root.pg_query.Null.toObject(message.Null, options); + if (options.oneofs) + object.node = "Null"; + } + if (message.List != null && message.hasOwnProperty("List")) { + object.List = $root.pg_query.List.toObject(message.List, options); + if (options.oneofs) + object.node = "List"; + } + if (message.IntList != null && message.hasOwnProperty("IntList")) { + object.IntList = $root.pg_query.IntList.toObject(message.IntList, options); + if (options.oneofs) + object.node = "IntList"; + } + if (message.OidList != null && message.hasOwnProperty("OidList")) { + object.OidList = $root.pg_query.OidList.toObject(message.OidList, options); + if (options.oneofs) + object.node = "OidList"; + } + return object; + }; + + /** + * Converts this Node to JSON. + * @function toJSON + * @memberof pg_query.Node + * @instance + * @returns {Object.} JSON object + */ + Node.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Node + * @function getTypeUrl + * @memberof pg_query.Node + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Node.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.Node"; + }; + + return Node; + })(); + + pg_query.Integer = (function() { + + /** + * Properties of an Integer. + * @memberof pg_query + * @interface IInteger + * @property {number|null} [ival] Integer ival + */ + + /** + * Constructs a new Integer. + * @memberof pg_query + * @classdesc Represents an Integer. + * @implements IInteger + * @constructor + * @param {pg_query.IInteger=} [properties] Properties to set + */ + function Integer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Integer ival. + * @member {number} ival + * @memberof pg_query.Integer + * @instance + */ + Integer.prototype.ival = 0; + + /** + * Creates a new Integer instance using the specified properties. + * @function create + * @memberof pg_query.Integer + * @static + * @param {pg_query.IInteger=} [properties] Properties to set + * @returns {pg_query.Integer} Integer instance + */ + Integer.create = function create(properties) { + return new Integer(properties); + }; + + /** + * Encodes the specified Integer message. Does not implicitly {@link pg_query.Integer.verify|verify} messages. + * @function encode + * @memberof pg_query.Integer + * @static + * @param {pg_query.IInteger} message Integer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Integer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ival != null && Object.hasOwnProperty.call(message, "ival")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ival); + return writer; + }; + + /** + * Encodes the specified Integer message, length delimited. Does not implicitly {@link pg_query.Integer.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.Integer + * @static + * @param {pg_query.IInteger} message Integer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Integer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Integer message from the specified reader or buffer. + * @function decode + * @memberof pg_query.Integer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.Integer} Integer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Integer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.Integer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ival = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Integer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.Integer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.Integer} Integer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Integer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Integer message. + * @function verify + * @memberof pg_query.Integer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Integer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ival != null && message.hasOwnProperty("ival")) + if (!$util.isInteger(message.ival)) + return "ival: integer expected"; + return null; + }; + + /** + * Creates an Integer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.Integer + * @static + * @param {Object.} object Plain object + * @returns {pg_query.Integer} Integer + */ + Integer.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.Integer) + return object; + var message = new $root.pg_query.Integer(); + if (object.ival != null) + message.ival = object.ival | 0; + return message; + }; + + /** + * Creates a plain object from an Integer message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.Integer + * @static + * @param {pg_query.Integer} message Integer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Integer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.ival = 0; + if (message.ival != null && message.hasOwnProperty("ival")) + object.ival = message.ival; + return object; + }; + + /** + * Converts this Integer to JSON. + * @function toJSON + * @memberof pg_query.Integer + * @instance + * @returns {Object.} JSON object + */ + Integer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Integer + * @function getTypeUrl + * @memberof pg_query.Integer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Integer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.Integer"; + }; + + return Integer; + })(); + + pg_query.Float = (function() { + + /** + * Properties of a Float. + * @memberof pg_query + * @interface IFloat + * @property {string|null} [str] Float str + */ + + /** + * Constructs a new Float. + * @memberof pg_query + * @classdesc Represents a Float. + * @implements IFloat + * @constructor + * @param {pg_query.IFloat=} [properties] Properties to set + */ + function Float(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Float str. + * @member {string} str + * @memberof pg_query.Float + * @instance + */ + Float.prototype.str = ""; + + /** + * Creates a new Float instance using the specified properties. + * @function create + * @memberof pg_query.Float + * @static + * @param {pg_query.IFloat=} [properties] Properties to set + * @returns {pg_query.Float} Float instance + */ + Float.create = function create(properties) { + return new Float(properties); + }; + + /** + * Encodes the specified Float message. Does not implicitly {@link pg_query.Float.verify|verify} messages. + * @function encode + * @memberof pg_query.Float + * @static + * @param {pg_query.IFloat} message Float message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.str != null && Object.hasOwnProperty.call(message, "str")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.str); + return writer; + }; + + /** + * Encodes the specified Float message, length delimited. Does not implicitly {@link pg_query.Float.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.Float + * @static + * @param {pg_query.IFloat} message Float message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Float.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Float message from the specified reader or buffer. + * @function decode + * @memberof pg_query.Float + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.Float} Float + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.Float(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.str = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Float message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.Float + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.Float} Float + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Float.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Float message. + * @function verify + * @memberof pg_query.Float + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Float.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.str != null && message.hasOwnProperty("str")) + if (!$util.isString(message.str)) + return "str: string expected"; + return null; + }; + + /** + * Creates a Float message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.Float + * @static + * @param {Object.} object Plain object + * @returns {pg_query.Float} Float + */ + Float.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.Float) + return object; + var message = new $root.pg_query.Float(); + if (object.str != null) + message.str = String(object.str); + return message; + }; + + /** + * Creates a plain object from a Float message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.Float + * @static + * @param {pg_query.Float} message Float + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Float.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.str = ""; + if (message.str != null && message.hasOwnProperty("str")) + object.str = message.str; + return object; + }; + + /** + * Converts this Float to JSON. + * @function toJSON + * @memberof pg_query.Float + * @instance + * @returns {Object.} JSON object + */ + Float.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Float + * @function getTypeUrl + * @memberof pg_query.Float + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Float.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.Float"; + }; + + return Float; + })(); + + pg_query.String = (function() { + + /** + * Properties of a String. + * @memberof pg_query + * @interface IString + * @property {string|null} [str] String str + */ + + /** + * Constructs a new String. + * @memberof pg_query + * @classdesc Represents a String. + * @implements IString + * @constructor + * @param {pg_query.IString=} [properties] Properties to set + */ + function String(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * String str. + * @member {string} str + * @memberof pg_query.String + * @instance + */ + String.prototype.str = ""; + + /** + * Creates a new String instance using the specified properties. + * @function create + * @memberof pg_query.String + * @static + * @param {pg_query.IString=} [properties] Properties to set + * @returns {pg_query.String} String instance + */ + String.create = function create(properties) { + return new String(properties); + }; + + /** + * Encodes the specified String message. Does not implicitly {@link pg_query.String.verify|verify} messages. + * @function encode + * @memberof pg_query.String + * @static + * @param {pg_query.IString} message String message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + String.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.str != null && Object.hasOwnProperty.call(message, "str")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.str); + return writer; + }; + + /** + * Encodes the specified String message, length delimited. Does not implicitly {@link pg_query.String.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.String + * @static + * @param {pg_query.IString} message String message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + String.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a String message from the specified reader or buffer. + * @function decode + * @memberof pg_query.String + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.String} String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + String.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.String(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.str = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a String message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.String + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.String} String + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + String.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a String message. + * @function verify + * @memberof pg_query.String + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + String.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.str != null && message.hasOwnProperty("str")) + if (!$util.isString(message.str)) + return "str: string expected"; + return null; + }; + + /** + * Creates a String message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.String + * @static + * @param {Object.} object Plain object + * @returns {pg_query.String} String + */ + String.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.String) + return object; + var message = new $root.pg_query.String(); + if (object.str != null) + message.str = String(object.str); + return message; + }; + + /** + * Creates a plain object from a String message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.String + * @static + * @param {pg_query.String} message String + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + String.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.str = ""; + if (message.str != null && message.hasOwnProperty("str")) + object.str = message.str; + return object; + }; + + /** + * Converts this String to JSON. + * @function toJSON + * @memberof pg_query.String + * @instance + * @returns {Object.} JSON object + */ + String.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for String + * @function getTypeUrl + * @memberof pg_query.String + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + String.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.String"; + }; + + return String; + })(); + + pg_query.BitString = (function() { + + /** + * Properties of a BitString. + * @memberof pg_query + * @interface IBitString + * @property {string|null} [str] BitString str + */ + + /** + * Constructs a new BitString. + * @memberof pg_query + * @classdesc Represents a BitString. + * @implements IBitString + * @constructor + * @param {pg_query.IBitString=} [properties] Properties to set + */ + function BitString(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BitString str. + * @member {string} str + * @memberof pg_query.BitString + * @instance + */ + BitString.prototype.str = ""; + + /** + * Creates a new BitString instance using the specified properties. + * @function create + * @memberof pg_query.BitString + * @static + * @param {pg_query.IBitString=} [properties] Properties to set + * @returns {pg_query.BitString} BitString instance + */ + BitString.create = function create(properties) { + return new BitString(properties); + }; + + /** + * Encodes the specified BitString message. Does not implicitly {@link pg_query.BitString.verify|verify} messages. + * @function encode + * @memberof pg_query.BitString + * @static + * @param {pg_query.IBitString} message BitString message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BitString.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.str != null && Object.hasOwnProperty.call(message, "str")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.str); + return writer; + }; + + /** + * Encodes the specified BitString message, length delimited. Does not implicitly {@link pg_query.BitString.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.BitString + * @static + * @param {pg_query.IBitString} message BitString message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BitString.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BitString message from the specified reader or buffer. + * @function decode + * @memberof pg_query.BitString + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.BitString} BitString + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BitString.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.BitString(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.str = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BitString message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.BitString + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.BitString} BitString + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BitString.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BitString message. + * @function verify + * @memberof pg_query.BitString + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BitString.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.str != null && message.hasOwnProperty("str")) + if (!$util.isString(message.str)) + return "str: string expected"; + return null; + }; + + /** + * Creates a BitString message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.BitString + * @static + * @param {Object.} object Plain object + * @returns {pg_query.BitString} BitString + */ + BitString.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.BitString) + return object; + var message = new $root.pg_query.BitString(); + if (object.str != null) + message.str = String(object.str); + return message; + }; + + /** + * Creates a plain object from a BitString message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.BitString + * @static + * @param {pg_query.BitString} message BitString + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BitString.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.str = ""; + if (message.str != null && message.hasOwnProperty("str")) + object.str = message.str; + return object; + }; + + /** + * Converts this BitString to JSON. + * @function toJSON + * @memberof pg_query.BitString + * @instance + * @returns {Object.} JSON object + */ + BitString.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BitString + * @function getTypeUrl + * @memberof pg_query.BitString + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BitString.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.BitString"; + }; + + return BitString; + })(); + + pg_query.Null = (function() { + + /** + * Properties of a Null. + * @memberof pg_query + * @interface INull + */ + + /** + * Constructs a new Null. + * @memberof pg_query + * @classdesc Represents a Null. + * @implements INull + * @constructor + * @param {pg_query.INull=} [properties] Properties to set + */ + function Null(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Null instance using the specified properties. + * @function create + * @memberof pg_query.Null + * @static + * @param {pg_query.INull=} [properties] Properties to set + * @returns {pg_query.Null} Null instance + */ + Null.create = function create(properties) { + return new Null(properties); + }; + + /** + * Encodes the specified Null message. Does not implicitly {@link pg_query.Null.verify|verify} messages. + * @function encode + * @memberof pg_query.Null + * @static + * @param {pg_query.INull} message Null message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Null.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Null message, length delimited. Does not implicitly {@link pg_query.Null.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.Null + * @static + * @param {pg_query.INull} message Null message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Null.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Null message from the specified reader or buffer. + * @function decode + * @memberof pg_query.Null + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.Null} Null + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Null.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.Null(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Null message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.Null + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.Null} Null + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Null.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Null message. + * @function verify + * @memberof pg_query.Null + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Null.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a Null message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.Null + * @static + * @param {Object.} object Plain object + * @returns {pg_query.Null} Null + */ + Null.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.Null) + return object; + return new $root.pg_query.Null(); + }; + + /** + * Creates a plain object from a Null message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.Null + * @static + * @param {pg_query.Null} message Null + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Null.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Null to JSON. + * @function toJSON + * @memberof pg_query.Null + * @instance + * @returns {Object.} JSON object + */ + Null.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Null + * @function getTypeUrl + * @memberof pg_query.Null + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Null.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.Null"; + }; + + return Null; + })(); + + pg_query.List = (function() { + + /** + * Properties of a List. + * @memberof pg_query + * @interface IList + * @property {Array.|null} [items] List items + */ + + /** + * Constructs a new List. + * @memberof pg_query + * @classdesc Represents a List. + * @implements IList + * @constructor + * @param {pg_query.IList=} [properties] Properties to set + */ + function List(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * List items. + * @member {Array.} items + * @memberof pg_query.List + * @instance + */ + List.prototype.items = $util.emptyArray; + + /** + * Creates a new List instance using the specified properties. + * @function create + * @memberof pg_query.List + * @static + * @param {pg_query.IList=} [properties] Properties to set + * @returns {pg_query.List} List instance + */ + List.create = function create(properties) { + return new List(properties); + }; + + /** + * Encodes the specified List message. Does not implicitly {@link pg_query.List.verify|verify} messages. + * @function encode + * @memberof pg_query.List + * @static + * @param {pg_query.IList} message List message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + List.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.pg_query.Node.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified List message, length delimited. Does not implicitly {@link pg_query.List.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.List + * @static + * @param {pg_query.IList} message List message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + List.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a List message from the specified reader or buffer. + * @function decode + * @memberof pg_query.List + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.List} List + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + List.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.List(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a List message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.List + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.List} List + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + List.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a List message. + * @function verify + * @memberof pg_query.List + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + List.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.pg_query.Node.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates a List message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.List + * @static + * @param {Object.} object Plain object + * @returns {pg_query.List} List + */ + List.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.List) + return object; + var message = new $root.pg_query.List(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".pg_query.List.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".pg_query.List.items: object expected"); + message.items[i] = $root.pg_query.Node.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a List message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.List + * @static + * @param {pg_query.List} message List + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + List.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.pg_query.Node.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this List to JSON. + * @function toJSON + * @memberof pg_query.List + * @instance + * @returns {Object.} JSON object + */ + List.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for List + * @function getTypeUrl + * @memberof pg_query.List + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + List.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.List"; + }; + + return List; + })(); + + pg_query.OidList = (function() { + + /** + * Properties of an OidList. + * @memberof pg_query + * @interface IOidList + * @property {Array.|null} [items] OidList items + */ + + /** + * Constructs a new OidList. + * @memberof pg_query + * @classdesc Represents an OidList. + * @implements IOidList + * @constructor + * @param {pg_query.IOidList=} [properties] Properties to set + */ + function OidList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OidList items. + * @member {Array.} items + * @memberof pg_query.OidList + * @instance + */ + OidList.prototype.items = $util.emptyArray; + + /** + * Creates a new OidList instance using the specified properties. + * @function create + * @memberof pg_query.OidList + * @static + * @param {pg_query.IOidList=} [properties] Properties to set + * @returns {pg_query.OidList} OidList instance + */ + OidList.create = function create(properties) { + return new OidList(properties); + }; + + /** + * Encodes the specified OidList message. Does not implicitly {@link pg_query.OidList.verify|verify} messages. + * @function encode + * @memberof pg_query.OidList + * @static + * @param {pg_query.IOidList} message OidList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OidList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.pg_query.Node.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OidList message, length delimited. Does not implicitly {@link pg_query.OidList.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.OidList + * @static + * @param {pg_query.IOidList} message OidList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OidList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OidList message from the specified reader or buffer. + * @function decode + * @memberof pg_query.OidList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.OidList} OidList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OidList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.OidList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OidList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.OidList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.OidList} OidList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OidList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OidList message. + * @function verify + * @memberof pg_query.OidList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OidList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.pg_query.Node.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates an OidList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.OidList + * @static + * @param {Object.} object Plain object + * @returns {pg_query.OidList} OidList + */ + OidList.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.OidList) + return object; + var message = new $root.pg_query.OidList(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".pg_query.OidList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".pg_query.OidList.items: object expected"); + message.items[i] = $root.pg_query.Node.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OidList message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.OidList + * @static + * @param {pg_query.OidList} message OidList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OidList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.pg_query.Node.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this OidList to JSON. + * @function toJSON + * @memberof pg_query.OidList + * @instance + * @returns {Object.} JSON object + */ + OidList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OidList + * @function getTypeUrl + * @memberof pg_query.OidList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OidList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.OidList"; + }; + + return OidList; + })(); + + pg_query.IntList = (function() { + + /** + * Properties of an IntList. + * @memberof pg_query + * @interface IIntList + * @property {Array.|null} [items] IntList items + */ + + /** + * Constructs a new IntList. + * @memberof pg_query + * @classdesc Represents an IntList. + * @implements IIntList + * @constructor + * @param {pg_query.IIntList=} [properties] Properties to set + */ + function IntList(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntList items. + * @member {Array.} items + * @memberof pg_query.IntList + * @instance + */ + IntList.prototype.items = $util.emptyArray; + + /** + * Creates a new IntList instance using the specified properties. + * @function create + * @memberof pg_query.IntList + * @static + * @param {pg_query.IIntList=} [properties] Properties to set + * @returns {pg_query.IntList} IntList instance + */ + IntList.create = function create(properties) { + return new IntList(properties); + }; + + /** + * Encodes the specified IntList message. Does not implicitly {@link pg_query.IntList.verify|verify} messages. + * @function encode + * @memberof pg_query.IntList + * @static + * @param {pg_query.IIntList} message IntList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.pg_query.Node.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntList message, length delimited. Does not implicitly {@link pg_query.IntList.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.IntList + * @static + * @param {pg_query.IIntList} message IntList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntList message from the specified reader or buffer. + * @function decode + * @memberof pg_query.IntList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.IntList} IntList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntList.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.IntList(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.IntList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.IntList} IntList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntList message. + * @function verify + * @memberof pg_query.IntList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.pg_query.Node.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates an IntList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.IntList + * @static + * @param {Object.} object Plain object + * @returns {pg_query.IntList} IntList + */ + IntList.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.IntList) + return object; + var message = new $root.pg_query.IntList(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".pg_query.IntList.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".pg_query.IntList.items: object expected"); + message.items[i] = $root.pg_query.Node.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IntList message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.IntList + * @static + * @param {pg_query.IntList} message IntList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.pg_query.Node.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this IntList to JSON. + * @function toJSON + * @memberof pg_query.IntList + * @instance + * @returns {Object.} JSON object + */ + IntList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntList + * @function getTypeUrl + * @memberof pg_query.IntList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.IntList"; + }; + + return IntList; + })(); + + pg_query.Alias = (function() { + + /** + * Properties of an Alias. + * @memberof pg_query + * @interface IAlias + * @property {string|null} [aliasname] Alias aliasname + * @property {Array.|null} [colnames] Alias colnames + */ + + /** + * Constructs a new Alias. + * @memberof pg_query + * @classdesc Represents an Alias. + * @implements IAlias + * @constructor + * @param {pg_query.IAlias=} [properties] Properties to set + */ + function Alias(properties) { + this.colnames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Alias aliasname. + * @member {string} aliasname + * @memberof pg_query.Alias + * @instance + */ + Alias.prototype.aliasname = ""; + + /** + * Alias colnames. + * @member {Array.} colnames + * @memberof pg_query.Alias + * @instance + */ + Alias.prototype.colnames = $util.emptyArray; + + /** + * Creates a new Alias instance using the specified properties. + * @function create + * @memberof pg_query.Alias + * @static + * @param {pg_query.IAlias=} [properties] Properties to set + * @returns {pg_query.Alias} Alias instance + */ + Alias.create = function create(properties) { + return new Alias(properties); + }; + + /** + * Encodes the specified Alias message. Does not implicitly {@link pg_query.Alias.verify|verify} messages. + * @function encode + * @memberof pg_query.Alias + * @static + * @param {pg_query.IAlias} message Alias message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Alias.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aliasname != null && Object.hasOwnProperty.call(message, "aliasname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.aliasname); + if (message.colnames != null && message.colnames.length) + for (var i = 0; i < message.colnames.length; ++i) + $root.pg_query.Node.encode(message.colnames[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Alias message, length delimited. Does not implicitly {@link pg_query.Alias.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.Alias + * @static + * @param {pg_query.IAlias} message Alias message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Alias.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Alias message from the specified reader or buffer. + * @function decode + * @memberof pg_query.Alias + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.Alias} Alias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Alias.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.Alias(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.aliasname = reader.string(); + break; + } + case 2: { + if (!(message.colnames && message.colnames.length)) + message.colnames = []; + message.colnames.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Alias message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.Alias + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.Alias} Alias + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Alias.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Alias message. + * @function verify + * @memberof pg_query.Alias + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Alias.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aliasname != null && message.hasOwnProperty("aliasname")) + if (!$util.isString(message.aliasname)) + return "aliasname: string expected"; + if (message.colnames != null && message.hasOwnProperty("colnames")) { + if (!Array.isArray(message.colnames)) + return "colnames: array expected"; + for (var i = 0; i < message.colnames.length; ++i) { + var error = $root.pg_query.Node.verify(message.colnames[i]); + if (error) + return "colnames." + error; + } + } + return null; + }; + + /** + * Creates an Alias message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.Alias + * @static + * @param {Object.} object Plain object + * @returns {pg_query.Alias} Alias + */ + Alias.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.Alias) + return object; + var message = new $root.pg_query.Alias(); + if (object.aliasname != null) + message.aliasname = String(object.aliasname); + if (object.colnames) { + if (!Array.isArray(object.colnames)) + throw TypeError(".pg_query.Alias.colnames: array expected"); + message.colnames = []; + for (var i = 0; i < object.colnames.length; ++i) { + if (typeof object.colnames[i] !== "object") + throw TypeError(".pg_query.Alias.colnames: object expected"); + message.colnames[i] = $root.pg_query.Node.fromObject(object.colnames[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Alias message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.Alias + * @static + * @param {pg_query.Alias} message Alias + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Alias.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.colnames = []; + if (options.defaults) + object.aliasname = ""; + if (message.aliasname != null && message.hasOwnProperty("aliasname")) + object.aliasname = message.aliasname; + if (message.colnames && message.colnames.length) { + object.colnames = []; + for (var j = 0; j < message.colnames.length; ++j) + object.colnames[j] = $root.pg_query.Node.toObject(message.colnames[j], options); + } + return object; + }; + + /** + * Converts this Alias to JSON. + * @function toJSON + * @memberof pg_query.Alias + * @instance + * @returns {Object.} JSON object + */ + Alias.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Alias + * @function getTypeUrl + * @memberof pg_query.Alias + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Alias.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.Alias"; + }; + + return Alias; + })(); + + pg_query.RangeVar = (function() { + + /** + * Properties of a RangeVar. + * @memberof pg_query + * @interface IRangeVar + * @property {string|null} [catalogname] RangeVar catalogname + * @property {string|null} [schemaname] RangeVar schemaname + * @property {string|null} [relname] RangeVar relname + * @property {boolean|null} [inh] RangeVar inh + * @property {string|null} [relpersistence] RangeVar relpersistence + * @property {pg_query.IAlias|null} [alias] RangeVar alias + * @property {number|null} [location] RangeVar location + */ + + /** + * Constructs a new RangeVar. + * @memberof pg_query + * @classdesc Represents a RangeVar. + * @implements IRangeVar + * @constructor + * @param {pg_query.IRangeVar=} [properties] Properties to set + */ + function RangeVar(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RangeVar catalogname. + * @member {string} catalogname + * @memberof pg_query.RangeVar + * @instance + */ + RangeVar.prototype.catalogname = ""; + + /** + * RangeVar schemaname. + * @member {string} schemaname + * @memberof pg_query.RangeVar + * @instance + */ + RangeVar.prototype.schemaname = ""; + + /** + * RangeVar relname. + * @member {string} relname + * @memberof pg_query.RangeVar + * @instance + */ + RangeVar.prototype.relname = ""; + + /** + * RangeVar inh. + * @member {boolean} inh + * @memberof pg_query.RangeVar + * @instance + */ + RangeVar.prototype.inh = false; + + /** + * RangeVar relpersistence. + * @member {string} relpersistence + * @memberof pg_query.RangeVar + * @instance + */ + RangeVar.prototype.relpersistence = ""; + + /** + * RangeVar alias. + * @member {pg_query.IAlias|null|undefined} alias + * @memberof pg_query.RangeVar + * @instance + */ + RangeVar.prototype.alias = null; + + /** + * RangeVar location. + * @member {number} location + * @memberof pg_query.RangeVar + * @instance + */ + RangeVar.prototype.location = 0; + + /** + * Creates a new RangeVar instance using the specified properties. + * @function create + * @memberof pg_query.RangeVar + * @static + * @param {pg_query.IRangeVar=} [properties] Properties to set + * @returns {pg_query.RangeVar} RangeVar instance + */ + RangeVar.create = function create(properties) { + return new RangeVar(properties); + }; + + /** + * Encodes the specified RangeVar message. Does not implicitly {@link pg_query.RangeVar.verify|verify} messages. + * @function encode + * @memberof pg_query.RangeVar + * @static + * @param {pg_query.IRangeVar} message RangeVar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeVar.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.catalogname != null && Object.hasOwnProperty.call(message, "catalogname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.catalogname); + if (message.schemaname != null && Object.hasOwnProperty.call(message, "schemaname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.schemaname); + if (message.relname != null && Object.hasOwnProperty.call(message, "relname")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.relname); + if (message.inh != null && Object.hasOwnProperty.call(message, "inh")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.inh); + if (message.relpersistence != null && Object.hasOwnProperty.call(message, "relpersistence")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.relpersistence); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + $root.pg_query.Alias.encode(message.alias, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.location); + return writer; + }; + + /** + * Encodes the specified RangeVar message, length delimited. Does not implicitly {@link pg_query.RangeVar.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RangeVar + * @static + * @param {pg_query.IRangeVar} message RangeVar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeVar.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RangeVar message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RangeVar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RangeVar} RangeVar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeVar.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RangeVar(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.catalogname = reader.string(); + break; + } + case 2: { + message.schemaname = reader.string(); + break; + } + case 3: { + message.relname = reader.string(); + break; + } + case 4: { + message.inh = reader.bool(); + break; + } + case 5: { + message.relpersistence = reader.string(); + break; + } + case 6: { + message.alias = $root.pg_query.Alias.decode(reader, reader.uint32()); + break; + } + case 7: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RangeVar message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RangeVar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RangeVar} RangeVar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeVar.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RangeVar message. + * @function verify + * @memberof pg_query.RangeVar + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RangeVar.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.catalogname != null && message.hasOwnProperty("catalogname")) + if (!$util.isString(message.catalogname)) + return "catalogname: string expected"; + if (message.schemaname != null && message.hasOwnProperty("schemaname")) + if (!$util.isString(message.schemaname)) + return "schemaname: string expected"; + if (message.relname != null && message.hasOwnProperty("relname")) + if (!$util.isString(message.relname)) + return "relname: string expected"; + if (message.inh != null && message.hasOwnProperty("inh")) + if (typeof message.inh !== "boolean") + return "inh: boolean expected"; + if (message.relpersistence != null && message.hasOwnProperty("relpersistence")) + if (!$util.isString(message.relpersistence)) + return "relpersistence: string expected"; + if (message.alias != null && message.hasOwnProperty("alias")) { + var error = $root.pg_query.Alias.verify(message.alias); + if (error) + return "alias." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a RangeVar message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RangeVar + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RangeVar} RangeVar + */ + RangeVar.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RangeVar) + return object; + var message = new $root.pg_query.RangeVar(); + if (object.catalogname != null) + message.catalogname = String(object.catalogname); + if (object.schemaname != null) + message.schemaname = String(object.schemaname); + if (object.relname != null) + message.relname = String(object.relname); + if (object.inh != null) + message.inh = Boolean(object.inh); + if (object.relpersistence != null) + message.relpersistence = String(object.relpersistence); + if (object.alias != null) { + if (typeof object.alias !== "object") + throw TypeError(".pg_query.RangeVar.alias: object expected"); + message.alias = $root.pg_query.Alias.fromObject(object.alias); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a RangeVar message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RangeVar + * @static + * @param {pg_query.RangeVar} message RangeVar + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RangeVar.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.catalogname = ""; + object.schemaname = ""; + object.relname = ""; + object.inh = false; + object.relpersistence = ""; + object.alias = null; + object.location = 0; + } + if (message.catalogname != null && message.hasOwnProperty("catalogname")) + object.catalogname = message.catalogname; + if (message.schemaname != null && message.hasOwnProperty("schemaname")) + object.schemaname = message.schemaname; + if (message.relname != null && message.hasOwnProperty("relname")) + object.relname = message.relname; + if (message.inh != null && message.hasOwnProperty("inh")) + object.inh = message.inh; + if (message.relpersistence != null && message.hasOwnProperty("relpersistence")) + object.relpersistence = message.relpersistence; + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = $root.pg_query.Alias.toObject(message.alias, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this RangeVar to JSON. + * @function toJSON + * @memberof pg_query.RangeVar + * @instance + * @returns {Object.} JSON object + */ + RangeVar.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RangeVar + * @function getTypeUrl + * @memberof pg_query.RangeVar + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RangeVar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RangeVar"; + }; + + return RangeVar; + })(); + + pg_query.TableFunc = (function() { + + /** + * Properties of a TableFunc. + * @memberof pg_query + * @interface ITableFunc + * @property {Array.|null} [ns_uris] TableFunc ns_uris + * @property {Array.|null} [ns_names] TableFunc ns_names + * @property {pg_query.INode|null} [docexpr] TableFunc docexpr + * @property {pg_query.INode|null} [rowexpr] TableFunc rowexpr + * @property {Array.|null} [colnames] TableFunc colnames + * @property {Array.|null} [coltypes] TableFunc coltypes + * @property {Array.|null} [coltypmods] TableFunc coltypmods + * @property {Array.|null} [colcollations] TableFunc colcollations + * @property {Array.|null} [colexprs] TableFunc colexprs + * @property {Array.|null} [coldefexprs] TableFunc coldefexprs + * @property {Array.|null} [notnulls] TableFunc notnulls + * @property {number|null} [ordinalitycol] TableFunc ordinalitycol + * @property {number|null} [location] TableFunc location + */ + + /** + * Constructs a new TableFunc. + * @memberof pg_query + * @classdesc Represents a TableFunc. + * @implements ITableFunc + * @constructor + * @param {pg_query.ITableFunc=} [properties] Properties to set + */ + function TableFunc(properties) { + this.ns_uris = []; + this.ns_names = []; + this.colnames = []; + this.coltypes = []; + this.coltypmods = []; + this.colcollations = []; + this.colexprs = []; + this.coldefexprs = []; + this.notnulls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableFunc ns_uris. + * @member {Array.} ns_uris + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.ns_uris = $util.emptyArray; + + /** + * TableFunc ns_names. + * @member {Array.} ns_names + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.ns_names = $util.emptyArray; + + /** + * TableFunc docexpr. + * @member {pg_query.INode|null|undefined} docexpr + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.docexpr = null; + + /** + * TableFunc rowexpr. + * @member {pg_query.INode|null|undefined} rowexpr + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.rowexpr = null; + + /** + * TableFunc colnames. + * @member {Array.} colnames + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.colnames = $util.emptyArray; + + /** + * TableFunc coltypes. + * @member {Array.} coltypes + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.coltypes = $util.emptyArray; + + /** + * TableFunc coltypmods. + * @member {Array.} coltypmods + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.coltypmods = $util.emptyArray; + + /** + * TableFunc colcollations. + * @member {Array.} colcollations + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.colcollations = $util.emptyArray; + + /** + * TableFunc colexprs. + * @member {Array.} colexprs + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.colexprs = $util.emptyArray; + + /** + * TableFunc coldefexprs. + * @member {Array.} coldefexprs + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.coldefexprs = $util.emptyArray; + + /** + * TableFunc notnulls. + * @member {Array.} notnulls + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.notnulls = $util.emptyArray; + + /** + * TableFunc ordinalitycol. + * @member {number} ordinalitycol + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.ordinalitycol = 0; + + /** + * TableFunc location. + * @member {number} location + * @memberof pg_query.TableFunc + * @instance + */ + TableFunc.prototype.location = 0; + + /** + * Creates a new TableFunc instance using the specified properties. + * @function create + * @memberof pg_query.TableFunc + * @static + * @param {pg_query.ITableFunc=} [properties] Properties to set + * @returns {pg_query.TableFunc} TableFunc instance + */ + TableFunc.create = function create(properties) { + return new TableFunc(properties); + }; + + /** + * Encodes the specified TableFunc message. Does not implicitly {@link pg_query.TableFunc.verify|verify} messages. + * @function encode + * @memberof pg_query.TableFunc + * @static + * @param {pg_query.ITableFunc} message TableFunc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableFunc.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ns_uris != null && message.ns_uris.length) + for (var i = 0; i < message.ns_uris.length; ++i) + $root.pg_query.Node.encode(message.ns_uris[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ns_names != null && message.ns_names.length) + for (var i = 0; i < message.ns_names.length; ++i) + $root.pg_query.Node.encode(message.ns_names[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.docexpr != null && Object.hasOwnProperty.call(message, "docexpr")) + $root.pg_query.Node.encode(message.docexpr, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rowexpr != null && Object.hasOwnProperty.call(message, "rowexpr")) + $root.pg_query.Node.encode(message.rowexpr, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.colnames != null && message.colnames.length) + for (var i = 0; i < message.colnames.length; ++i) + $root.pg_query.Node.encode(message.colnames[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.coltypes != null && message.coltypes.length) + for (var i = 0; i < message.coltypes.length; ++i) + $root.pg_query.Node.encode(message.coltypes[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.coltypmods != null && message.coltypmods.length) + for (var i = 0; i < message.coltypmods.length; ++i) + $root.pg_query.Node.encode(message.coltypmods[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.colcollations != null && message.colcollations.length) + for (var i = 0; i < message.colcollations.length; ++i) + $root.pg_query.Node.encode(message.colcollations[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.colexprs != null && message.colexprs.length) + for (var i = 0; i < message.colexprs.length; ++i) + $root.pg_query.Node.encode(message.colexprs[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.coldefexprs != null && message.coldefexprs.length) + for (var i = 0; i < message.coldefexprs.length; ++i) + $root.pg_query.Node.encode(message.coldefexprs[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.notnulls != null && message.notnulls.length) { + writer.uint32(/* id 11, wireType 2 =*/90).fork(); + for (var i = 0; i < message.notnulls.length; ++i) + writer.uint64(message.notnulls[i]); + writer.ldelim(); + } + if (message.ordinalitycol != null && Object.hasOwnProperty.call(message, "ordinalitycol")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.ordinalitycol); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.location); + return writer; + }; + + /** + * Encodes the specified TableFunc message, length delimited. Does not implicitly {@link pg_query.TableFunc.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.TableFunc + * @static + * @param {pg_query.ITableFunc} message TableFunc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableFunc.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableFunc message from the specified reader or buffer. + * @function decode + * @memberof pg_query.TableFunc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.TableFunc} TableFunc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableFunc.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.TableFunc(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ns_uris && message.ns_uris.length)) + message.ns_uris = []; + message.ns_uris.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.ns_names && message.ns_names.length)) + message.ns_names = []; + message.ns_names.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.docexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.rowexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.colnames && message.colnames.length)) + message.colnames = []; + message.colnames.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.coltypes && message.coltypes.length)) + message.coltypes = []; + message.coltypes.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.coltypmods && message.coltypmods.length)) + message.coltypmods = []; + message.coltypmods.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.colcollations && message.colcollations.length)) + message.colcollations = []; + message.colcollations.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.colexprs && message.colexprs.length)) + message.colexprs = []; + message.colexprs.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.coldefexprs && message.coldefexprs.length)) + message.coldefexprs = []; + message.coldefexprs.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message.notnulls && message.notnulls.length)) + message.notnulls = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.notnulls.push(reader.uint64()); + } else + message.notnulls.push(reader.uint64()); + break; + } + case 12: { + message.ordinalitycol = reader.int32(); + break; + } + case 13: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableFunc message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.TableFunc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.TableFunc} TableFunc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableFunc.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableFunc message. + * @function verify + * @memberof pg_query.TableFunc + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableFunc.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ns_uris != null && message.hasOwnProperty("ns_uris")) { + if (!Array.isArray(message.ns_uris)) + return "ns_uris: array expected"; + for (var i = 0; i < message.ns_uris.length; ++i) { + var error = $root.pg_query.Node.verify(message.ns_uris[i]); + if (error) + return "ns_uris." + error; + } + } + if (message.ns_names != null && message.hasOwnProperty("ns_names")) { + if (!Array.isArray(message.ns_names)) + return "ns_names: array expected"; + for (var i = 0; i < message.ns_names.length; ++i) { + var error = $root.pg_query.Node.verify(message.ns_names[i]); + if (error) + return "ns_names." + error; + } + } + if (message.docexpr != null && message.hasOwnProperty("docexpr")) { + var error = $root.pg_query.Node.verify(message.docexpr); + if (error) + return "docexpr." + error; + } + if (message.rowexpr != null && message.hasOwnProperty("rowexpr")) { + var error = $root.pg_query.Node.verify(message.rowexpr); + if (error) + return "rowexpr." + error; + } + if (message.colnames != null && message.hasOwnProperty("colnames")) { + if (!Array.isArray(message.colnames)) + return "colnames: array expected"; + for (var i = 0; i < message.colnames.length; ++i) { + var error = $root.pg_query.Node.verify(message.colnames[i]); + if (error) + return "colnames." + error; + } + } + if (message.coltypes != null && message.hasOwnProperty("coltypes")) { + if (!Array.isArray(message.coltypes)) + return "coltypes: array expected"; + for (var i = 0; i < message.coltypes.length; ++i) { + var error = $root.pg_query.Node.verify(message.coltypes[i]); + if (error) + return "coltypes." + error; + } + } + if (message.coltypmods != null && message.hasOwnProperty("coltypmods")) { + if (!Array.isArray(message.coltypmods)) + return "coltypmods: array expected"; + for (var i = 0; i < message.coltypmods.length; ++i) { + var error = $root.pg_query.Node.verify(message.coltypmods[i]); + if (error) + return "coltypmods." + error; + } + } + if (message.colcollations != null && message.hasOwnProperty("colcollations")) { + if (!Array.isArray(message.colcollations)) + return "colcollations: array expected"; + for (var i = 0; i < message.colcollations.length; ++i) { + var error = $root.pg_query.Node.verify(message.colcollations[i]); + if (error) + return "colcollations." + error; + } + } + if (message.colexprs != null && message.hasOwnProperty("colexprs")) { + if (!Array.isArray(message.colexprs)) + return "colexprs: array expected"; + for (var i = 0; i < message.colexprs.length; ++i) { + var error = $root.pg_query.Node.verify(message.colexprs[i]); + if (error) + return "colexprs." + error; + } + } + if (message.coldefexprs != null && message.hasOwnProperty("coldefexprs")) { + if (!Array.isArray(message.coldefexprs)) + return "coldefexprs: array expected"; + for (var i = 0; i < message.coldefexprs.length; ++i) { + var error = $root.pg_query.Node.verify(message.coldefexprs[i]); + if (error) + return "coldefexprs." + error; + } + } + if (message.notnulls != null && message.hasOwnProperty("notnulls")) { + if (!Array.isArray(message.notnulls)) + return "notnulls: array expected"; + for (var i = 0; i < message.notnulls.length; ++i) + if (!$util.isInteger(message.notnulls[i]) && !(message.notnulls[i] && $util.isInteger(message.notnulls[i].low) && $util.isInteger(message.notnulls[i].high))) + return "notnulls: integer|Long[] expected"; + } + if (message.ordinalitycol != null && message.hasOwnProperty("ordinalitycol")) + if (!$util.isInteger(message.ordinalitycol)) + return "ordinalitycol: integer expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a TableFunc message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.TableFunc + * @static + * @param {Object.} object Plain object + * @returns {pg_query.TableFunc} TableFunc + */ + TableFunc.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.TableFunc) + return object; + var message = new $root.pg_query.TableFunc(); + if (object.ns_uris) { + if (!Array.isArray(object.ns_uris)) + throw TypeError(".pg_query.TableFunc.ns_uris: array expected"); + message.ns_uris = []; + for (var i = 0; i < object.ns_uris.length; ++i) { + if (typeof object.ns_uris[i] !== "object") + throw TypeError(".pg_query.TableFunc.ns_uris: object expected"); + message.ns_uris[i] = $root.pg_query.Node.fromObject(object.ns_uris[i]); + } + } + if (object.ns_names) { + if (!Array.isArray(object.ns_names)) + throw TypeError(".pg_query.TableFunc.ns_names: array expected"); + message.ns_names = []; + for (var i = 0; i < object.ns_names.length; ++i) { + if (typeof object.ns_names[i] !== "object") + throw TypeError(".pg_query.TableFunc.ns_names: object expected"); + message.ns_names[i] = $root.pg_query.Node.fromObject(object.ns_names[i]); + } + } + if (object.docexpr != null) { + if (typeof object.docexpr !== "object") + throw TypeError(".pg_query.TableFunc.docexpr: object expected"); + message.docexpr = $root.pg_query.Node.fromObject(object.docexpr); + } + if (object.rowexpr != null) { + if (typeof object.rowexpr !== "object") + throw TypeError(".pg_query.TableFunc.rowexpr: object expected"); + message.rowexpr = $root.pg_query.Node.fromObject(object.rowexpr); + } + if (object.colnames) { + if (!Array.isArray(object.colnames)) + throw TypeError(".pg_query.TableFunc.colnames: array expected"); + message.colnames = []; + for (var i = 0; i < object.colnames.length; ++i) { + if (typeof object.colnames[i] !== "object") + throw TypeError(".pg_query.TableFunc.colnames: object expected"); + message.colnames[i] = $root.pg_query.Node.fromObject(object.colnames[i]); + } + } + if (object.coltypes) { + if (!Array.isArray(object.coltypes)) + throw TypeError(".pg_query.TableFunc.coltypes: array expected"); + message.coltypes = []; + for (var i = 0; i < object.coltypes.length; ++i) { + if (typeof object.coltypes[i] !== "object") + throw TypeError(".pg_query.TableFunc.coltypes: object expected"); + message.coltypes[i] = $root.pg_query.Node.fromObject(object.coltypes[i]); + } + } + if (object.coltypmods) { + if (!Array.isArray(object.coltypmods)) + throw TypeError(".pg_query.TableFunc.coltypmods: array expected"); + message.coltypmods = []; + for (var i = 0; i < object.coltypmods.length; ++i) { + if (typeof object.coltypmods[i] !== "object") + throw TypeError(".pg_query.TableFunc.coltypmods: object expected"); + message.coltypmods[i] = $root.pg_query.Node.fromObject(object.coltypmods[i]); + } + } + if (object.colcollations) { + if (!Array.isArray(object.colcollations)) + throw TypeError(".pg_query.TableFunc.colcollations: array expected"); + message.colcollations = []; + for (var i = 0; i < object.colcollations.length; ++i) { + if (typeof object.colcollations[i] !== "object") + throw TypeError(".pg_query.TableFunc.colcollations: object expected"); + message.colcollations[i] = $root.pg_query.Node.fromObject(object.colcollations[i]); + } + } + if (object.colexprs) { + if (!Array.isArray(object.colexprs)) + throw TypeError(".pg_query.TableFunc.colexprs: array expected"); + message.colexprs = []; + for (var i = 0; i < object.colexprs.length; ++i) { + if (typeof object.colexprs[i] !== "object") + throw TypeError(".pg_query.TableFunc.colexprs: object expected"); + message.colexprs[i] = $root.pg_query.Node.fromObject(object.colexprs[i]); + } + } + if (object.coldefexprs) { + if (!Array.isArray(object.coldefexprs)) + throw TypeError(".pg_query.TableFunc.coldefexprs: array expected"); + message.coldefexprs = []; + for (var i = 0; i < object.coldefexprs.length; ++i) { + if (typeof object.coldefexprs[i] !== "object") + throw TypeError(".pg_query.TableFunc.coldefexprs: object expected"); + message.coldefexprs[i] = $root.pg_query.Node.fromObject(object.coldefexprs[i]); + } + } + if (object.notnulls) { + if (!Array.isArray(object.notnulls)) + throw TypeError(".pg_query.TableFunc.notnulls: array expected"); + message.notnulls = []; + for (var i = 0; i < object.notnulls.length; ++i) + if ($util.Long) + (message.notnulls[i] = $util.Long.fromValue(object.notnulls[i])).unsigned = true; + else if (typeof object.notnulls[i] === "string") + message.notnulls[i] = parseInt(object.notnulls[i], 10); + else if (typeof object.notnulls[i] === "number") + message.notnulls[i] = object.notnulls[i]; + else if (typeof object.notnulls[i] === "object") + message.notnulls[i] = new $util.LongBits(object.notnulls[i].low >>> 0, object.notnulls[i].high >>> 0).toNumber(true); + } + if (object.ordinalitycol != null) + message.ordinalitycol = object.ordinalitycol | 0; + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a TableFunc message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.TableFunc + * @static + * @param {pg_query.TableFunc} message TableFunc + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableFunc.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ns_uris = []; + object.ns_names = []; + object.colnames = []; + object.coltypes = []; + object.coltypmods = []; + object.colcollations = []; + object.colexprs = []; + object.coldefexprs = []; + object.notnulls = []; + } + if (options.defaults) { + object.docexpr = null; + object.rowexpr = null; + object.ordinalitycol = 0; + object.location = 0; + } + if (message.ns_uris && message.ns_uris.length) { + object.ns_uris = []; + for (var j = 0; j < message.ns_uris.length; ++j) + object.ns_uris[j] = $root.pg_query.Node.toObject(message.ns_uris[j], options); + } + if (message.ns_names && message.ns_names.length) { + object.ns_names = []; + for (var j = 0; j < message.ns_names.length; ++j) + object.ns_names[j] = $root.pg_query.Node.toObject(message.ns_names[j], options); + } + if (message.docexpr != null && message.hasOwnProperty("docexpr")) + object.docexpr = $root.pg_query.Node.toObject(message.docexpr, options); + if (message.rowexpr != null && message.hasOwnProperty("rowexpr")) + object.rowexpr = $root.pg_query.Node.toObject(message.rowexpr, options); + if (message.colnames && message.colnames.length) { + object.colnames = []; + for (var j = 0; j < message.colnames.length; ++j) + object.colnames[j] = $root.pg_query.Node.toObject(message.colnames[j], options); + } + if (message.coltypes && message.coltypes.length) { + object.coltypes = []; + for (var j = 0; j < message.coltypes.length; ++j) + object.coltypes[j] = $root.pg_query.Node.toObject(message.coltypes[j], options); + } + if (message.coltypmods && message.coltypmods.length) { + object.coltypmods = []; + for (var j = 0; j < message.coltypmods.length; ++j) + object.coltypmods[j] = $root.pg_query.Node.toObject(message.coltypmods[j], options); + } + if (message.colcollations && message.colcollations.length) { + object.colcollations = []; + for (var j = 0; j < message.colcollations.length; ++j) + object.colcollations[j] = $root.pg_query.Node.toObject(message.colcollations[j], options); + } + if (message.colexprs && message.colexprs.length) { + object.colexprs = []; + for (var j = 0; j < message.colexprs.length; ++j) + object.colexprs[j] = $root.pg_query.Node.toObject(message.colexprs[j], options); + } + if (message.coldefexprs && message.coldefexprs.length) { + object.coldefexprs = []; + for (var j = 0; j < message.coldefexprs.length; ++j) + object.coldefexprs[j] = $root.pg_query.Node.toObject(message.coldefexprs[j], options); + } + if (message.notnulls && message.notnulls.length) { + object.notnulls = []; + for (var j = 0; j < message.notnulls.length; ++j) + if (typeof message.notnulls[j] === "number") + object.notnulls[j] = options.longs === String ? String(message.notnulls[j]) : message.notnulls[j]; + else + object.notnulls[j] = options.longs === String ? $util.Long.prototype.toString.call(message.notnulls[j]) : options.longs === Number ? new $util.LongBits(message.notnulls[j].low >>> 0, message.notnulls[j].high >>> 0).toNumber(true) : message.notnulls[j]; + } + if (message.ordinalitycol != null && message.hasOwnProperty("ordinalitycol")) + object.ordinalitycol = message.ordinalitycol; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this TableFunc to JSON. + * @function toJSON + * @memberof pg_query.TableFunc + * @instance + * @returns {Object.} JSON object + */ + TableFunc.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableFunc + * @function getTypeUrl + * @memberof pg_query.TableFunc + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableFunc.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.TableFunc"; + }; + + return TableFunc; + })(); + + pg_query.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof pg_query + * @interface IExpr + */ + + /** + * Constructs a new Expr. + * @memberof pg_query + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {pg_query.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof pg_query.Expr + * @static + * @param {pg_query.IExpr=} [properties] Properties to set + * @returns {pg_query.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link pg_query.Expr.verify|verify} messages. + * @function encode + * @memberof pg_query.Expr + * @static + * @param {pg_query.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link pg_query.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.Expr + * @static + * @param {pg_query.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof pg_query.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.Expr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.Expr) + return object; + return new $root.pg_query.Expr(); + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.Expr + * @static + * @param {pg_query.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof pg_query.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof pg_query.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.Expr"; + }; + + return Expr; + })(); + + pg_query.Var = (function() { + + /** + * Properties of a Var. + * @memberof pg_query + * @interface IVar + * @property {pg_query.INode|null} [xpr] Var xpr + * @property {number|null} [varno] Var varno + * @property {number|null} [varattno] Var varattno + * @property {number|null} [vartype] Var vartype + * @property {number|null} [vartypmod] Var vartypmod + * @property {number|null} [varcollid] Var varcollid + * @property {number|null} [varlevelsup] Var varlevelsup + * @property {number|null} [varnosyn] Var varnosyn + * @property {number|null} [varattnosyn] Var varattnosyn + * @property {number|null} [location] Var location + */ + + /** + * Constructs a new Var. + * @memberof pg_query + * @classdesc Represents a Var. + * @implements IVar + * @constructor + * @param {pg_query.IVar=} [properties] Properties to set + */ + function Var(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Var xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.Var + * @instance + */ + Var.prototype.xpr = null; + + /** + * Var varno. + * @member {number} varno + * @memberof pg_query.Var + * @instance + */ + Var.prototype.varno = 0; + + /** + * Var varattno. + * @member {number} varattno + * @memberof pg_query.Var + * @instance + */ + Var.prototype.varattno = 0; + + /** + * Var vartype. + * @member {number} vartype + * @memberof pg_query.Var + * @instance + */ + Var.prototype.vartype = 0; + + /** + * Var vartypmod. + * @member {number} vartypmod + * @memberof pg_query.Var + * @instance + */ + Var.prototype.vartypmod = 0; + + /** + * Var varcollid. + * @member {number} varcollid + * @memberof pg_query.Var + * @instance + */ + Var.prototype.varcollid = 0; + + /** + * Var varlevelsup. + * @member {number} varlevelsup + * @memberof pg_query.Var + * @instance + */ + Var.prototype.varlevelsup = 0; + + /** + * Var varnosyn. + * @member {number} varnosyn + * @memberof pg_query.Var + * @instance + */ + Var.prototype.varnosyn = 0; + + /** + * Var varattnosyn. + * @member {number} varattnosyn + * @memberof pg_query.Var + * @instance + */ + Var.prototype.varattnosyn = 0; + + /** + * Var location. + * @member {number} location + * @memberof pg_query.Var + * @instance + */ + Var.prototype.location = 0; + + /** + * Creates a new Var instance using the specified properties. + * @function create + * @memberof pg_query.Var + * @static + * @param {pg_query.IVar=} [properties] Properties to set + * @returns {pg_query.Var} Var instance + */ + Var.create = function create(properties) { + return new Var(properties); + }; + + /** + * Encodes the specified Var message. Does not implicitly {@link pg_query.Var.verify|verify} messages. + * @function encode + * @memberof pg_query.Var + * @static + * @param {pg_query.IVar} message Var message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Var.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.varno != null && Object.hasOwnProperty.call(message, "varno")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.varno); + if (message.varattno != null && Object.hasOwnProperty.call(message, "varattno")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.varattno); + if (message.vartype != null && Object.hasOwnProperty.call(message, "vartype")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.vartype); + if (message.vartypmod != null && Object.hasOwnProperty.call(message, "vartypmod")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.vartypmod); + if (message.varcollid != null && Object.hasOwnProperty.call(message, "varcollid")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.varcollid); + if (message.varlevelsup != null && Object.hasOwnProperty.call(message, "varlevelsup")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.varlevelsup); + if (message.varnosyn != null && Object.hasOwnProperty.call(message, "varnosyn")) + writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.varnosyn); + if (message.varattnosyn != null && Object.hasOwnProperty.call(message, "varattnosyn")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.varattnosyn); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.location); + return writer; + }; + + /** + * Encodes the specified Var message, length delimited. Does not implicitly {@link pg_query.Var.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.Var + * @static + * @param {pg_query.IVar} message Var message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Var.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Var message from the specified reader or buffer. + * @function decode + * @memberof pg_query.Var + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.Var} Var + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Var.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.Var(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.varno = reader.uint32(); + break; + } + case 3: { + message.varattno = reader.int32(); + break; + } + case 4: { + message.vartype = reader.uint32(); + break; + } + case 5: { + message.vartypmod = reader.int32(); + break; + } + case 6: { + message.varcollid = reader.uint32(); + break; + } + case 7: { + message.varlevelsup = reader.uint32(); + break; + } + case 8: { + message.varnosyn = reader.uint32(); + break; + } + case 9: { + message.varattnosyn = reader.int32(); + break; + } + case 10: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Var message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.Var + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.Var} Var + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Var.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Var message. + * @function verify + * @memberof pg_query.Var + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Var.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.varno != null && message.hasOwnProperty("varno")) + if (!$util.isInteger(message.varno)) + return "varno: integer expected"; + if (message.varattno != null && message.hasOwnProperty("varattno")) + if (!$util.isInteger(message.varattno)) + return "varattno: integer expected"; + if (message.vartype != null && message.hasOwnProperty("vartype")) + if (!$util.isInteger(message.vartype)) + return "vartype: integer expected"; + if (message.vartypmod != null && message.hasOwnProperty("vartypmod")) + if (!$util.isInteger(message.vartypmod)) + return "vartypmod: integer expected"; + if (message.varcollid != null && message.hasOwnProperty("varcollid")) + if (!$util.isInteger(message.varcollid)) + return "varcollid: integer expected"; + if (message.varlevelsup != null && message.hasOwnProperty("varlevelsup")) + if (!$util.isInteger(message.varlevelsup)) + return "varlevelsup: integer expected"; + if (message.varnosyn != null && message.hasOwnProperty("varnosyn")) + if (!$util.isInteger(message.varnosyn)) + return "varnosyn: integer expected"; + if (message.varattnosyn != null && message.hasOwnProperty("varattnosyn")) + if (!$util.isInteger(message.varattnosyn)) + return "varattnosyn: integer expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a Var message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.Var + * @static + * @param {Object.} object Plain object + * @returns {pg_query.Var} Var + */ + Var.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.Var) + return object; + var message = new $root.pg_query.Var(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.Var.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.varno != null) + message.varno = object.varno >>> 0; + if (object.varattno != null) + message.varattno = object.varattno | 0; + if (object.vartype != null) + message.vartype = object.vartype >>> 0; + if (object.vartypmod != null) + message.vartypmod = object.vartypmod | 0; + if (object.varcollid != null) + message.varcollid = object.varcollid >>> 0; + if (object.varlevelsup != null) + message.varlevelsup = object.varlevelsup >>> 0; + if (object.varnosyn != null) + message.varnosyn = object.varnosyn >>> 0; + if (object.varattnosyn != null) + message.varattnosyn = object.varattnosyn | 0; + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a Var message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.Var + * @static + * @param {pg_query.Var} message Var + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Var.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.varno = 0; + object.varattno = 0; + object.vartype = 0; + object.vartypmod = 0; + object.varcollid = 0; + object.varlevelsup = 0; + object.varnosyn = 0; + object.varattnosyn = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.varno != null && message.hasOwnProperty("varno")) + object.varno = message.varno; + if (message.varattno != null && message.hasOwnProperty("varattno")) + object.varattno = message.varattno; + if (message.vartype != null && message.hasOwnProperty("vartype")) + object.vartype = message.vartype; + if (message.vartypmod != null && message.hasOwnProperty("vartypmod")) + object.vartypmod = message.vartypmod; + if (message.varcollid != null && message.hasOwnProperty("varcollid")) + object.varcollid = message.varcollid; + if (message.varlevelsup != null && message.hasOwnProperty("varlevelsup")) + object.varlevelsup = message.varlevelsup; + if (message.varnosyn != null && message.hasOwnProperty("varnosyn")) + object.varnosyn = message.varnosyn; + if (message.varattnosyn != null && message.hasOwnProperty("varattnosyn")) + object.varattnosyn = message.varattnosyn; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Var to JSON. + * @function toJSON + * @memberof pg_query.Var + * @instance + * @returns {Object.} JSON object + */ + Var.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Var + * @function getTypeUrl + * @memberof pg_query.Var + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Var.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.Var"; + }; + + return Var; + })(); + + pg_query.Param = (function() { + + /** + * Properties of a Param. + * @memberof pg_query + * @interface IParam + * @property {pg_query.INode|null} [xpr] Param xpr + * @property {pg_query.ParamKind|null} [paramkind] Param paramkind + * @property {number|null} [paramid] Param paramid + * @property {number|null} [paramtype] Param paramtype + * @property {number|null} [paramtypmod] Param paramtypmod + * @property {number|null} [paramcollid] Param paramcollid + * @property {number|null} [location] Param location + */ + + /** + * Constructs a new Param. + * @memberof pg_query + * @classdesc Represents a Param. + * @implements IParam + * @constructor + * @param {pg_query.IParam=} [properties] Properties to set + */ + function Param(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Param xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.Param + * @instance + */ + Param.prototype.xpr = null; + + /** + * Param paramkind. + * @member {pg_query.ParamKind} paramkind + * @memberof pg_query.Param + * @instance + */ + Param.prototype.paramkind = 0; + + /** + * Param paramid. + * @member {number} paramid + * @memberof pg_query.Param + * @instance + */ + Param.prototype.paramid = 0; + + /** + * Param paramtype. + * @member {number} paramtype + * @memberof pg_query.Param + * @instance + */ + Param.prototype.paramtype = 0; + + /** + * Param paramtypmod. + * @member {number} paramtypmod + * @memberof pg_query.Param + * @instance + */ + Param.prototype.paramtypmod = 0; + + /** + * Param paramcollid. + * @member {number} paramcollid + * @memberof pg_query.Param + * @instance + */ + Param.prototype.paramcollid = 0; + + /** + * Param location. + * @member {number} location + * @memberof pg_query.Param + * @instance + */ + Param.prototype.location = 0; + + /** + * Creates a new Param instance using the specified properties. + * @function create + * @memberof pg_query.Param + * @static + * @param {pg_query.IParam=} [properties] Properties to set + * @returns {pg_query.Param} Param instance + */ + Param.create = function create(properties) { + return new Param(properties); + }; + + /** + * Encodes the specified Param message. Does not implicitly {@link pg_query.Param.verify|verify} messages. + * @function encode + * @memberof pg_query.Param + * @static + * @param {pg_query.IParam} message Param message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Param.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.paramkind != null && Object.hasOwnProperty.call(message, "paramkind")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.paramkind); + if (message.paramid != null && Object.hasOwnProperty.call(message, "paramid")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.paramid); + if (message.paramtype != null && Object.hasOwnProperty.call(message, "paramtype")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.paramtype); + if (message.paramtypmod != null && Object.hasOwnProperty.call(message, "paramtypmod")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.paramtypmod); + if (message.paramcollid != null && Object.hasOwnProperty.call(message, "paramcollid")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.paramcollid); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.location); + return writer; + }; + + /** + * Encodes the specified Param message, length delimited. Does not implicitly {@link pg_query.Param.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.Param + * @static + * @param {pg_query.IParam} message Param message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Param.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Param message from the specified reader or buffer. + * @function decode + * @memberof pg_query.Param + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.Param} Param + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Param.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.Param(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.paramkind = reader.int32(); + break; + } + case 3: { + message.paramid = reader.int32(); + break; + } + case 4: { + message.paramtype = reader.uint32(); + break; + } + case 5: { + message.paramtypmod = reader.int32(); + break; + } + case 6: { + message.paramcollid = reader.uint32(); + break; + } + case 7: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Param message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.Param + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.Param} Param + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Param.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Param message. + * @function verify + * @memberof pg_query.Param + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Param.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.paramkind != null && message.hasOwnProperty("paramkind")) + switch (message.paramkind) { + default: + return "paramkind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.paramid != null && message.hasOwnProperty("paramid")) + if (!$util.isInteger(message.paramid)) + return "paramid: integer expected"; + if (message.paramtype != null && message.hasOwnProperty("paramtype")) + if (!$util.isInteger(message.paramtype)) + return "paramtype: integer expected"; + if (message.paramtypmod != null && message.hasOwnProperty("paramtypmod")) + if (!$util.isInteger(message.paramtypmod)) + return "paramtypmod: integer expected"; + if (message.paramcollid != null && message.hasOwnProperty("paramcollid")) + if (!$util.isInteger(message.paramcollid)) + return "paramcollid: integer expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a Param message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.Param + * @static + * @param {Object.} object Plain object + * @returns {pg_query.Param} Param + */ + Param.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.Param) + return object; + var message = new $root.pg_query.Param(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.Param.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + switch (object.paramkind) { + default: + if (typeof object.paramkind === "number") { + message.paramkind = object.paramkind; + break; + } + break; + case "PARAM_KIND_UNDEFINED": + case 0: + message.paramkind = 0; + break; + case "PARAM_EXTERN": + case 1: + message.paramkind = 1; + break; + case "PARAM_EXEC": + case 2: + message.paramkind = 2; + break; + case "PARAM_SUBLINK": + case 3: + message.paramkind = 3; + break; + case "PARAM_MULTIEXPR": + case 4: + message.paramkind = 4; + break; + } + if (object.paramid != null) + message.paramid = object.paramid | 0; + if (object.paramtype != null) + message.paramtype = object.paramtype >>> 0; + if (object.paramtypmod != null) + message.paramtypmod = object.paramtypmod | 0; + if (object.paramcollid != null) + message.paramcollid = object.paramcollid >>> 0; + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a Param message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.Param + * @static + * @param {pg_query.Param} message Param + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Param.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.paramkind = options.enums === String ? "PARAM_KIND_UNDEFINED" : 0; + object.paramid = 0; + object.paramtype = 0; + object.paramtypmod = 0; + object.paramcollid = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.paramkind != null && message.hasOwnProperty("paramkind")) + object.paramkind = options.enums === String ? $root.pg_query.ParamKind[message.paramkind] === undefined ? message.paramkind : $root.pg_query.ParamKind[message.paramkind] : message.paramkind; + if (message.paramid != null && message.hasOwnProperty("paramid")) + object.paramid = message.paramid; + if (message.paramtype != null && message.hasOwnProperty("paramtype")) + object.paramtype = message.paramtype; + if (message.paramtypmod != null && message.hasOwnProperty("paramtypmod")) + object.paramtypmod = message.paramtypmod; + if (message.paramcollid != null && message.hasOwnProperty("paramcollid")) + object.paramcollid = message.paramcollid; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Param to JSON. + * @function toJSON + * @memberof pg_query.Param + * @instance + * @returns {Object.} JSON object + */ + Param.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Param + * @function getTypeUrl + * @memberof pg_query.Param + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Param.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.Param"; + }; + + return Param; + })(); + + pg_query.Aggref = (function() { + + /** + * Properties of an Aggref. + * @memberof pg_query + * @interface IAggref + * @property {pg_query.INode|null} [xpr] Aggref xpr + * @property {number|null} [aggfnoid] Aggref aggfnoid + * @property {number|null} [aggtype] Aggref aggtype + * @property {number|null} [aggcollid] Aggref aggcollid + * @property {number|null} [inputcollid] Aggref inputcollid + * @property {number|null} [aggtranstype] Aggref aggtranstype + * @property {Array.|null} [aggargtypes] Aggref aggargtypes + * @property {Array.|null} [aggdirectargs] Aggref aggdirectargs + * @property {Array.|null} [args] Aggref args + * @property {Array.|null} [aggorder] Aggref aggorder + * @property {Array.|null} [aggdistinct] Aggref aggdistinct + * @property {pg_query.INode|null} [aggfilter] Aggref aggfilter + * @property {boolean|null} [aggstar] Aggref aggstar + * @property {boolean|null} [aggvariadic] Aggref aggvariadic + * @property {string|null} [aggkind] Aggref aggkind + * @property {number|null} [agglevelsup] Aggref agglevelsup + * @property {pg_query.AggSplit|null} [aggsplit] Aggref aggsplit + * @property {number|null} [location] Aggref location + */ + + /** + * Constructs a new Aggref. + * @memberof pg_query + * @classdesc Represents an Aggref. + * @implements IAggref + * @constructor + * @param {pg_query.IAggref=} [properties] Properties to set + */ + function Aggref(properties) { + this.aggargtypes = []; + this.aggdirectargs = []; + this.args = []; + this.aggorder = []; + this.aggdistinct = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Aggref xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.xpr = null; + + /** + * Aggref aggfnoid. + * @member {number} aggfnoid + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggfnoid = 0; + + /** + * Aggref aggtype. + * @member {number} aggtype + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggtype = 0; + + /** + * Aggref aggcollid. + * @member {number} aggcollid + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggcollid = 0; + + /** + * Aggref inputcollid. + * @member {number} inputcollid + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.inputcollid = 0; + + /** + * Aggref aggtranstype. + * @member {number} aggtranstype + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggtranstype = 0; + + /** + * Aggref aggargtypes. + * @member {Array.} aggargtypes + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggargtypes = $util.emptyArray; + + /** + * Aggref aggdirectargs. + * @member {Array.} aggdirectargs + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggdirectargs = $util.emptyArray; + + /** + * Aggref args. + * @member {Array.} args + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.args = $util.emptyArray; + + /** + * Aggref aggorder. + * @member {Array.} aggorder + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggorder = $util.emptyArray; + + /** + * Aggref aggdistinct. + * @member {Array.} aggdistinct + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggdistinct = $util.emptyArray; + + /** + * Aggref aggfilter. + * @member {pg_query.INode|null|undefined} aggfilter + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggfilter = null; + + /** + * Aggref aggstar. + * @member {boolean} aggstar + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggstar = false; + + /** + * Aggref aggvariadic. + * @member {boolean} aggvariadic + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggvariadic = false; + + /** + * Aggref aggkind. + * @member {string} aggkind + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggkind = ""; + + /** + * Aggref agglevelsup. + * @member {number} agglevelsup + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.agglevelsup = 0; + + /** + * Aggref aggsplit. + * @member {pg_query.AggSplit} aggsplit + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.aggsplit = 0; + + /** + * Aggref location. + * @member {number} location + * @memberof pg_query.Aggref + * @instance + */ + Aggref.prototype.location = 0; + + /** + * Creates a new Aggref instance using the specified properties. + * @function create + * @memberof pg_query.Aggref + * @static + * @param {pg_query.IAggref=} [properties] Properties to set + * @returns {pg_query.Aggref} Aggref instance + */ + Aggref.create = function create(properties) { + return new Aggref(properties); + }; + + /** + * Encodes the specified Aggref message. Does not implicitly {@link pg_query.Aggref.verify|verify} messages. + * @function encode + * @memberof pg_query.Aggref + * @static + * @param {pg_query.IAggref} message Aggref message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggref.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.aggfnoid != null && Object.hasOwnProperty.call(message, "aggfnoid")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.aggfnoid); + if (message.aggtype != null && Object.hasOwnProperty.call(message, "aggtype")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.aggtype); + if (message.aggcollid != null && Object.hasOwnProperty.call(message, "aggcollid")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.aggcollid); + if (message.inputcollid != null && Object.hasOwnProperty.call(message, "inputcollid")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.inputcollid); + if (message.aggtranstype != null && Object.hasOwnProperty.call(message, "aggtranstype")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.aggtranstype); + if (message.aggargtypes != null && message.aggargtypes.length) + for (var i = 0; i < message.aggargtypes.length; ++i) + $root.pg_query.Node.encode(message.aggargtypes[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.aggdirectargs != null && message.aggdirectargs.length) + for (var i = 0; i < message.aggdirectargs.length; ++i) + $root.pg_query.Node.encode(message.aggdirectargs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.aggorder != null && message.aggorder.length) + for (var i = 0; i < message.aggorder.length; ++i) + $root.pg_query.Node.encode(message.aggorder[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.aggdistinct != null && message.aggdistinct.length) + for (var i = 0; i < message.aggdistinct.length; ++i) + $root.pg_query.Node.encode(message.aggdistinct[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.aggfilter != null && Object.hasOwnProperty.call(message, "aggfilter")) + $root.pg_query.Node.encode(message.aggfilter, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.aggstar != null && Object.hasOwnProperty.call(message, "aggstar")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.aggstar); + if (message.aggvariadic != null && Object.hasOwnProperty.call(message, "aggvariadic")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.aggvariadic); + if (message.aggkind != null && Object.hasOwnProperty.call(message, "aggkind")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.aggkind); + if (message.agglevelsup != null && Object.hasOwnProperty.call(message, "agglevelsup")) + writer.uint32(/* id 16, wireType 0 =*/128).uint32(message.agglevelsup); + if (message.aggsplit != null && Object.hasOwnProperty.call(message, "aggsplit")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.aggsplit); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.location); + return writer; + }; + + /** + * Encodes the specified Aggref message, length delimited. Does not implicitly {@link pg_query.Aggref.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.Aggref + * @static + * @param {pg_query.IAggref} message Aggref message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggref.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Aggref message from the specified reader or buffer. + * @function decode + * @memberof pg_query.Aggref + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.Aggref} Aggref + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggref.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.Aggref(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.aggfnoid = reader.uint32(); + break; + } + case 3: { + message.aggtype = reader.uint32(); + break; + } + case 4: { + message.aggcollid = reader.uint32(); + break; + } + case 5: { + message.inputcollid = reader.uint32(); + break; + } + case 6: { + message.aggtranstype = reader.uint32(); + break; + } + case 7: { + if (!(message.aggargtypes && message.aggargtypes.length)) + message.aggargtypes = []; + message.aggargtypes.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.aggdirectargs && message.aggdirectargs.length)) + message.aggdirectargs = []; + message.aggdirectargs.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.aggorder && message.aggorder.length)) + message.aggorder = []; + message.aggorder.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message.aggdistinct && message.aggdistinct.length)) + message.aggdistinct = []; + message.aggdistinct.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 12: { + message.aggfilter = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 13: { + message.aggstar = reader.bool(); + break; + } + case 14: { + message.aggvariadic = reader.bool(); + break; + } + case 15: { + message.aggkind = reader.string(); + break; + } + case 16: { + message.agglevelsup = reader.uint32(); + break; + } + case 17: { + message.aggsplit = reader.int32(); + break; + } + case 18: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Aggref message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.Aggref + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.Aggref} Aggref + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggref.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Aggref message. + * @function verify + * @memberof pg_query.Aggref + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Aggref.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.aggfnoid != null && message.hasOwnProperty("aggfnoid")) + if (!$util.isInteger(message.aggfnoid)) + return "aggfnoid: integer expected"; + if (message.aggtype != null && message.hasOwnProperty("aggtype")) + if (!$util.isInteger(message.aggtype)) + return "aggtype: integer expected"; + if (message.aggcollid != null && message.hasOwnProperty("aggcollid")) + if (!$util.isInteger(message.aggcollid)) + return "aggcollid: integer expected"; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + if (!$util.isInteger(message.inputcollid)) + return "inputcollid: integer expected"; + if (message.aggtranstype != null && message.hasOwnProperty("aggtranstype")) + if (!$util.isInteger(message.aggtranstype)) + return "aggtranstype: integer expected"; + if (message.aggargtypes != null && message.hasOwnProperty("aggargtypes")) { + if (!Array.isArray(message.aggargtypes)) + return "aggargtypes: array expected"; + for (var i = 0; i < message.aggargtypes.length; ++i) { + var error = $root.pg_query.Node.verify(message.aggargtypes[i]); + if (error) + return "aggargtypes." + error; + } + } + if (message.aggdirectargs != null && message.hasOwnProperty("aggdirectargs")) { + if (!Array.isArray(message.aggdirectargs)) + return "aggdirectargs: array expected"; + for (var i = 0; i < message.aggdirectargs.length; ++i) { + var error = $root.pg_query.Node.verify(message.aggdirectargs[i]); + if (error) + return "aggdirectargs." + error; + } + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.aggorder != null && message.hasOwnProperty("aggorder")) { + if (!Array.isArray(message.aggorder)) + return "aggorder: array expected"; + for (var i = 0; i < message.aggorder.length; ++i) { + var error = $root.pg_query.Node.verify(message.aggorder[i]); + if (error) + return "aggorder." + error; + } + } + if (message.aggdistinct != null && message.hasOwnProperty("aggdistinct")) { + if (!Array.isArray(message.aggdistinct)) + return "aggdistinct: array expected"; + for (var i = 0; i < message.aggdistinct.length; ++i) { + var error = $root.pg_query.Node.verify(message.aggdistinct[i]); + if (error) + return "aggdistinct." + error; + } + } + if (message.aggfilter != null && message.hasOwnProperty("aggfilter")) { + var error = $root.pg_query.Node.verify(message.aggfilter); + if (error) + return "aggfilter." + error; + } + if (message.aggstar != null && message.hasOwnProperty("aggstar")) + if (typeof message.aggstar !== "boolean") + return "aggstar: boolean expected"; + if (message.aggvariadic != null && message.hasOwnProperty("aggvariadic")) + if (typeof message.aggvariadic !== "boolean") + return "aggvariadic: boolean expected"; + if (message.aggkind != null && message.hasOwnProperty("aggkind")) + if (!$util.isString(message.aggkind)) + return "aggkind: string expected"; + if (message.agglevelsup != null && message.hasOwnProperty("agglevelsup")) + if (!$util.isInteger(message.agglevelsup)) + return "agglevelsup: integer expected"; + if (message.aggsplit != null && message.hasOwnProperty("aggsplit")) + switch (message.aggsplit) { + default: + return "aggsplit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates an Aggref message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.Aggref + * @static + * @param {Object.} object Plain object + * @returns {pg_query.Aggref} Aggref + */ + Aggref.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.Aggref) + return object; + var message = new $root.pg_query.Aggref(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.Aggref.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.aggfnoid != null) + message.aggfnoid = object.aggfnoid >>> 0; + if (object.aggtype != null) + message.aggtype = object.aggtype >>> 0; + if (object.aggcollid != null) + message.aggcollid = object.aggcollid >>> 0; + if (object.inputcollid != null) + message.inputcollid = object.inputcollid >>> 0; + if (object.aggtranstype != null) + message.aggtranstype = object.aggtranstype >>> 0; + if (object.aggargtypes) { + if (!Array.isArray(object.aggargtypes)) + throw TypeError(".pg_query.Aggref.aggargtypes: array expected"); + message.aggargtypes = []; + for (var i = 0; i < object.aggargtypes.length; ++i) { + if (typeof object.aggargtypes[i] !== "object") + throw TypeError(".pg_query.Aggref.aggargtypes: object expected"); + message.aggargtypes[i] = $root.pg_query.Node.fromObject(object.aggargtypes[i]); + } + } + if (object.aggdirectargs) { + if (!Array.isArray(object.aggdirectargs)) + throw TypeError(".pg_query.Aggref.aggdirectargs: array expected"); + message.aggdirectargs = []; + for (var i = 0; i < object.aggdirectargs.length; ++i) { + if (typeof object.aggdirectargs[i] !== "object") + throw TypeError(".pg_query.Aggref.aggdirectargs: object expected"); + message.aggdirectargs[i] = $root.pg_query.Node.fromObject(object.aggdirectargs[i]); + } + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.Aggref.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.Aggref.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.aggorder) { + if (!Array.isArray(object.aggorder)) + throw TypeError(".pg_query.Aggref.aggorder: array expected"); + message.aggorder = []; + for (var i = 0; i < object.aggorder.length; ++i) { + if (typeof object.aggorder[i] !== "object") + throw TypeError(".pg_query.Aggref.aggorder: object expected"); + message.aggorder[i] = $root.pg_query.Node.fromObject(object.aggorder[i]); + } + } + if (object.aggdistinct) { + if (!Array.isArray(object.aggdistinct)) + throw TypeError(".pg_query.Aggref.aggdistinct: array expected"); + message.aggdistinct = []; + for (var i = 0; i < object.aggdistinct.length; ++i) { + if (typeof object.aggdistinct[i] !== "object") + throw TypeError(".pg_query.Aggref.aggdistinct: object expected"); + message.aggdistinct[i] = $root.pg_query.Node.fromObject(object.aggdistinct[i]); + } + } + if (object.aggfilter != null) { + if (typeof object.aggfilter !== "object") + throw TypeError(".pg_query.Aggref.aggfilter: object expected"); + message.aggfilter = $root.pg_query.Node.fromObject(object.aggfilter); + } + if (object.aggstar != null) + message.aggstar = Boolean(object.aggstar); + if (object.aggvariadic != null) + message.aggvariadic = Boolean(object.aggvariadic); + if (object.aggkind != null) + message.aggkind = String(object.aggkind); + if (object.agglevelsup != null) + message.agglevelsup = object.agglevelsup >>> 0; + switch (object.aggsplit) { + default: + if (typeof object.aggsplit === "number") { + message.aggsplit = object.aggsplit; + break; + } + break; + case "AGG_SPLIT_UNDEFINED": + case 0: + message.aggsplit = 0; + break; + case "AGGSPLIT_SIMPLE": + case 1: + message.aggsplit = 1; + break; + case "AGGSPLIT_INITIAL_SERIAL": + case 2: + message.aggsplit = 2; + break; + case "AGGSPLIT_FINAL_DESERIAL": + case 3: + message.aggsplit = 3; + break; + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from an Aggref message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.Aggref + * @static + * @param {pg_query.Aggref} message Aggref + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Aggref.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.aggargtypes = []; + object.aggdirectargs = []; + object.args = []; + object.aggorder = []; + object.aggdistinct = []; + } + if (options.defaults) { + object.xpr = null; + object.aggfnoid = 0; + object.aggtype = 0; + object.aggcollid = 0; + object.inputcollid = 0; + object.aggtranstype = 0; + object.aggfilter = null; + object.aggstar = false; + object.aggvariadic = false; + object.aggkind = ""; + object.agglevelsup = 0; + object.aggsplit = options.enums === String ? "AGG_SPLIT_UNDEFINED" : 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.aggfnoid != null && message.hasOwnProperty("aggfnoid")) + object.aggfnoid = message.aggfnoid; + if (message.aggtype != null && message.hasOwnProperty("aggtype")) + object.aggtype = message.aggtype; + if (message.aggcollid != null && message.hasOwnProperty("aggcollid")) + object.aggcollid = message.aggcollid; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + object.inputcollid = message.inputcollid; + if (message.aggtranstype != null && message.hasOwnProperty("aggtranstype")) + object.aggtranstype = message.aggtranstype; + if (message.aggargtypes && message.aggargtypes.length) { + object.aggargtypes = []; + for (var j = 0; j < message.aggargtypes.length; ++j) + object.aggargtypes[j] = $root.pg_query.Node.toObject(message.aggargtypes[j], options); + } + if (message.aggdirectargs && message.aggdirectargs.length) { + object.aggdirectargs = []; + for (var j = 0; j < message.aggdirectargs.length; ++j) + object.aggdirectargs[j] = $root.pg_query.Node.toObject(message.aggdirectargs[j], options); + } + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.aggorder && message.aggorder.length) { + object.aggorder = []; + for (var j = 0; j < message.aggorder.length; ++j) + object.aggorder[j] = $root.pg_query.Node.toObject(message.aggorder[j], options); + } + if (message.aggdistinct && message.aggdistinct.length) { + object.aggdistinct = []; + for (var j = 0; j < message.aggdistinct.length; ++j) + object.aggdistinct[j] = $root.pg_query.Node.toObject(message.aggdistinct[j], options); + } + if (message.aggfilter != null && message.hasOwnProperty("aggfilter")) + object.aggfilter = $root.pg_query.Node.toObject(message.aggfilter, options); + if (message.aggstar != null && message.hasOwnProperty("aggstar")) + object.aggstar = message.aggstar; + if (message.aggvariadic != null && message.hasOwnProperty("aggvariadic")) + object.aggvariadic = message.aggvariadic; + if (message.aggkind != null && message.hasOwnProperty("aggkind")) + object.aggkind = message.aggkind; + if (message.agglevelsup != null && message.hasOwnProperty("agglevelsup")) + object.agglevelsup = message.agglevelsup; + if (message.aggsplit != null && message.hasOwnProperty("aggsplit")) + object.aggsplit = options.enums === String ? $root.pg_query.AggSplit[message.aggsplit] === undefined ? message.aggsplit : $root.pg_query.AggSplit[message.aggsplit] : message.aggsplit; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Aggref to JSON. + * @function toJSON + * @memberof pg_query.Aggref + * @instance + * @returns {Object.} JSON object + */ + Aggref.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Aggref + * @function getTypeUrl + * @memberof pg_query.Aggref + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Aggref.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.Aggref"; + }; + + return Aggref; + })(); + + pg_query.GroupingFunc = (function() { + + /** + * Properties of a GroupingFunc. + * @memberof pg_query + * @interface IGroupingFunc + * @property {pg_query.INode|null} [xpr] GroupingFunc xpr + * @property {Array.|null} [args] GroupingFunc args + * @property {Array.|null} [refs] GroupingFunc refs + * @property {Array.|null} [cols] GroupingFunc cols + * @property {number|null} [agglevelsup] GroupingFunc agglevelsup + * @property {number|null} [location] GroupingFunc location + */ + + /** + * Constructs a new GroupingFunc. + * @memberof pg_query + * @classdesc Represents a GroupingFunc. + * @implements IGroupingFunc + * @constructor + * @param {pg_query.IGroupingFunc=} [properties] Properties to set + */ + function GroupingFunc(properties) { + this.args = []; + this.refs = []; + this.cols = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupingFunc xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.GroupingFunc + * @instance + */ + GroupingFunc.prototype.xpr = null; + + /** + * GroupingFunc args. + * @member {Array.} args + * @memberof pg_query.GroupingFunc + * @instance + */ + GroupingFunc.prototype.args = $util.emptyArray; + + /** + * GroupingFunc refs. + * @member {Array.} refs + * @memberof pg_query.GroupingFunc + * @instance + */ + GroupingFunc.prototype.refs = $util.emptyArray; + + /** + * GroupingFunc cols. + * @member {Array.} cols + * @memberof pg_query.GroupingFunc + * @instance + */ + GroupingFunc.prototype.cols = $util.emptyArray; + + /** + * GroupingFunc agglevelsup. + * @member {number} agglevelsup + * @memberof pg_query.GroupingFunc + * @instance + */ + GroupingFunc.prototype.agglevelsup = 0; + + /** + * GroupingFunc location. + * @member {number} location + * @memberof pg_query.GroupingFunc + * @instance + */ + GroupingFunc.prototype.location = 0; + + /** + * Creates a new GroupingFunc instance using the specified properties. + * @function create + * @memberof pg_query.GroupingFunc + * @static + * @param {pg_query.IGroupingFunc=} [properties] Properties to set + * @returns {pg_query.GroupingFunc} GroupingFunc instance + */ + GroupingFunc.create = function create(properties) { + return new GroupingFunc(properties); + }; + + /** + * Encodes the specified GroupingFunc message. Does not implicitly {@link pg_query.GroupingFunc.verify|verify} messages. + * @function encode + * @memberof pg_query.GroupingFunc + * @static + * @param {pg_query.IGroupingFunc} message GroupingFunc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupingFunc.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.refs != null && message.refs.length) + for (var i = 0; i < message.refs.length; ++i) + $root.pg_query.Node.encode(message.refs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cols != null && message.cols.length) + for (var i = 0; i < message.cols.length; ++i) + $root.pg_query.Node.encode(message.cols[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.agglevelsup != null && Object.hasOwnProperty.call(message, "agglevelsup")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.agglevelsup); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.location); + return writer; + }; + + /** + * Encodes the specified GroupingFunc message, length delimited. Does not implicitly {@link pg_query.GroupingFunc.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.GroupingFunc + * @static + * @param {pg_query.IGroupingFunc} message GroupingFunc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupingFunc.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupingFunc message from the specified reader or buffer. + * @function decode + * @memberof pg_query.GroupingFunc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.GroupingFunc} GroupingFunc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupingFunc.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.GroupingFunc(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.refs && message.refs.length)) + message.refs = []; + message.refs.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.cols && message.cols.length)) + message.cols = []; + message.cols.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.agglevelsup = reader.uint32(); + break; + } + case 6: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupingFunc message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.GroupingFunc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.GroupingFunc} GroupingFunc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupingFunc.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupingFunc message. + * @function verify + * @memberof pg_query.GroupingFunc + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupingFunc.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.refs != null && message.hasOwnProperty("refs")) { + if (!Array.isArray(message.refs)) + return "refs: array expected"; + for (var i = 0; i < message.refs.length; ++i) { + var error = $root.pg_query.Node.verify(message.refs[i]); + if (error) + return "refs." + error; + } + } + if (message.cols != null && message.hasOwnProperty("cols")) { + if (!Array.isArray(message.cols)) + return "cols: array expected"; + for (var i = 0; i < message.cols.length; ++i) { + var error = $root.pg_query.Node.verify(message.cols[i]); + if (error) + return "cols." + error; + } + } + if (message.agglevelsup != null && message.hasOwnProperty("agglevelsup")) + if (!$util.isInteger(message.agglevelsup)) + return "agglevelsup: integer expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a GroupingFunc message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.GroupingFunc + * @static + * @param {Object.} object Plain object + * @returns {pg_query.GroupingFunc} GroupingFunc + */ + GroupingFunc.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.GroupingFunc) + return object; + var message = new $root.pg_query.GroupingFunc(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.GroupingFunc.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.GroupingFunc.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.GroupingFunc.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.refs) { + if (!Array.isArray(object.refs)) + throw TypeError(".pg_query.GroupingFunc.refs: array expected"); + message.refs = []; + for (var i = 0; i < object.refs.length; ++i) { + if (typeof object.refs[i] !== "object") + throw TypeError(".pg_query.GroupingFunc.refs: object expected"); + message.refs[i] = $root.pg_query.Node.fromObject(object.refs[i]); + } + } + if (object.cols) { + if (!Array.isArray(object.cols)) + throw TypeError(".pg_query.GroupingFunc.cols: array expected"); + message.cols = []; + for (var i = 0; i < object.cols.length; ++i) { + if (typeof object.cols[i] !== "object") + throw TypeError(".pg_query.GroupingFunc.cols: object expected"); + message.cols[i] = $root.pg_query.Node.fromObject(object.cols[i]); + } + } + if (object.agglevelsup != null) + message.agglevelsup = object.agglevelsup >>> 0; + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a GroupingFunc message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.GroupingFunc + * @static + * @param {pg_query.GroupingFunc} message GroupingFunc + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupingFunc.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.args = []; + object.refs = []; + object.cols = []; + } + if (options.defaults) { + object.xpr = null; + object.agglevelsup = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.refs && message.refs.length) { + object.refs = []; + for (var j = 0; j < message.refs.length; ++j) + object.refs[j] = $root.pg_query.Node.toObject(message.refs[j], options); + } + if (message.cols && message.cols.length) { + object.cols = []; + for (var j = 0; j < message.cols.length; ++j) + object.cols[j] = $root.pg_query.Node.toObject(message.cols[j], options); + } + if (message.agglevelsup != null && message.hasOwnProperty("agglevelsup")) + object.agglevelsup = message.agglevelsup; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this GroupingFunc to JSON. + * @function toJSON + * @memberof pg_query.GroupingFunc + * @instance + * @returns {Object.} JSON object + */ + GroupingFunc.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupingFunc + * @function getTypeUrl + * @memberof pg_query.GroupingFunc + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupingFunc.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.GroupingFunc"; + }; + + return GroupingFunc; + })(); + + pg_query.WindowFunc = (function() { + + /** + * Properties of a WindowFunc. + * @memberof pg_query + * @interface IWindowFunc + * @property {pg_query.INode|null} [xpr] WindowFunc xpr + * @property {number|null} [winfnoid] WindowFunc winfnoid + * @property {number|null} [wintype] WindowFunc wintype + * @property {number|null} [wincollid] WindowFunc wincollid + * @property {number|null} [inputcollid] WindowFunc inputcollid + * @property {Array.|null} [args] WindowFunc args + * @property {pg_query.INode|null} [aggfilter] WindowFunc aggfilter + * @property {number|null} [winref] WindowFunc winref + * @property {boolean|null} [winstar] WindowFunc winstar + * @property {boolean|null} [winagg] WindowFunc winagg + * @property {number|null} [location] WindowFunc location + */ + + /** + * Constructs a new WindowFunc. + * @memberof pg_query + * @classdesc Represents a WindowFunc. + * @implements IWindowFunc + * @constructor + * @param {pg_query.IWindowFunc=} [properties] Properties to set + */ + function WindowFunc(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowFunc xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.WindowFunc + * @instance + */ + WindowFunc.prototype.xpr = null; + + /** + * WindowFunc winfnoid. + * @member {number} winfnoid + * @memberof pg_query.WindowFunc + * @instance + */ + WindowFunc.prototype.winfnoid = 0; + + /** + * WindowFunc wintype. + * @member {number} wintype + * @memberof pg_query.WindowFunc + * @instance + */ + WindowFunc.prototype.wintype = 0; + + /** + * WindowFunc wincollid. + * @member {number} wincollid + * @memberof pg_query.WindowFunc + * @instance + */ + WindowFunc.prototype.wincollid = 0; + + /** + * WindowFunc inputcollid. + * @member {number} inputcollid + * @memberof pg_query.WindowFunc + * @instance + */ + WindowFunc.prototype.inputcollid = 0; + + /** + * WindowFunc args. + * @member {Array.} args + * @memberof pg_query.WindowFunc + * @instance + */ + WindowFunc.prototype.args = $util.emptyArray; + + /** + * WindowFunc aggfilter. + * @member {pg_query.INode|null|undefined} aggfilter + * @memberof pg_query.WindowFunc + * @instance + */ + WindowFunc.prototype.aggfilter = null; + + /** + * WindowFunc winref. + * @member {number} winref + * @memberof pg_query.WindowFunc + * @instance + */ + WindowFunc.prototype.winref = 0; + + /** + * WindowFunc winstar. + * @member {boolean} winstar + * @memberof pg_query.WindowFunc + * @instance + */ + WindowFunc.prototype.winstar = false; + + /** + * WindowFunc winagg. + * @member {boolean} winagg + * @memberof pg_query.WindowFunc + * @instance + */ + WindowFunc.prototype.winagg = false; + + /** + * WindowFunc location. + * @member {number} location + * @memberof pg_query.WindowFunc + * @instance + */ + WindowFunc.prototype.location = 0; + + /** + * Creates a new WindowFunc instance using the specified properties. + * @function create + * @memberof pg_query.WindowFunc + * @static + * @param {pg_query.IWindowFunc=} [properties] Properties to set + * @returns {pg_query.WindowFunc} WindowFunc instance + */ + WindowFunc.create = function create(properties) { + return new WindowFunc(properties); + }; + + /** + * Encodes the specified WindowFunc message. Does not implicitly {@link pg_query.WindowFunc.verify|verify} messages. + * @function encode + * @memberof pg_query.WindowFunc + * @static + * @param {pg_query.IWindowFunc} message WindowFunc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowFunc.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.winfnoid != null && Object.hasOwnProperty.call(message, "winfnoid")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.winfnoid); + if (message.wintype != null && Object.hasOwnProperty.call(message, "wintype")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.wintype); + if (message.wincollid != null && Object.hasOwnProperty.call(message, "wincollid")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.wincollid); + if (message.inputcollid != null && Object.hasOwnProperty.call(message, "inputcollid")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.inputcollid); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.aggfilter != null && Object.hasOwnProperty.call(message, "aggfilter")) + $root.pg_query.Node.encode(message.aggfilter, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.winref != null && Object.hasOwnProperty.call(message, "winref")) + writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.winref); + if (message.winstar != null && Object.hasOwnProperty.call(message, "winstar")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.winstar); + if (message.winagg != null && Object.hasOwnProperty.call(message, "winagg")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.winagg); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.location); + return writer; + }; + + /** + * Encodes the specified WindowFunc message, length delimited. Does not implicitly {@link pg_query.WindowFunc.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.WindowFunc + * @static + * @param {pg_query.IWindowFunc} message WindowFunc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowFunc.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowFunc message from the specified reader or buffer. + * @function decode + * @memberof pg_query.WindowFunc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.WindowFunc} WindowFunc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowFunc.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.WindowFunc(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.winfnoid = reader.uint32(); + break; + } + case 3: { + message.wintype = reader.uint32(); + break; + } + case 4: { + message.wincollid = reader.uint32(); + break; + } + case 5: { + message.inputcollid = reader.uint32(); + break; + } + case 6: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + message.aggfilter = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 8: { + message.winref = reader.uint32(); + break; + } + case 9: { + message.winstar = reader.bool(); + break; + } + case 10: { + message.winagg = reader.bool(); + break; + } + case 11: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowFunc message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.WindowFunc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.WindowFunc} WindowFunc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowFunc.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowFunc message. + * @function verify + * @memberof pg_query.WindowFunc + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowFunc.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.winfnoid != null && message.hasOwnProperty("winfnoid")) + if (!$util.isInteger(message.winfnoid)) + return "winfnoid: integer expected"; + if (message.wintype != null && message.hasOwnProperty("wintype")) + if (!$util.isInteger(message.wintype)) + return "wintype: integer expected"; + if (message.wincollid != null && message.hasOwnProperty("wincollid")) + if (!$util.isInteger(message.wincollid)) + return "wincollid: integer expected"; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + if (!$util.isInteger(message.inputcollid)) + return "inputcollid: integer expected"; + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.aggfilter != null && message.hasOwnProperty("aggfilter")) { + var error = $root.pg_query.Node.verify(message.aggfilter); + if (error) + return "aggfilter." + error; + } + if (message.winref != null && message.hasOwnProperty("winref")) + if (!$util.isInteger(message.winref)) + return "winref: integer expected"; + if (message.winstar != null && message.hasOwnProperty("winstar")) + if (typeof message.winstar !== "boolean") + return "winstar: boolean expected"; + if (message.winagg != null && message.hasOwnProperty("winagg")) + if (typeof message.winagg !== "boolean") + return "winagg: boolean expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a WindowFunc message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.WindowFunc + * @static + * @param {Object.} object Plain object + * @returns {pg_query.WindowFunc} WindowFunc + */ + WindowFunc.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.WindowFunc) + return object; + var message = new $root.pg_query.WindowFunc(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.WindowFunc.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.winfnoid != null) + message.winfnoid = object.winfnoid >>> 0; + if (object.wintype != null) + message.wintype = object.wintype >>> 0; + if (object.wincollid != null) + message.wincollid = object.wincollid >>> 0; + if (object.inputcollid != null) + message.inputcollid = object.inputcollid >>> 0; + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.WindowFunc.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.WindowFunc.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.aggfilter != null) { + if (typeof object.aggfilter !== "object") + throw TypeError(".pg_query.WindowFunc.aggfilter: object expected"); + message.aggfilter = $root.pg_query.Node.fromObject(object.aggfilter); + } + if (object.winref != null) + message.winref = object.winref >>> 0; + if (object.winstar != null) + message.winstar = Boolean(object.winstar); + if (object.winagg != null) + message.winagg = Boolean(object.winagg); + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a WindowFunc message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.WindowFunc + * @static + * @param {pg_query.WindowFunc} message WindowFunc + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowFunc.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.xpr = null; + object.winfnoid = 0; + object.wintype = 0; + object.wincollid = 0; + object.inputcollid = 0; + object.aggfilter = null; + object.winref = 0; + object.winstar = false; + object.winagg = false; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.winfnoid != null && message.hasOwnProperty("winfnoid")) + object.winfnoid = message.winfnoid; + if (message.wintype != null && message.hasOwnProperty("wintype")) + object.wintype = message.wintype; + if (message.wincollid != null && message.hasOwnProperty("wincollid")) + object.wincollid = message.wincollid; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + object.inputcollid = message.inputcollid; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.aggfilter != null && message.hasOwnProperty("aggfilter")) + object.aggfilter = $root.pg_query.Node.toObject(message.aggfilter, options); + if (message.winref != null && message.hasOwnProperty("winref")) + object.winref = message.winref; + if (message.winstar != null && message.hasOwnProperty("winstar")) + object.winstar = message.winstar; + if (message.winagg != null && message.hasOwnProperty("winagg")) + object.winagg = message.winagg; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this WindowFunc to JSON. + * @function toJSON + * @memberof pg_query.WindowFunc + * @instance + * @returns {Object.} JSON object + */ + WindowFunc.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowFunc + * @function getTypeUrl + * @memberof pg_query.WindowFunc + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowFunc.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.WindowFunc"; + }; + + return WindowFunc; + })(); + + pg_query.SubscriptingRef = (function() { + + /** + * Properties of a SubscriptingRef. + * @memberof pg_query + * @interface ISubscriptingRef + * @property {pg_query.INode|null} [xpr] SubscriptingRef xpr + * @property {number|null} [refcontainertype] SubscriptingRef refcontainertype + * @property {number|null} [refelemtype] SubscriptingRef refelemtype + * @property {number|null} [reftypmod] SubscriptingRef reftypmod + * @property {number|null} [refcollid] SubscriptingRef refcollid + * @property {Array.|null} [refupperindexpr] SubscriptingRef refupperindexpr + * @property {Array.|null} [reflowerindexpr] SubscriptingRef reflowerindexpr + * @property {pg_query.INode|null} [refexpr] SubscriptingRef refexpr + * @property {pg_query.INode|null} [refassgnexpr] SubscriptingRef refassgnexpr + */ + + /** + * Constructs a new SubscriptingRef. + * @memberof pg_query + * @classdesc Represents a SubscriptingRef. + * @implements ISubscriptingRef + * @constructor + * @param {pg_query.ISubscriptingRef=} [properties] Properties to set + */ + function SubscriptingRef(properties) { + this.refupperindexpr = []; + this.reflowerindexpr = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubscriptingRef xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.SubscriptingRef + * @instance + */ + SubscriptingRef.prototype.xpr = null; + + /** + * SubscriptingRef refcontainertype. + * @member {number} refcontainertype + * @memberof pg_query.SubscriptingRef + * @instance + */ + SubscriptingRef.prototype.refcontainertype = 0; + + /** + * SubscriptingRef refelemtype. + * @member {number} refelemtype + * @memberof pg_query.SubscriptingRef + * @instance + */ + SubscriptingRef.prototype.refelemtype = 0; + + /** + * SubscriptingRef reftypmod. + * @member {number} reftypmod + * @memberof pg_query.SubscriptingRef + * @instance + */ + SubscriptingRef.prototype.reftypmod = 0; + + /** + * SubscriptingRef refcollid. + * @member {number} refcollid + * @memberof pg_query.SubscriptingRef + * @instance + */ + SubscriptingRef.prototype.refcollid = 0; + + /** + * SubscriptingRef refupperindexpr. + * @member {Array.} refupperindexpr + * @memberof pg_query.SubscriptingRef + * @instance + */ + SubscriptingRef.prototype.refupperindexpr = $util.emptyArray; + + /** + * SubscriptingRef reflowerindexpr. + * @member {Array.} reflowerindexpr + * @memberof pg_query.SubscriptingRef + * @instance + */ + SubscriptingRef.prototype.reflowerindexpr = $util.emptyArray; + + /** + * SubscriptingRef refexpr. + * @member {pg_query.INode|null|undefined} refexpr + * @memberof pg_query.SubscriptingRef + * @instance + */ + SubscriptingRef.prototype.refexpr = null; + + /** + * SubscriptingRef refassgnexpr. + * @member {pg_query.INode|null|undefined} refassgnexpr + * @memberof pg_query.SubscriptingRef + * @instance + */ + SubscriptingRef.prototype.refassgnexpr = null; + + /** + * Creates a new SubscriptingRef instance using the specified properties. + * @function create + * @memberof pg_query.SubscriptingRef + * @static + * @param {pg_query.ISubscriptingRef=} [properties] Properties to set + * @returns {pg_query.SubscriptingRef} SubscriptingRef instance + */ + SubscriptingRef.create = function create(properties) { + return new SubscriptingRef(properties); + }; + + /** + * Encodes the specified SubscriptingRef message. Does not implicitly {@link pg_query.SubscriptingRef.verify|verify} messages. + * @function encode + * @memberof pg_query.SubscriptingRef + * @static + * @param {pg_query.ISubscriptingRef} message SubscriptingRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriptingRef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.refcontainertype != null && Object.hasOwnProperty.call(message, "refcontainertype")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.refcontainertype); + if (message.refelemtype != null && Object.hasOwnProperty.call(message, "refelemtype")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.refelemtype); + if (message.reftypmod != null && Object.hasOwnProperty.call(message, "reftypmod")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.reftypmod); + if (message.refcollid != null && Object.hasOwnProperty.call(message, "refcollid")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.refcollid); + if (message.refupperindexpr != null && message.refupperindexpr.length) + for (var i = 0; i < message.refupperindexpr.length; ++i) + $root.pg_query.Node.encode(message.refupperindexpr[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.reflowerindexpr != null && message.reflowerindexpr.length) + for (var i = 0; i < message.reflowerindexpr.length; ++i) + $root.pg_query.Node.encode(message.reflowerindexpr[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.refexpr != null && Object.hasOwnProperty.call(message, "refexpr")) + $root.pg_query.Node.encode(message.refexpr, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.refassgnexpr != null && Object.hasOwnProperty.call(message, "refassgnexpr")) + $root.pg_query.Node.encode(message.refassgnexpr, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SubscriptingRef message, length delimited. Does not implicitly {@link pg_query.SubscriptingRef.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.SubscriptingRef + * @static + * @param {pg_query.ISubscriptingRef} message SubscriptingRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubscriptingRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubscriptingRef message from the specified reader or buffer. + * @function decode + * @memberof pg_query.SubscriptingRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.SubscriptingRef} SubscriptingRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriptingRef.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.SubscriptingRef(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.refcontainertype = reader.uint32(); + break; + } + case 3: { + message.refelemtype = reader.uint32(); + break; + } + case 4: { + message.reftypmod = reader.int32(); + break; + } + case 5: { + message.refcollid = reader.uint32(); + break; + } + case 6: { + if (!(message.refupperindexpr && message.refupperindexpr.length)) + message.refupperindexpr = []; + message.refupperindexpr.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.reflowerindexpr && message.reflowerindexpr.length)) + message.reflowerindexpr = []; + message.reflowerindexpr.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 8: { + message.refexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 9: { + message.refassgnexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubscriptingRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.SubscriptingRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.SubscriptingRef} SubscriptingRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubscriptingRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubscriptingRef message. + * @function verify + * @memberof pg_query.SubscriptingRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubscriptingRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.refcontainertype != null && message.hasOwnProperty("refcontainertype")) + if (!$util.isInteger(message.refcontainertype)) + return "refcontainertype: integer expected"; + if (message.refelemtype != null && message.hasOwnProperty("refelemtype")) + if (!$util.isInteger(message.refelemtype)) + return "refelemtype: integer expected"; + if (message.reftypmod != null && message.hasOwnProperty("reftypmod")) + if (!$util.isInteger(message.reftypmod)) + return "reftypmod: integer expected"; + if (message.refcollid != null && message.hasOwnProperty("refcollid")) + if (!$util.isInteger(message.refcollid)) + return "refcollid: integer expected"; + if (message.refupperindexpr != null && message.hasOwnProperty("refupperindexpr")) { + if (!Array.isArray(message.refupperindexpr)) + return "refupperindexpr: array expected"; + for (var i = 0; i < message.refupperindexpr.length; ++i) { + var error = $root.pg_query.Node.verify(message.refupperindexpr[i]); + if (error) + return "refupperindexpr." + error; + } + } + if (message.reflowerindexpr != null && message.hasOwnProperty("reflowerindexpr")) { + if (!Array.isArray(message.reflowerindexpr)) + return "reflowerindexpr: array expected"; + for (var i = 0; i < message.reflowerindexpr.length; ++i) { + var error = $root.pg_query.Node.verify(message.reflowerindexpr[i]); + if (error) + return "reflowerindexpr." + error; + } + } + if (message.refexpr != null && message.hasOwnProperty("refexpr")) { + var error = $root.pg_query.Node.verify(message.refexpr); + if (error) + return "refexpr." + error; + } + if (message.refassgnexpr != null && message.hasOwnProperty("refassgnexpr")) { + var error = $root.pg_query.Node.verify(message.refassgnexpr); + if (error) + return "refassgnexpr." + error; + } + return null; + }; + + /** + * Creates a SubscriptingRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.SubscriptingRef + * @static + * @param {Object.} object Plain object + * @returns {pg_query.SubscriptingRef} SubscriptingRef + */ + SubscriptingRef.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.SubscriptingRef) + return object; + var message = new $root.pg_query.SubscriptingRef(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.SubscriptingRef.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.refcontainertype != null) + message.refcontainertype = object.refcontainertype >>> 0; + if (object.refelemtype != null) + message.refelemtype = object.refelemtype >>> 0; + if (object.reftypmod != null) + message.reftypmod = object.reftypmod | 0; + if (object.refcollid != null) + message.refcollid = object.refcollid >>> 0; + if (object.refupperindexpr) { + if (!Array.isArray(object.refupperindexpr)) + throw TypeError(".pg_query.SubscriptingRef.refupperindexpr: array expected"); + message.refupperindexpr = []; + for (var i = 0; i < object.refupperindexpr.length; ++i) { + if (typeof object.refupperindexpr[i] !== "object") + throw TypeError(".pg_query.SubscriptingRef.refupperindexpr: object expected"); + message.refupperindexpr[i] = $root.pg_query.Node.fromObject(object.refupperindexpr[i]); + } + } + if (object.reflowerindexpr) { + if (!Array.isArray(object.reflowerindexpr)) + throw TypeError(".pg_query.SubscriptingRef.reflowerindexpr: array expected"); + message.reflowerindexpr = []; + for (var i = 0; i < object.reflowerindexpr.length; ++i) { + if (typeof object.reflowerindexpr[i] !== "object") + throw TypeError(".pg_query.SubscriptingRef.reflowerindexpr: object expected"); + message.reflowerindexpr[i] = $root.pg_query.Node.fromObject(object.reflowerindexpr[i]); + } + } + if (object.refexpr != null) { + if (typeof object.refexpr !== "object") + throw TypeError(".pg_query.SubscriptingRef.refexpr: object expected"); + message.refexpr = $root.pg_query.Node.fromObject(object.refexpr); + } + if (object.refassgnexpr != null) { + if (typeof object.refassgnexpr !== "object") + throw TypeError(".pg_query.SubscriptingRef.refassgnexpr: object expected"); + message.refassgnexpr = $root.pg_query.Node.fromObject(object.refassgnexpr); + } + return message; + }; + + /** + * Creates a plain object from a SubscriptingRef message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.SubscriptingRef + * @static + * @param {pg_query.SubscriptingRef} message SubscriptingRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubscriptingRef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.refupperindexpr = []; + object.reflowerindexpr = []; + } + if (options.defaults) { + object.xpr = null; + object.refcontainertype = 0; + object.refelemtype = 0; + object.reftypmod = 0; + object.refcollid = 0; + object.refexpr = null; + object.refassgnexpr = null; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.refcontainertype != null && message.hasOwnProperty("refcontainertype")) + object.refcontainertype = message.refcontainertype; + if (message.refelemtype != null && message.hasOwnProperty("refelemtype")) + object.refelemtype = message.refelemtype; + if (message.reftypmod != null && message.hasOwnProperty("reftypmod")) + object.reftypmod = message.reftypmod; + if (message.refcollid != null && message.hasOwnProperty("refcollid")) + object.refcollid = message.refcollid; + if (message.refupperindexpr && message.refupperindexpr.length) { + object.refupperindexpr = []; + for (var j = 0; j < message.refupperindexpr.length; ++j) + object.refupperindexpr[j] = $root.pg_query.Node.toObject(message.refupperindexpr[j], options); + } + if (message.reflowerindexpr && message.reflowerindexpr.length) { + object.reflowerindexpr = []; + for (var j = 0; j < message.reflowerindexpr.length; ++j) + object.reflowerindexpr[j] = $root.pg_query.Node.toObject(message.reflowerindexpr[j], options); + } + if (message.refexpr != null && message.hasOwnProperty("refexpr")) + object.refexpr = $root.pg_query.Node.toObject(message.refexpr, options); + if (message.refassgnexpr != null && message.hasOwnProperty("refassgnexpr")) + object.refassgnexpr = $root.pg_query.Node.toObject(message.refassgnexpr, options); + return object; + }; + + /** + * Converts this SubscriptingRef to JSON. + * @function toJSON + * @memberof pg_query.SubscriptingRef + * @instance + * @returns {Object.} JSON object + */ + SubscriptingRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubscriptingRef + * @function getTypeUrl + * @memberof pg_query.SubscriptingRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubscriptingRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.SubscriptingRef"; + }; + + return SubscriptingRef; + })(); + + pg_query.FuncExpr = (function() { + + /** + * Properties of a FuncExpr. + * @memberof pg_query + * @interface IFuncExpr + * @property {pg_query.INode|null} [xpr] FuncExpr xpr + * @property {number|null} [funcid] FuncExpr funcid + * @property {number|null} [funcresulttype] FuncExpr funcresulttype + * @property {boolean|null} [funcretset] FuncExpr funcretset + * @property {boolean|null} [funcvariadic] FuncExpr funcvariadic + * @property {pg_query.CoercionForm|null} [funcformat] FuncExpr funcformat + * @property {number|null} [funccollid] FuncExpr funccollid + * @property {number|null} [inputcollid] FuncExpr inputcollid + * @property {Array.|null} [args] FuncExpr args + * @property {number|null} [location] FuncExpr location + */ + + /** + * Constructs a new FuncExpr. + * @memberof pg_query + * @classdesc Represents a FuncExpr. + * @implements IFuncExpr + * @constructor + * @param {pg_query.IFuncExpr=} [properties] Properties to set + */ + function FuncExpr(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FuncExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.FuncExpr + * @instance + */ + FuncExpr.prototype.xpr = null; + + /** + * FuncExpr funcid. + * @member {number} funcid + * @memberof pg_query.FuncExpr + * @instance + */ + FuncExpr.prototype.funcid = 0; + + /** + * FuncExpr funcresulttype. + * @member {number} funcresulttype + * @memberof pg_query.FuncExpr + * @instance + */ + FuncExpr.prototype.funcresulttype = 0; + + /** + * FuncExpr funcretset. + * @member {boolean} funcretset + * @memberof pg_query.FuncExpr + * @instance + */ + FuncExpr.prototype.funcretset = false; + + /** + * FuncExpr funcvariadic. + * @member {boolean} funcvariadic + * @memberof pg_query.FuncExpr + * @instance + */ + FuncExpr.prototype.funcvariadic = false; + + /** + * FuncExpr funcformat. + * @member {pg_query.CoercionForm} funcformat + * @memberof pg_query.FuncExpr + * @instance + */ + FuncExpr.prototype.funcformat = 0; + + /** + * FuncExpr funccollid. + * @member {number} funccollid + * @memberof pg_query.FuncExpr + * @instance + */ + FuncExpr.prototype.funccollid = 0; + + /** + * FuncExpr inputcollid. + * @member {number} inputcollid + * @memberof pg_query.FuncExpr + * @instance + */ + FuncExpr.prototype.inputcollid = 0; + + /** + * FuncExpr args. + * @member {Array.} args + * @memberof pg_query.FuncExpr + * @instance + */ + FuncExpr.prototype.args = $util.emptyArray; + + /** + * FuncExpr location. + * @member {number} location + * @memberof pg_query.FuncExpr + * @instance + */ + FuncExpr.prototype.location = 0; + + /** + * Creates a new FuncExpr instance using the specified properties. + * @function create + * @memberof pg_query.FuncExpr + * @static + * @param {pg_query.IFuncExpr=} [properties] Properties to set + * @returns {pg_query.FuncExpr} FuncExpr instance + */ + FuncExpr.create = function create(properties) { + return new FuncExpr(properties); + }; + + /** + * Encodes the specified FuncExpr message. Does not implicitly {@link pg_query.FuncExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.FuncExpr + * @static + * @param {pg_query.IFuncExpr} message FuncExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FuncExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.funcid != null && Object.hasOwnProperty.call(message, "funcid")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.funcid); + if (message.funcresulttype != null && Object.hasOwnProperty.call(message, "funcresulttype")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.funcresulttype); + if (message.funcretset != null && Object.hasOwnProperty.call(message, "funcretset")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.funcretset); + if (message.funcvariadic != null && Object.hasOwnProperty.call(message, "funcvariadic")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.funcvariadic); + if (message.funcformat != null && Object.hasOwnProperty.call(message, "funcformat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.funcformat); + if (message.funccollid != null && Object.hasOwnProperty.call(message, "funccollid")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.funccollid); + if (message.inputcollid != null && Object.hasOwnProperty.call(message, "inputcollid")) + writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.inputcollid); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.location); + return writer; + }; + + /** + * Encodes the specified FuncExpr message, length delimited. Does not implicitly {@link pg_query.FuncExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.FuncExpr + * @static + * @param {pg_query.IFuncExpr} message FuncExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FuncExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FuncExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.FuncExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.FuncExpr} FuncExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FuncExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.FuncExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.funcid = reader.uint32(); + break; + } + case 3: { + message.funcresulttype = reader.uint32(); + break; + } + case 4: { + message.funcretset = reader.bool(); + break; + } + case 5: { + message.funcvariadic = reader.bool(); + break; + } + case 6: { + message.funcformat = reader.int32(); + break; + } + case 7: { + message.funccollid = reader.uint32(); + break; + } + case 8: { + message.inputcollid = reader.uint32(); + break; + } + case 9: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 10: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FuncExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.FuncExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.FuncExpr} FuncExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FuncExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FuncExpr message. + * @function verify + * @memberof pg_query.FuncExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FuncExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.funcid != null && message.hasOwnProperty("funcid")) + if (!$util.isInteger(message.funcid)) + return "funcid: integer expected"; + if (message.funcresulttype != null && message.hasOwnProperty("funcresulttype")) + if (!$util.isInteger(message.funcresulttype)) + return "funcresulttype: integer expected"; + if (message.funcretset != null && message.hasOwnProperty("funcretset")) + if (typeof message.funcretset !== "boolean") + return "funcretset: boolean expected"; + if (message.funcvariadic != null && message.hasOwnProperty("funcvariadic")) + if (typeof message.funcvariadic !== "boolean") + return "funcvariadic: boolean expected"; + if (message.funcformat != null && message.hasOwnProperty("funcformat")) + switch (message.funcformat) { + default: + return "funcformat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.funccollid != null && message.hasOwnProperty("funccollid")) + if (!$util.isInteger(message.funccollid)) + return "funccollid: integer expected"; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + if (!$util.isInteger(message.inputcollid)) + return "inputcollid: integer expected"; + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a FuncExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.FuncExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.FuncExpr} FuncExpr + */ + FuncExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.FuncExpr) + return object; + var message = new $root.pg_query.FuncExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.FuncExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.funcid != null) + message.funcid = object.funcid >>> 0; + if (object.funcresulttype != null) + message.funcresulttype = object.funcresulttype >>> 0; + if (object.funcretset != null) + message.funcretset = Boolean(object.funcretset); + if (object.funcvariadic != null) + message.funcvariadic = Boolean(object.funcvariadic); + switch (object.funcformat) { + default: + if (typeof object.funcformat === "number") { + message.funcformat = object.funcformat; + break; + } + break; + case "COERCION_FORM_UNDEFINED": + case 0: + message.funcformat = 0; + break; + case "COERCE_EXPLICIT_CALL": + case 1: + message.funcformat = 1; + break; + case "COERCE_EXPLICIT_CAST": + case 2: + message.funcformat = 2; + break; + case "COERCE_IMPLICIT_CAST": + case 3: + message.funcformat = 3; + break; + } + if (object.funccollid != null) + message.funccollid = object.funccollid >>> 0; + if (object.inputcollid != null) + message.inputcollid = object.inputcollid >>> 0; + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.FuncExpr.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.FuncExpr.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a FuncExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.FuncExpr + * @static + * @param {pg_query.FuncExpr} message FuncExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FuncExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.xpr = null; + object.funcid = 0; + object.funcresulttype = 0; + object.funcretset = false; + object.funcvariadic = false; + object.funcformat = options.enums === String ? "COERCION_FORM_UNDEFINED" : 0; + object.funccollid = 0; + object.inputcollid = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.funcid != null && message.hasOwnProperty("funcid")) + object.funcid = message.funcid; + if (message.funcresulttype != null && message.hasOwnProperty("funcresulttype")) + object.funcresulttype = message.funcresulttype; + if (message.funcretset != null && message.hasOwnProperty("funcretset")) + object.funcretset = message.funcretset; + if (message.funcvariadic != null && message.hasOwnProperty("funcvariadic")) + object.funcvariadic = message.funcvariadic; + if (message.funcformat != null && message.hasOwnProperty("funcformat")) + object.funcformat = options.enums === String ? $root.pg_query.CoercionForm[message.funcformat] === undefined ? message.funcformat : $root.pg_query.CoercionForm[message.funcformat] : message.funcformat; + if (message.funccollid != null && message.hasOwnProperty("funccollid")) + object.funccollid = message.funccollid; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + object.inputcollid = message.inputcollid; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this FuncExpr to JSON. + * @function toJSON + * @memberof pg_query.FuncExpr + * @instance + * @returns {Object.} JSON object + */ + FuncExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FuncExpr + * @function getTypeUrl + * @memberof pg_query.FuncExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FuncExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.FuncExpr"; + }; + + return FuncExpr; + })(); + + pg_query.NamedArgExpr = (function() { + + /** + * Properties of a NamedArgExpr. + * @memberof pg_query + * @interface INamedArgExpr + * @property {pg_query.INode|null} [xpr] NamedArgExpr xpr + * @property {pg_query.INode|null} [arg] NamedArgExpr arg + * @property {string|null} [name] NamedArgExpr name + * @property {number|null} [argnumber] NamedArgExpr argnumber + * @property {number|null} [location] NamedArgExpr location + */ + + /** + * Constructs a new NamedArgExpr. + * @memberof pg_query + * @classdesc Represents a NamedArgExpr. + * @implements INamedArgExpr + * @constructor + * @param {pg_query.INamedArgExpr=} [properties] Properties to set + */ + function NamedArgExpr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamedArgExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.NamedArgExpr + * @instance + */ + NamedArgExpr.prototype.xpr = null; + + /** + * NamedArgExpr arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.NamedArgExpr + * @instance + */ + NamedArgExpr.prototype.arg = null; + + /** + * NamedArgExpr name. + * @member {string} name + * @memberof pg_query.NamedArgExpr + * @instance + */ + NamedArgExpr.prototype.name = ""; + + /** + * NamedArgExpr argnumber. + * @member {number} argnumber + * @memberof pg_query.NamedArgExpr + * @instance + */ + NamedArgExpr.prototype.argnumber = 0; + + /** + * NamedArgExpr location. + * @member {number} location + * @memberof pg_query.NamedArgExpr + * @instance + */ + NamedArgExpr.prototype.location = 0; + + /** + * Creates a new NamedArgExpr instance using the specified properties. + * @function create + * @memberof pg_query.NamedArgExpr + * @static + * @param {pg_query.INamedArgExpr=} [properties] Properties to set + * @returns {pg_query.NamedArgExpr} NamedArgExpr instance + */ + NamedArgExpr.create = function create(properties) { + return new NamedArgExpr(properties); + }; + + /** + * Encodes the specified NamedArgExpr message. Does not implicitly {@link pg_query.NamedArgExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.NamedArgExpr + * @static + * @param {pg_query.INamedArgExpr} message NamedArgExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamedArgExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.argnumber != null && Object.hasOwnProperty.call(message, "argnumber")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.argnumber); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified NamedArgExpr message, length delimited. Does not implicitly {@link pg_query.NamedArgExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.NamedArgExpr + * @static + * @param {pg_query.INamedArgExpr} message NamedArgExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamedArgExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamedArgExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.NamedArgExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.NamedArgExpr} NamedArgExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamedArgExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.NamedArgExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 4: { + message.argnumber = reader.int32(); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NamedArgExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.NamedArgExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.NamedArgExpr} NamedArgExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamedArgExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamedArgExpr message. + * @function verify + * @memberof pg_query.NamedArgExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamedArgExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.argnumber != null && message.hasOwnProperty("argnumber")) + if (!$util.isInteger(message.argnumber)) + return "argnumber: integer expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a NamedArgExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.NamedArgExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.NamedArgExpr} NamedArgExpr + */ + NamedArgExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.NamedArgExpr) + return object; + var message = new $root.pg_query.NamedArgExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.NamedArgExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.NamedArgExpr.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.name != null) + message.name = String(object.name); + if (object.argnumber != null) + message.argnumber = object.argnumber | 0; + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a NamedArgExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.NamedArgExpr + * @static + * @param {pg_query.NamedArgExpr} message NamedArgExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamedArgExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.arg = null; + object.name = ""; + object.argnumber = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.argnumber != null && message.hasOwnProperty("argnumber")) + object.argnumber = message.argnumber; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this NamedArgExpr to JSON. + * @function toJSON + * @memberof pg_query.NamedArgExpr + * @instance + * @returns {Object.} JSON object + */ + NamedArgExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamedArgExpr + * @function getTypeUrl + * @memberof pg_query.NamedArgExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamedArgExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.NamedArgExpr"; + }; + + return NamedArgExpr; + })(); + + pg_query.OpExpr = (function() { + + /** + * Properties of an OpExpr. + * @memberof pg_query + * @interface IOpExpr + * @property {pg_query.INode|null} [xpr] OpExpr xpr + * @property {number|null} [opno] OpExpr opno + * @property {number|null} [opfuncid] OpExpr opfuncid + * @property {number|null} [opresulttype] OpExpr opresulttype + * @property {boolean|null} [opretset] OpExpr opretset + * @property {number|null} [opcollid] OpExpr opcollid + * @property {number|null} [inputcollid] OpExpr inputcollid + * @property {Array.|null} [args] OpExpr args + * @property {number|null} [location] OpExpr location + */ + + /** + * Constructs a new OpExpr. + * @memberof pg_query + * @classdesc Represents an OpExpr. + * @implements IOpExpr + * @constructor + * @param {pg_query.IOpExpr=} [properties] Properties to set + */ + function OpExpr(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.OpExpr + * @instance + */ + OpExpr.prototype.xpr = null; + + /** + * OpExpr opno. + * @member {number} opno + * @memberof pg_query.OpExpr + * @instance + */ + OpExpr.prototype.opno = 0; + + /** + * OpExpr opfuncid. + * @member {number} opfuncid + * @memberof pg_query.OpExpr + * @instance + */ + OpExpr.prototype.opfuncid = 0; + + /** + * OpExpr opresulttype. + * @member {number} opresulttype + * @memberof pg_query.OpExpr + * @instance + */ + OpExpr.prototype.opresulttype = 0; + + /** + * OpExpr opretset. + * @member {boolean} opretset + * @memberof pg_query.OpExpr + * @instance + */ + OpExpr.prototype.opretset = false; + + /** + * OpExpr opcollid. + * @member {number} opcollid + * @memberof pg_query.OpExpr + * @instance + */ + OpExpr.prototype.opcollid = 0; + + /** + * OpExpr inputcollid. + * @member {number} inputcollid + * @memberof pg_query.OpExpr + * @instance + */ + OpExpr.prototype.inputcollid = 0; + + /** + * OpExpr args. + * @member {Array.} args + * @memberof pg_query.OpExpr + * @instance + */ + OpExpr.prototype.args = $util.emptyArray; + + /** + * OpExpr location. + * @member {number} location + * @memberof pg_query.OpExpr + * @instance + */ + OpExpr.prototype.location = 0; + + /** + * Creates a new OpExpr instance using the specified properties. + * @function create + * @memberof pg_query.OpExpr + * @static + * @param {pg_query.IOpExpr=} [properties] Properties to set + * @returns {pg_query.OpExpr} OpExpr instance + */ + OpExpr.create = function create(properties) { + return new OpExpr(properties); + }; + + /** + * Encodes the specified OpExpr message. Does not implicitly {@link pg_query.OpExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.OpExpr + * @static + * @param {pg_query.IOpExpr} message OpExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.opno != null && Object.hasOwnProperty.call(message, "opno")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.opno); + if (message.opfuncid != null && Object.hasOwnProperty.call(message, "opfuncid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.opfuncid); + if (message.opresulttype != null && Object.hasOwnProperty.call(message, "opresulttype")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.opresulttype); + if (message.opretset != null && Object.hasOwnProperty.call(message, "opretset")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.opretset); + if (message.opcollid != null && Object.hasOwnProperty.call(message, "opcollid")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.opcollid); + if (message.inputcollid != null && Object.hasOwnProperty.call(message, "inputcollid")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.inputcollid); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.location); + return writer; + }; + + /** + * Encodes the specified OpExpr message, length delimited. Does not implicitly {@link pg_query.OpExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.OpExpr + * @static + * @param {pg_query.IOpExpr} message OpExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.OpExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.OpExpr} OpExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.OpExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.opno = reader.uint32(); + break; + } + case 3: { + message.opfuncid = reader.uint32(); + break; + } + case 4: { + message.opresulttype = reader.uint32(); + break; + } + case 5: { + message.opretset = reader.bool(); + break; + } + case 6: { + message.opcollid = reader.uint32(); + break; + } + case 7: { + message.inputcollid = reader.uint32(); + break; + } + case 8: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 9: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.OpExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.OpExpr} OpExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpExpr message. + * @function verify + * @memberof pg_query.OpExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.opno != null && message.hasOwnProperty("opno")) + if (!$util.isInteger(message.opno)) + return "opno: integer expected"; + if (message.opfuncid != null && message.hasOwnProperty("opfuncid")) + if (!$util.isInteger(message.opfuncid)) + return "opfuncid: integer expected"; + if (message.opresulttype != null && message.hasOwnProperty("opresulttype")) + if (!$util.isInteger(message.opresulttype)) + return "opresulttype: integer expected"; + if (message.opretset != null && message.hasOwnProperty("opretset")) + if (typeof message.opretset !== "boolean") + return "opretset: boolean expected"; + if (message.opcollid != null && message.hasOwnProperty("opcollid")) + if (!$util.isInteger(message.opcollid)) + return "opcollid: integer expected"; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + if (!$util.isInteger(message.inputcollid)) + return "inputcollid: integer expected"; + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates an OpExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.OpExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.OpExpr} OpExpr + */ + OpExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.OpExpr) + return object; + var message = new $root.pg_query.OpExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.OpExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.opno != null) + message.opno = object.opno >>> 0; + if (object.opfuncid != null) + message.opfuncid = object.opfuncid >>> 0; + if (object.opresulttype != null) + message.opresulttype = object.opresulttype >>> 0; + if (object.opretset != null) + message.opretset = Boolean(object.opretset); + if (object.opcollid != null) + message.opcollid = object.opcollid >>> 0; + if (object.inputcollid != null) + message.inputcollid = object.inputcollid >>> 0; + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.OpExpr.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.OpExpr.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from an OpExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.OpExpr + * @static + * @param {pg_query.OpExpr} message OpExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.xpr = null; + object.opno = 0; + object.opfuncid = 0; + object.opresulttype = 0; + object.opretset = false; + object.opcollid = 0; + object.inputcollid = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.opno != null && message.hasOwnProperty("opno")) + object.opno = message.opno; + if (message.opfuncid != null && message.hasOwnProperty("opfuncid")) + object.opfuncid = message.opfuncid; + if (message.opresulttype != null && message.hasOwnProperty("opresulttype")) + object.opresulttype = message.opresulttype; + if (message.opretset != null && message.hasOwnProperty("opretset")) + object.opretset = message.opretset; + if (message.opcollid != null && message.hasOwnProperty("opcollid")) + object.opcollid = message.opcollid; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + object.inputcollid = message.inputcollid; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this OpExpr to JSON. + * @function toJSON + * @memberof pg_query.OpExpr + * @instance + * @returns {Object.} JSON object + */ + OpExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OpExpr + * @function getTypeUrl + * @memberof pg_query.OpExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.OpExpr"; + }; + + return OpExpr; + })(); + + pg_query.DistinctExpr = (function() { + + /** + * Properties of a DistinctExpr. + * @memberof pg_query + * @interface IDistinctExpr + * @property {pg_query.INode|null} [xpr] DistinctExpr xpr + * @property {number|null} [opno] DistinctExpr opno + * @property {number|null} [opfuncid] DistinctExpr opfuncid + * @property {number|null} [opresulttype] DistinctExpr opresulttype + * @property {boolean|null} [opretset] DistinctExpr opretset + * @property {number|null} [opcollid] DistinctExpr opcollid + * @property {number|null} [inputcollid] DistinctExpr inputcollid + * @property {Array.|null} [args] DistinctExpr args + * @property {number|null} [location] DistinctExpr location + */ + + /** + * Constructs a new DistinctExpr. + * @memberof pg_query + * @classdesc Represents a DistinctExpr. + * @implements IDistinctExpr + * @constructor + * @param {pg_query.IDistinctExpr=} [properties] Properties to set + */ + function DistinctExpr(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DistinctExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.DistinctExpr + * @instance + */ + DistinctExpr.prototype.xpr = null; + + /** + * DistinctExpr opno. + * @member {number} opno + * @memberof pg_query.DistinctExpr + * @instance + */ + DistinctExpr.prototype.opno = 0; + + /** + * DistinctExpr opfuncid. + * @member {number} opfuncid + * @memberof pg_query.DistinctExpr + * @instance + */ + DistinctExpr.prototype.opfuncid = 0; + + /** + * DistinctExpr opresulttype. + * @member {number} opresulttype + * @memberof pg_query.DistinctExpr + * @instance + */ + DistinctExpr.prototype.opresulttype = 0; + + /** + * DistinctExpr opretset. + * @member {boolean} opretset + * @memberof pg_query.DistinctExpr + * @instance + */ + DistinctExpr.prototype.opretset = false; + + /** + * DistinctExpr opcollid. + * @member {number} opcollid + * @memberof pg_query.DistinctExpr + * @instance + */ + DistinctExpr.prototype.opcollid = 0; + + /** + * DistinctExpr inputcollid. + * @member {number} inputcollid + * @memberof pg_query.DistinctExpr + * @instance + */ + DistinctExpr.prototype.inputcollid = 0; + + /** + * DistinctExpr args. + * @member {Array.} args + * @memberof pg_query.DistinctExpr + * @instance + */ + DistinctExpr.prototype.args = $util.emptyArray; + + /** + * DistinctExpr location. + * @member {number} location + * @memberof pg_query.DistinctExpr + * @instance + */ + DistinctExpr.prototype.location = 0; + + /** + * Creates a new DistinctExpr instance using the specified properties. + * @function create + * @memberof pg_query.DistinctExpr + * @static + * @param {pg_query.IDistinctExpr=} [properties] Properties to set + * @returns {pg_query.DistinctExpr} DistinctExpr instance + */ + DistinctExpr.create = function create(properties) { + return new DistinctExpr(properties); + }; + + /** + * Encodes the specified DistinctExpr message. Does not implicitly {@link pg_query.DistinctExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.DistinctExpr + * @static + * @param {pg_query.IDistinctExpr} message DistinctExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DistinctExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.opno != null && Object.hasOwnProperty.call(message, "opno")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.opno); + if (message.opfuncid != null && Object.hasOwnProperty.call(message, "opfuncid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.opfuncid); + if (message.opresulttype != null && Object.hasOwnProperty.call(message, "opresulttype")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.opresulttype); + if (message.opretset != null && Object.hasOwnProperty.call(message, "opretset")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.opretset); + if (message.opcollid != null && Object.hasOwnProperty.call(message, "opcollid")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.opcollid); + if (message.inputcollid != null && Object.hasOwnProperty.call(message, "inputcollid")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.inputcollid); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.location); + return writer; + }; + + /** + * Encodes the specified DistinctExpr message, length delimited. Does not implicitly {@link pg_query.DistinctExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DistinctExpr + * @static + * @param {pg_query.IDistinctExpr} message DistinctExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DistinctExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DistinctExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DistinctExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DistinctExpr} DistinctExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DistinctExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DistinctExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.opno = reader.uint32(); + break; + } + case 3: { + message.opfuncid = reader.uint32(); + break; + } + case 4: { + message.opresulttype = reader.uint32(); + break; + } + case 5: { + message.opretset = reader.bool(); + break; + } + case 6: { + message.opcollid = reader.uint32(); + break; + } + case 7: { + message.inputcollid = reader.uint32(); + break; + } + case 8: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 9: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DistinctExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DistinctExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DistinctExpr} DistinctExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DistinctExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DistinctExpr message. + * @function verify + * @memberof pg_query.DistinctExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DistinctExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.opno != null && message.hasOwnProperty("opno")) + if (!$util.isInteger(message.opno)) + return "opno: integer expected"; + if (message.opfuncid != null && message.hasOwnProperty("opfuncid")) + if (!$util.isInteger(message.opfuncid)) + return "opfuncid: integer expected"; + if (message.opresulttype != null && message.hasOwnProperty("opresulttype")) + if (!$util.isInteger(message.opresulttype)) + return "opresulttype: integer expected"; + if (message.opretset != null && message.hasOwnProperty("opretset")) + if (typeof message.opretset !== "boolean") + return "opretset: boolean expected"; + if (message.opcollid != null && message.hasOwnProperty("opcollid")) + if (!$util.isInteger(message.opcollid)) + return "opcollid: integer expected"; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + if (!$util.isInteger(message.inputcollid)) + return "inputcollid: integer expected"; + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a DistinctExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DistinctExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DistinctExpr} DistinctExpr + */ + DistinctExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DistinctExpr) + return object; + var message = new $root.pg_query.DistinctExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.DistinctExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.opno != null) + message.opno = object.opno >>> 0; + if (object.opfuncid != null) + message.opfuncid = object.opfuncid >>> 0; + if (object.opresulttype != null) + message.opresulttype = object.opresulttype >>> 0; + if (object.opretset != null) + message.opretset = Boolean(object.opretset); + if (object.opcollid != null) + message.opcollid = object.opcollid >>> 0; + if (object.inputcollid != null) + message.inputcollid = object.inputcollid >>> 0; + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.DistinctExpr.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.DistinctExpr.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a DistinctExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DistinctExpr + * @static + * @param {pg_query.DistinctExpr} message DistinctExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DistinctExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.xpr = null; + object.opno = 0; + object.opfuncid = 0; + object.opresulttype = 0; + object.opretset = false; + object.opcollid = 0; + object.inputcollid = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.opno != null && message.hasOwnProperty("opno")) + object.opno = message.opno; + if (message.opfuncid != null && message.hasOwnProperty("opfuncid")) + object.opfuncid = message.opfuncid; + if (message.opresulttype != null && message.hasOwnProperty("opresulttype")) + object.opresulttype = message.opresulttype; + if (message.opretset != null && message.hasOwnProperty("opretset")) + object.opretset = message.opretset; + if (message.opcollid != null && message.hasOwnProperty("opcollid")) + object.opcollid = message.opcollid; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + object.inputcollid = message.inputcollid; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this DistinctExpr to JSON. + * @function toJSON + * @memberof pg_query.DistinctExpr + * @instance + * @returns {Object.} JSON object + */ + DistinctExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DistinctExpr + * @function getTypeUrl + * @memberof pg_query.DistinctExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DistinctExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DistinctExpr"; + }; + + return DistinctExpr; + })(); + + pg_query.NullIfExpr = (function() { + + /** + * Properties of a NullIfExpr. + * @memberof pg_query + * @interface INullIfExpr + * @property {pg_query.INode|null} [xpr] NullIfExpr xpr + * @property {number|null} [opno] NullIfExpr opno + * @property {number|null} [opfuncid] NullIfExpr opfuncid + * @property {number|null} [opresulttype] NullIfExpr opresulttype + * @property {boolean|null} [opretset] NullIfExpr opretset + * @property {number|null} [opcollid] NullIfExpr opcollid + * @property {number|null} [inputcollid] NullIfExpr inputcollid + * @property {Array.|null} [args] NullIfExpr args + * @property {number|null} [location] NullIfExpr location + */ + + /** + * Constructs a new NullIfExpr. + * @memberof pg_query + * @classdesc Represents a NullIfExpr. + * @implements INullIfExpr + * @constructor + * @param {pg_query.INullIfExpr=} [properties] Properties to set + */ + function NullIfExpr(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NullIfExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.NullIfExpr + * @instance + */ + NullIfExpr.prototype.xpr = null; + + /** + * NullIfExpr opno. + * @member {number} opno + * @memberof pg_query.NullIfExpr + * @instance + */ + NullIfExpr.prototype.opno = 0; + + /** + * NullIfExpr opfuncid. + * @member {number} opfuncid + * @memberof pg_query.NullIfExpr + * @instance + */ + NullIfExpr.prototype.opfuncid = 0; + + /** + * NullIfExpr opresulttype. + * @member {number} opresulttype + * @memberof pg_query.NullIfExpr + * @instance + */ + NullIfExpr.prototype.opresulttype = 0; + + /** + * NullIfExpr opretset. + * @member {boolean} opretset + * @memberof pg_query.NullIfExpr + * @instance + */ + NullIfExpr.prototype.opretset = false; + + /** + * NullIfExpr opcollid. + * @member {number} opcollid + * @memberof pg_query.NullIfExpr + * @instance + */ + NullIfExpr.prototype.opcollid = 0; + + /** + * NullIfExpr inputcollid. + * @member {number} inputcollid + * @memberof pg_query.NullIfExpr + * @instance + */ + NullIfExpr.prototype.inputcollid = 0; + + /** + * NullIfExpr args. + * @member {Array.} args + * @memberof pg_query.NullIfExpr + * @instance + */ + NullIfExpr.prototype.args = $util.emptyArray; + + /** + * NullIfExpr location. + * @member {number} location + * @memberof pg_query.NullIfExpr + * @instance + */ + NullIfExpr.prototype.location = 0; + + /** + * Creates a new NullIfExpr instance using the specified properties. + * @function create + * @memberof pg_query.NullIfExpr + * @static + * @param {pg_query.INullIfExpr=} [properties] Properties to set + * @returns {pg_query.NullIfExpr} NullIfExpr instance + */ + NullIfExpr.create = function create(properties) { + return new NullIfExpr(properties); + }; + + /** + * Encodes the specified NullIfExpr message. Does not implicitly {@link pg_query.NullIfExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.NullIfExpr + * @static + * @param {pg_query.INullIfExpr} message NullIfExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NullIfExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.opno != null && Object.hasOwnProperty.call(message, "opno")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.opno); + if (message.opfuncid != null && Object.hasOwnProperty.call(message, "opfuncid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.opfuncid); + if (message.opresulttype != null && Object.hasOwnProperty.call(message, "opresulttype")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.opresulttype); + if (message.opretset != null && Object.hasOwnProperty.call(message, "opretset")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.opretset); + if (message.opcollid != null && Object.hasOwnProperty.call(message, "opcollid")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.opcollid); + if (message.inputcollid != null && Object.hasOwnProperty.call(message, "inputcollid")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.inputcollid); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.location); + return writer; + }; + + /** + * Encodes the specified NullIfExpr message, length delimited. Does not implicitly {@link pg_query.NullIfExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.NullIfExpr + * @static + * @param {pg_query.INullIfExpr} message NullIfExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NullIfExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NullIfExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.NullIfExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.NullIfExpr} NullIfExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NullIfExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.NullIfExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.opno = reader.uint32(); + break; + } + case 3: { + message.opfuncid = reader.uint32(); + break; + } + case 4: { + message.opresulttype = reader.uint32(); + break; + } + case 5: { + message.opretset = reader.bool(); + break; + } + case 6: { + message.opcollid = reader.uint32(); + break; + } + case 7: { + message.inputcollid = reader.uint32(); + break; + } + case 8: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 9: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NullIfExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.NullIfExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.NullIfExpr} NullIfExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NullIfExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NullIfExpr message. + * @function verify + * @memberof pg_query.NullIfExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NullIfExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.opno != null && message.hasOwnProperty("opno")) + if (!$util.isInteger(message.opno)) + return "opno: integer expected"; + if (message.opfuncid != null && message.hasOwnProperty("opfuncid")) + if (!$util.isInteger(message.opfuncid)) + return "opfuncid: integer expected"; + if (message.opresulttype != null && message.hasOwnProperty("opresulttype")) + if (!$util.isInteger(message.opresulttype)) + return "opresulttype: integer expected"; + if (message.opretset != null && message.hasOwnProperty("opretset")) + if (typeof message.opretset !== "boolean") + return "opretset: boolean expected"; + if (message.opcollid != null && message.hasOwnProperty("opcollid")) + if (!$util.isInteger(message.opcollid)) + return "opcollid: integer expected"; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + if (!$util.isInteger(message.inputcollid)) + return "inputcollid: integer expected"; + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a NullIfExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.NullIfExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.NullIfExpr} NullIfExpr + */ + NullIfExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.NullIfExpr) + return object; + var message = new $root.pg_query.NullIfExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.NullIfExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.opno != null) + message.opno = object.opno >>> 0; + if (object.opfuncid != null) + message.opfuncid = object.opfuncid >>> 0; + if (object.opresulttype != null) + message.opresulttype = object.opresulttype >>> 0; + if (object.opretset != null) + message.opretset = Boolean(object.opretset); + if (object.opcollid != null) + message.opcollid = object.opcollid >>> 0; + if (object.inputcollid != null) + message.inputcollid = object.inputcollid >>> 0; + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.NullIfExpr.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.NullIfExpr.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a NullIfExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.NullIfExpr + * @static + * @param {pg_query.NullIfExpr} message NullIfExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NullIfExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.xpr = null; + object.opno = 0; + object.opfuncid = 0; + object.opresulttype = 0; + object.opretset = false; + object.opcollid = 0; + object.inputcollid = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.opno != null && message.hasOwnProperty("opno")) + object.opno = message.opno; + if (message.opfuncid != null && message.hasOwnProperty("opfuncid")) + object.opfuncid = message.opfuncid; + if (message.opresulttype != null && message.hasOwnProperty("opresulttype")) + object.opresulttype = message.opresulttype; + if (message.opretset != null && message.hasOwnProperty("opretset")) + object.opretset = message.opretset; + if (message.opcollid != null && message.hasOwnProperty("opcollid")) + object.opcollid = message.opcollid; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + object.inputcollid = message.inputcollid; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this NullIfExpr to JSON. + * @function toJSON + * @memberof pg_query.NullIfExpr + * @instance + * @returns {Object.} JSON object + */ + NullIfExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NullIfExpr + * @function getTypeUrl + * @memberof pg_query.NullIfExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NullIfExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.NullIfExpr"; + }; + + return NullIfExpr; + })(); + + pg_query.ScalarArrayOpExpr = (function() { + + /** + * Properties of a ScalarArrayOpExpr. + * @memberof pg_query + * @interface IScalarArrayOpExpr + * @property {pg_query.INode|null} [xpr] ScalarArrayOpExpr xpr + * @property {number|null} [opno] ScalarArrayOpExpr opno + * @property {number|null} [opfuncid] ScalarArrayOpExpr opfuncid + * @property {boolean|null} [useOr] ScalarArrayOpExpr useOr + * @property {number|null} [inputcollid] ScalarArrayOpExpr inputcollid + * @property {Array.|null} [args] ScalarArrayOpExpr args + * @property {number|null} [location] ScalarArrayOpExpr location + */ + + /** + * Constructs a new ScalarArrayOpExpr. + * @memberof pg_query + * @classdesc Represents a ScalarArrayOpExpr. + * @implements IScalarArrayOpExpr + * @constructor + * @param {pg_query.IScalarArrayOpExpr=} [properties] Properties to set + */ + function ScalarArrayOpExpr(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScalarArrayOpExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.ScalarArrayOpExpr + * @instance + */ + ScalarArrayOpExpr.prototype.xpr = null; + + /** + * ScalarArrayOpExpr opno. + * @member {number} opno + * @memberof pg_query.ScalarArrayOpExpr + * @instance + */ + ScalarArrayOpExpr.prototype.opno = 0; + + /** + * ScalarArrayOpExpr opfuncid. + * @member {number} opfuncid + * @memberof pg_query.ScalarArrayOpExpr + * @instance + */ + ScalarArrayOpExpr.prototype.opfuncid = 0; + + /** + * ScalarArrayOpExpr useOr. + * @member {boolean} useOr + * @memberof pg_query.ScalarArrayOpExpr + * @instance + */ + ScalarArrayOpExpr.prototype.useOr = false; + + /** + * ScalarArrayOpExpr inputcollid. + * @member {number} inputcollid + * @memberof pg_query.ScalarArrayOpExpr + * @instance + */ + ScalarArrayOpExpr.prototype.inputcollid = 0; + + /** + * ScalarArrayOpExpr args. + * @member {Array.} args + * @memberof pg_query.ScalarArrayOpExpr + * @instance + */ + ScalarArrayOpExpr.prototype.args = $util.emptyArray; + + /** + * ScalarArrayOpExpr location. + * @member {number} location + * @memberof pg_query.ScalarArrayOpExpr + * @instance + */ + ScalarArrayOpExpr.prototype.location = 0; + + /** + * Creates a new ScalarArrayOpExpr instance using the specified properties. + * @function create + * @memberof pg_query.ScalarArrayOpExpr + * @static + * @param {pg_query.IScalarArrayOpExpr=} [properties] Properties to set + * @returns {pg_query.ScalarArrayOpExpr} ScalarArrayOpExpr instance + */ + ScalarArrayOpExpr.create = function create(properties) { + return new ScalarArrayOpExpr(properties); + }; + + /** + * Encodes the specified ScalarArrayOpExpr message. Does not implicitly {@link pg_query.ScalarArrayOpExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.ScalarArrayOpExpr + * @static + * @param {pg_query.IScalarArrayOpExpr} message ScalarArrayOpExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScalarArrayOpExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.opno != null && Object.hasOwnProperty.call(message, "opno")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.opno); + if (message.opfuncid != null && Object.hasOwnProperty.call(message, "opfuncid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.opfuncid); + if (message.useOr != null && Object.hasOwnProperty.call(message, "useOr")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.useOr); + if (message.inputcollid != null && Object.hasOwnProperty.call(message, "inputcollid")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.inputcollid); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.location); + return writer; + }; + + /** + * Encodes the specified ScalarArrayOpExpr message, length delimited. Does not implicitly {@link pg_query.ScalarArrayOpExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ScalarArrayOpExpr + * @static + * @param {pg_query.IScalarArrayOpExpr} message ScalarArrayOpExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScalarArrayOpExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScalarArrayOpExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ScalarArrayOpExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ScalarArrayOpExpr} ScalarArrayOpExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScalarArrayOpExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ScalarArrayOpExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.opno = reader.uint32(); + break; + } + case 3: { + message.opfuncid = reader.uint32(); + break; + } + case 4: { + message.useOr = reader.bool(); + break; + } + case 5: { + message.inputcollid = reader.uint32(); + break; + } + case 6: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScalarArrayOpExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ScalarArrayOpExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ScalarArrayOpExpr} ScalarArrayOpExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScalarArrayOpExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScalarArrayOpExpr message. + * @function verify + * @memberof pg_query.ScalarArrayOpExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScalarArrayOpExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.opno != null && message.hasOwnProperty("opno")) + if (!$util.isInteger(message.opno)) + return "opno: integer expected"; + if (message.opfuncid != null && message.hasOwnProperty("opfuncid")) + if (!$util.isInteger(message.opfuncid)) + return "opfuncid: integer expected"; + if (message.useOr != null && message.hasOwnProperty("useOr")) + if (typeof message.useOr !== "boolean") + return "useOr: boolean expected"; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + if (!$util.isInteger(message.inputcollid)) + return "inputcollid: integer expected"; + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a ScalarArrayOpExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ScalarArrayOpExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ScalarArrayOpExpr} ScalarArrayOpExpr + */ + ScalarArrayOpExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ScalarArrayOpExpr) + return object; + var message = new $root.pg_query.ScalarArrayOpExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.ScalarArrayOpExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.opno != null) + message.opno = object.opno >>> 0; + if (object.opfuncid != null) + message.opfuncid = object.opfuncid >>> 0; + if (object.useOr != null) + message.useOr = Boolean(object.useOr); + if (object.inputcollid != null) + message.inputcollid = object.inputcollid >>> 0; + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.ScalarArrayOpExpr.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.ScalarArrayOpExpr.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a ScalarArrayOpExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ScalarArrayOpExpr + * @static + * @param {pg_query.ScalarArrayOpExpr} message ScalarArrayOpExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScalarArrayOpExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.xpr = null; + object.opno = 0; + object.opfuncid = 0; + object.useOr = false; + object.inputcollid = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.opno != null && message.hasOwnProperty("opno")) + object.opno = message.opno; + if (message.opfuncid != null && message.hasOwnProperty("opfuncid")) + object.opfuncid = message.opfuncid; + if (message.useOr != null && message.hasOwnProperty("useOr")) + object.useOr = message.useOr; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + object.inputcollid = message.inputcollid; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this ScalarArrayOpExpr to JSON. + * @function toJSON + * @memberof pg_query.ScalarArrayOpExpr + * @instance + * @returns {Object.} JSON object + */ + ScalarArrayOpExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScalarArrayOpExpr + * @function getTypeUrl + * @memberof pg_query.ScalarArrayOpExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScalarArrayOpExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ScalarArrayOpExpr"; + }; + + return ScalarArrayOpExpr; + })(); + + pg_query.BoolExpr = (function() { + + /** + * Properties of a BoolExpr. + * @memberof pg_query + * @interface IBoolExpr + * @property {pg_query.INode|null} [xpr] BoolExpr xpr + * @property {pg_query.BoolExprType|null} [boolop] BoolExpr boolop + * @property {Array.|null} [args] BoolExpr args + * @property {number|null} [location] BoolExpr location + */ + + /** + * Constructs a new BoolExpr. + * @memberof pg_query + * @classdesc Represents a BoolExpr. + * @implements IBoolExpr + * @constructor + * @param {pg_query.IBoolExpr=} [properties] Properties to set + */ + function BoolExpr(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.BoolExpr + * @instance + */ + BoolExpr.prototype.xpr = null; + + /** + * BoolExpr boolop. + * @member {pg_query.BoolExprType} boolop + * @memberof pg_query.BoolExpr + * @instance + */ + BoolExpr.prototype.boolop = 0; + + /** + * BoolExpr args. + * @member {Array.} args + * @memberof pg_query.BoolExpr + * @instance + */ + BoolExpr.prototype.args = $util.emptyArray; + + /** + * BoolExpr location. + * @member {number} location + * @memberof pg_query.BoolExpr + * @instance + */ + BoolExpr.prototype.location = 0; + + /** + * Creates a new BoolExpr instance using the specified properties. + * @function create + * @memberof pg_query.BoolExpr + * @static + * @param {pg_query.IBoolExpr=} [properties] Properties to set + * @returns {pg_query.BoolExpr} BoolExpr instance + */ + BoolExpr.create = function create(properties) { + return new BoolExpr(properties); + }; + + /** + * Encodes the specified BoolExpr message. Does not implicitly {@link pg_query.BoolExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.BoolExpr + * @static + * @param {pg_query.IBoolExpr} message BoolExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.boolop != null && Object.hasOwnProperty.call(message, "boolop")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.boolop); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.location); + return writer; + }; + + /** + * Encodes the specified BoolExpr message, length delimited. Does not implicitly {@link pg_query.BoolExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.BoolExpr + * @static + * @param {pg_query.IBoolExpr} message BoolExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.BoolExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.BoolExpr} BoolExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.BoolExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.boolop = reader.int32(); + break; + } + case 3: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.BoolExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.BoolExpr} BoolExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolExpr message. + * @function verify + * @memberof pg_query.BoolExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.boolop != null && message.hasOwnProperty("boolop")) + switch (message.boolop) { + default: + return "boolop: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a BoolExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.BoolExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.BoolExpr} BoolExpr + */ + BoolExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.BoolExpr) + return object; + var message = new $root.pg_query.BoolExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.BoolExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + switch (object.boolop) { + default: + if (typeof object.boolop === "number") { + message.boolop = object.boolop; + break; + } + break; + case "BOOL_EXPR_TYPE_UNDEFINED": + case 0: + message.boolop = 0; + break; + case "AND_EXPR": + case 1: + message.boolop = 1; + break; + case "OR_EXPR": + case 2: + message.boolop = 2; + break; + case "NOT_EXPR": + case 3: + message.boolop = 3; + break; + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.BoolExpr.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.BoolExpr.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a BoolExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.BoolExpr + * @static + * @param {pg_query.BoolExpr} message BoolExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.xpr = null; + object.boolop = options.enums === String ? "BOOL_EXPR_TYPE_UNDEFINED" : 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.boolop != null && message.hasOwnProperty("boolop")) + object.boolop = options.enums === String ? $root.pg_query.BoolExprType[message.boolop] === undefined ? message.boolop : $root.pg_query.BoolExprType[message.boolop] : message.boolop; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this BoolExpr to JSON. + * @function toJSON + * @memberof pg_query.BoolExpr + * @instance + * @returns {Object.} JSON object + */ + BoolExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolExpr + * @function getTypeUrl + * @memberof pg_query.BoolExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.BoolExpr"; + }; + + return BoolExpr; + })(); + + pg_query.SubLink = (function() { + + /** + * Properties of a SubLink. + * @memberof pg_query + * @interface ISubLink + * @property {pg_query.INode|null} [xpr] SubLink xpr + * @property {pg_query.SubLinkType|null} [subLinkType] SubLink subLinkType + * @property {number|null} [subLinkId] SubLink subLinkId + * @property {pg_query.INode|null} [testexpr] SubLink testexpr + * @property {Array.|null} [operName] SubLink operName + * @property {pg_query.INode|null} [subselect] SubLink subselect + * @property {number|null} [location] SubLink location + */ + + /** + * Constructs a new SubLink. + * @memberof pg_query + * @classdesc Represents a SubLink. + * @implements ISubLink + * @constructor + * @param {pg_query.ISubLink=} [properties] Properties to set + */ + function SubLink(properties) { + this.operName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubLink xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.SubLink + * @instance + */ + SubLink.prototype.xpr = null; + + /** + * SubLink subLinkType. + * @member {pg_query.SubLinkType} subLinkType + * @memberof pg_query.SubLink + * @instance + */ + SubLink.prototype.subLinkType = 0; + + /** + * SubLink subLinkId. + * @member {number} subLinkId + * @memberof pg_query.SubLink + * @instance + */ + SubLink.prototype.subLinkId = 0; + + /** + * SubLink testexpr. + * @member {pg_query.INode|null|undefined} testexpr + * @memberof pg_query.SubLink + * @instance + */ + SubLink.prototype.testexpr = null; + + /** + * SubLink operName. + * @member {Array.} operName + * @memberof pg_query.SubLink + * @instance + */ + SubLink.prototype.operName = $util.emptyArray; + + /** + * SubLink subselect. + * @member {pg_query.INode|null|undefined} subselect + * @memberof pg_query.SubLink + * @instance + */ + SubLink.prototype.subselect = null; + + /** + * SubLink location. + * @member {number} location + * @memberof pg_query.SubLink + * @instance + */ + SubLink.prototype.location = 0; + + /** + * Creates a new SubLink instance using the specified properties. + * @function create + * @memberof pg_query.SubLink + * @static + * @param {pg_query.ISubLink=} [properties] Properties to set + * @returns {pg_query.SubLink} SubLink instance + */ + SubLink.create = function create(properties) { + return new SubLink(properties); + }; + + /** + * Encodes the specified SubLink message. Does not implicitly {@link pg_query.SubLink.verify|verify} messages. + * @function encode + * @memberof pg_query.SubLink + * @static + * @param {pg_query.ISubLink} message SubLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubLink.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.subLinkType != null && Object.hasOwnProperty.call(message, "subLinkType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.subLinkType); + if (message.subLinkId != null && Object.hasOwnProperty.call(message, "subLinkId")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.subLinkId); + if (message.testexpr != null && Object.hasOwnProperty.call(message, "testexpr")) + $root.pg_query.Node.encode(message.testexpr, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.operName != null && message.operName.length) + for (var i = 0; i < message.operName.length; ++i) + $root.pg_query.Node.encode(message.operName[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.subselect != null && Object.hasOwnProperty.call(message, "subselect")) + $root.pg_query.Node.encode(message.subselect, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.location); + return writer; + }; + + /** + * Encodes the specified SubLink message, length delimited. Does not implicitly {@link pg_query.SubLink.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.SubLink + * @static + * @param {pg_query.ISubLink} message SubLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubLink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubLink message from the specified reader or buffer. + * @function decode + * @memberof pg_query.SubLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.SubLink} SubLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubLink.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.SubLink(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.subLinkType = reader.int32(); + break; + } + case 3: { + message.subLinkId = reader.int32(); + break; + } + case 4: { + message.testexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.operName && message.operName.length)) + message.operName = []; + message.operName.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.subselect = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 7: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubLink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.SubLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.SubLink} SubLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubLink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubLink message. + * @function verify + * @memberof pg_query.SubLink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubLink.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.subLinkType != null && message.hasOwnProperty("subLinkType")) + switch (message.subLinkType) { + default: + return "subLinkType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.subLinkId != null && message.hasOwnProperty("subLinkId")) + if (!$util.isInteger(message.subLinkId)) + return "subLinkId: integer expected"; + if (message.testexpr != null && message.hasOwnProperty("testexpr")) { + var error = $root.pg_query.Node.verify(message.testexpr); + if (error) + return "testexpr." + error; + } + if (message.operName != null && message.hasOwnProperty("operName")) { + if (!Array.isArray(message.operName)) + return "operName: array expected"; + for (var i = 0; i < message.operName.length; ++i) { + var error = $root.pg_query.Node.verify(message.operName[i]); + if (error) + return "operName." + error; + } + } + if (message.subselect != null && message.hasOwnProperty("subselect")) { + var error = $root.pg_query.Node.verify(message.subselect); + if (error) + return "subselect." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a SubLink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.SubLink + * @static + * @param {Object.} object Plain object + * @returns {pg_query.SubLink} SubLink + */ + SubLink.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.SubLink) + return object; + var message = new $root.pg_query.SubLink(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.SubLink.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + switch (object.subLinkType) { + default: + if (typeof object.subLinkType === "number") { + message.subLinkType = object.subLinkType; + break; + } + break; + case "SUB_LINK_TYPE_UNDEFINED": + case 0: + message.subLinkType = 0; + break; + case "EXISTS_SUBLINK": + case 1: + message.subLinkType = 1; + break; + case "ALL_SUBLINK": + case 2: + message.subLinkType = 2; + break; + case "ANY_SUBLINK": + case 3: + message.subLinkType = 3; + break; + case "ROWCOMPARE_SUBLINK": + case 4: + message.subLinkType = 4; + break; + case "EXPR_SUBLINK": + case 5: + message.subLinkType = 5; + break; + case "MULTIEXPR_SUBLINK": + case 6: + message.subLinkType = 6; + break; + case "ARRAY_SUBLINK": + case 7: + message.subLinkType = 7; + break; + case "CTE_SUBLINK": + case 8: + message.subLinkType = 8; + break; + } + if (object.subLinkId != null) + message.subLinkId = object.subLinkId | 0; + if (object.testexpr != null) { + if (typeof object.testexpr !== "object") + throw TypeError(".pg_query.SubLink.testexpr: object expected"); + message.testexpr = $root.pg_query.Node.fromObject(object.testexpr); + } + if (object.operName) { + if (!Array.isArray(object.operName)) + throw TypeError(".pg_query.SubLink.operName: array expected"); + message.operName = []; + for (var i = 0; i < object.operName.length; ++i) { + if (typeof object.operName[i] !== "object") + throw TypeError(".pg_query.SubLink.operName: object expected"); + message.operName[i] = $root.pg_query.Node.fromObject(object.operName[i]); + } + } + if (object.subselect != null) { + if (typeof object.subselect !== "object") + throw TypeError(".pg_query.SubLink.subselect: object expected"); + message.subselect = $root.pg_query.Node.fromObject(object.subselect); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a SubLink message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.SubLink + * @static + * @param {pg_query.SubLink} message SubLink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubLink.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operName = []; + if (options.defaults) { + object.xpr = null; + object.subLinkType = options.enums === String ? "SUB_LINK_TYPE_UNDEFINED" : 0; + object.subLinkId = 0; + object.testexpr = null; + object.subselect = null; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.subLinkType != null && message.hasOwnProperty("subLinkType")) + object.subLinkType = options.enums === String ? $root.pg_query.SubLinkType[message.subLinkType] === undefined ? message.subLinkType : $root.pg_query.SubLinkType[message.subLinkType] : message.subLinkType; + if (message.subLinkId != null && message.hasOwnProperty("subLinkId")) + object.subLinkId = message.subLinkId; + if (message.testexpr != null && message.hasOwnProperty("testexpr")) + object.testexpr = $root.pg_query.Node.toObject(message.testexpr, options); + if (message.operName && message.operName.length) { + object.operName = []; + for (var j = 0; j < message.operName.length; ++j) + object.operName[j] = $root.pg_query.Node.toObject(message.operName[j], options); + } + if (message.subselect != null && message.hasOwnProperty("subselect")) + object.subselect = $root.pg_query.Node.toObject(message.subselect, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this SubLink to JSON. + * @function toJSON + * @memberof pg_query.SubLink + * @instance + * @returns {Object.} JSON object + */ + SubLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubLink + * @function getTypeUrl + * @memberof pg_query.SubLink + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.SubLink"; + }; + + return SubLink; + })(); + + pg_query.SubPlan = (function() { + + /** + * Properties of a SubPlan. + * @memberof pg_query + * @interface ISubPlan + * @property {pg_query.INode|null} [xpr] SubPlan xpr + * @property {pg_query.SubLinkType|null} [subLinkType] SubPlan subLinkType + * @property {pg_query.INode|null} [testexpr] SubPlan testexpr + * @property {Array.|null} [paramIds] SubPlan paramIds + * @property {number|null} [plan_id] SubPlan plan_id + * @property {string|null} [plan_name] SubPlan plan_name + * @property {number|null} [firstColType] SubPlan firstColType + * @property {number|null} [firstColTypmod] SubPlan firstColTypmod + * @property {number|null} [firstColCollation] SubPlan firstColCollation + * @property {boolean|null} [useHashTable] SubPlan useHashTable + * @property {boolean|null} [unknownEqFalse] SubPlan unknownEqFalse + * @property {boolean|null} [parallel_safe] SubPlan parallel_safe + * @property {Array.|null} [setParam] SubPlan setParam + * @property {Array.|null} [parParam] SubPlan parParam + * @property {Array.|null} [args] SubPlan args + * @property {number|null} [startup_cost] SubPlan startup_cost + * @property {number|null} [per_call_cost] SubPlan per_call_cost + */ + + /** + * Constructs a new SubPlan. + * @memberof pg_query + * @classdesc Represents a SubPlan. + * @implements ISubPlan + * @constructor + * @param {pg_query.ISubPlan=} [properties] Properties to set + */ + function SubPlan(properties) { + this.paramIds = []; + this.setParam = []; + this.parParam = []; + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubPlan xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.xpr = null; + + /** + * SubPlan subLinkType. + * @member {pg_query.SubLinkType} subLinkType + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.subLinkType = 0; + + /** + * SubPlan testexpr. + * @member {pg_query.INode|null|undefined} testexpr + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.testexpr = null; + + /** + * SubPlan paramIds. + * @member {Array.} paramIds + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.paramIds = $util.emptyArray; + + /** + * SubPlan plan_id. + * @member {number} plan_id + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.plan_id = 0; + + /** + * SubPlan plan_name. + * @member {string} plan_name + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.plan_name = ""; + + /** + * SubPlan firstColType. + * @member {number} firstColType + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.firstColType = 0; + + /** + * SubPlan firstColTypmod. + * @member {number} firstColTypmod + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.firstColTypmod = 0; + + /** + * SubPlan firstColCollation. + * @member {number} firstColCollation + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.firstColCollation = 0; + + /** + * SubPlan useHashTable. + * @member {boolean} useHashTable + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.useHashTable = false; + + /** + * SubPlan unknownEqFalse. + * @member {boolean} unknownEqFalse + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.unknownEqFalse = false; + + /** + * SubPlan parallel_safe. + * @member {boolean} parallel_safe + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.parallel_safe = false; + + /** + * SubPlan setParam. + * @member {Array.} setParam + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.setParam = $util.emptyArray; + + /** + * SubPlan parParam. + * @member {Array.} parParam + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.parParam = $util.emptyArray; + + /** + * SubPlan args. + * @member {Array.} args + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.args = $util.emptyArray; + + /** + * SubPlan startup_cost. + * @member {number} startup_cost + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.startup_cost = 0; + + /** + * SubPlan per_call_cost. + * @member {number} per_call_cost + * @memberof pg_query.SubPlan + * @instance + */ + SubPlan.prototype.per_call_cost = 0; + + /** + * Creates a new SubPlan instance using the specified properties. + * @function create + * @memberof pg_query.SubPlan + * @static + * @param {pg_query.ISubPlan=} [properties] Properties to set + * @returns {pg_query.SubPlan} SubPlan instance + */ + SubPlan.create = function create(properties) { + return new SubPlan(properties); + }; + + /** + * Encodes the specified SubPlan message. Does not implicitly {@link pg_query.SubPlan.verify|verify} messages. + * @function encode + * @memberof pg_query.SubPlan + * @static + * @param {pg_query.ISubPlan} message SubPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubPlan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.subLinkType != null && Object.hasOwnProperty.call(message, "subLinkType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.subLinkType); + if (message.testexpr != null && Object.hasOwnProperty.call(message, "testexpr")) + $root.pg_query.Node.encode(message.testexpr, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.paramIds != null && message.paramIds.length) + for (var i = 0; i < message.paramIds.length; ++i) + $root.pg_query.Node.encode(message.paramIds[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.plan_id != null && Object.hasOwnProperty.call(message, "plan_id")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.plan_id); + if (message.plan_name != null && Object.hasOwnProperty.call(message, "plan_name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.plan_name); + if (message.firstColType != null && Object.hasOwnProperty.call(message, "firstColType")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.firstColType); + if (message.firstColTypmod != null && Object.hasOwnProperty.call(message, "firstColTypmod")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.firstColTypmod); + if (message.firstColCollation != null && Object.hasOwnProperty.call(message, "firstColCollation")) + writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.firstColCollation); + if (message.useHashTable != null && Object.hasOwnProperty.call(message, "useHashTable")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.useHashTable); + if (message.unknownEqFalse != null && Object.hasOwnProperty.call(message, "unknownEqFalse")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.unknownEqFalse); + if (message.parallel_safe != null && Object.hasOwnProperty.call(message, "parallel_safe")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.parallel_safe); + if (message.setParam != null && message.setParam.length) + for (var i = 0; i < message.setParam.length; ++i) + $root.pg_query.Node.encode(message.setParam[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.parParam != null && message.parParam.length) + for (var i = 0; i < message.parParam.length; ++i) + $root.pg_query.Node.encode(message.parParam[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.startup_cost != null && Object.hasOwnProperty.call(message, "startup_cost")) + writer.uint32(/* id 16, wireType 1 =*/129).double(message.startup_cost); + if (message.per_call_cost != null && Object.hasOwnProperty.call(message, "per_call_cost")) + writer.uint32(/* id 17, wireType 1 =*/137).double(message.per_call_cost); + return writer; + }; + + /** + * Encodes the specified SubPlan message, length delimited. Does not implicitly {@link pg_query.SubPlan.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.SubPlan + * @static + * @param {pg_query.ISubPlan} message SubPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubPlan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubPlan message from the specified reader or buffer. + * @function decode + * @memberof pg_query.SubPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.SubPlan} SubPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubPlan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.SubPlan(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.subLinkType = reader.int32(); + break; + } + case 3: { + message.testexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.paramIds && message.paramIds.length)) + message.paramIds = []; + message.paramIds.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.plan_id = reader.int32(); + break; + } + case 6: { + message.plan_name = reader.string(); + break; + } + case 7: { + message.firstColType = reader.uint32(); + break; + } + case 8: { + message.firstColTypmod = reader.int32(); + break; + } + case 9: { + message.firstColCollation = reader.uint32(); + break; + } + case 10: { + message.useHashTable = reader.bool(); + break; + } + case 11: { + message.unknownEqFalse = reader.bool(); + break; + } + case 12: { + message.parallel_safe = reader.bool(); + break; + } + case 13: { + if (!(message.setParam && message.setParam.length)) + message.setParam = []; + message.setParam.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 14: { + if (!(message.parParam && message.parParam.length)) + message.parParam = []; + message.parParam.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 15: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 16: { + message.startup_cost = reader.double(); + break; + } + case 17: { + message.per_call_cost = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubPlan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.SubPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.SubPlan} SubPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubPlan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubPlan message. + * @function verify + * @memberof pg_query.SubPlan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubPlan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.subLinkType != null && message.hasOwnProperty("subLinkType")) + switch (message.subLinkType) { + default: + return "subLinkType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.testexpr != null && message.hasOwnProperty("testexpr")) { + var error = $root.pg_query.Node.verify(message.testexpr); + if (error) + return "testexpr." + error; + } + if (message.paramIds != null && message.hasOwnProperty("paramIds")) { + if (!Array.isArray(message.paramIds)) + return "paramIds: array expected"; + for (var i = 0; i < message.paramIds.length; ++i) { + var error = $root.pg_query.Node.verify(message.paramIds[i]); + if (error) + return "paramIds." + error; + } + } + if (message.plan_id != null && message.hasOwnProperty("plan_id")) + if (!$util.isInteger(message.plan_id)) + return "plan_id: integer expected"; + if (message.plan_name != null && message.hasOwnProperty("plan_name")) + if (!$util.isString(message.plan_name)) + return "plan_name: string expected"; + if (message.firstColType != null && message.hasOwnProperty("firstColType")) + if (!$util.isInteger(message.firstColType)) + return "firstColType: integer expected"; + if (message.firstColTypmod != null && message.hasOwnProperty("firstColTypmod")) + if (!$util.isInteger(message.firstColTypmod)) + return "firstColTypmod: integer expected"; + if (message.firstColCollation != null && message.hasOwnProperty("firstColCollation")) + if (!$util.isInteger(message.firstColCollation)) + return "firstColCollation: integer expected"; + if (message.useHashTable != null && message.hasOwnProperty("useHashTable")) + if (typeof message.useHashTable !== "boolean") + return "useHashTable: boolean expected"; + if (message.unknownEqFalse != null && message.hasOwnProperty("unknownEqFalse")) + if (typeof message.unknownEqFalse !== "boolean") + return "unknownEqFalse: boolean expected"; + if (message.parallel_safe != null && message.hasOwnProperty("parallel_safe")) + if (typeof message.parallel_safe !== "boolean") + return "parallel_safe: boolean expected"; + if (message.setParam != null && message.hasOwnProperty("setParam")) { + if (!Array.isArray(message.setParam)) + return "setParam: array expected"; + for (var i = 0; i < message.setParam.length; ++i) { + var error = $root.pg_query.Node.verify(message.setParam[i]); + if (error) + return "setParam." + error; + } + } + if (message.parParam != null && message.hasOwnProperty("parParam")) { + if (!Array.isArray(message.parParam)) + return "parParam: array expected"; + for (var i = 0; i < message.parParam.length; ++i) { + var error = $root.pg_query.Node.verify(message.parParam[i]); + if (error) + return "parParam." + error; + } + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.startup_cost != null && message.hasOwnProperty("startup_cost")) + if (typeof message.startup_cost !== "number") + return "startup_cost: number expected"; + if (message.per_call_cost != null && message.hasOwnProperty("per_call_cost")) + if (typeof message.per_call_cost !== "number") + return "per_call_cost: number expected"; + return null; + }; + + /** + * Creates a SubPlan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.SubPlan + * @static + * @param {Object.} object Plain object + * @returns {pg_query.SubPlan} SubPlan + */ + SubPlan.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.SubPlan) + return object; + var message = new $root.pg_query.SubPlan(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.SubPlan.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + switch (object.subLinkType) { + default: + if (typeof object.subLinkType === "number") { + message.subLinkType = object.subLinkType; + break; + } + break; + case "SUB_LINK_TYPE_UNDEFINED": + case 0: + message.subLinkType = 0; + break; + case "EXISTS_SUBLINK": + case 1: + message.subLinkType = 1; + break; + case "ALL_SUBLINK": + case 2: + message.subLinkType = 2; + break; + case "ANY_SUBLINK": + case 3: + message.subLinkType = 3; + break; + case "ROWCOMPARE_SUBLINK": + case 4: + message.subLinkType = 4; + break; + case "EXPR_SUBLINK": + case 5: + message.subLinkType = 5; + break; + case "MULTIEXPR_SUBLINK": + case 6: + message.subLinkType = 6; + break; + case "ARRAY_SUBLINK": + case 7: + message.subLinkType = 7; + break; + case "CTE_SUBLINK": + case 8: + message.subLinkType = 8; + break; + } + if (object.testexpr != null) { + if (typeof object.testexpr !== "object") + throw TypeError(".pg_query.SubPlan.testexpr: object expected"); + message.testexpr = $root.pg_query.Node.fromObject(object.testexpr); + } + if (object.paramIds) { + if (!Array.isArray(object.paramIds)) + throw TypeError(".pg_query.SubPlan.paramIds: array expected"); + message.paramIds = []; + for (var i = 0; i < object.paramIds.length; ++i) { + if (typeof object.paramIds[i] !== "object") + throw TypeError(".pg_query.SubPlan.paramIds: object expected"); + message.paramIds[i] = $root.pg_query.Node.fromObject(object.paramIds[i]); + } + } + if (object.plan_id != null) + message.plan_id = object.plan_id | 0; + if (object.plan_name != null) + message.plan_name = String(object.plan_name); + if (object.firstColType != null) + message.firstColType = object.firstColType >>> 0; + if (object.firstColTypmod != null) + message.firstColTypmod = object.firstColTypmod | 0; + if (object.firstColCollation != null) + message.firstColCollation = object.firstColCollation >>> 0; + if (object.useHashTable != null) + message.useHashTable = Boolean(object.useHashTable); + if (object.unknownEqFalse != null) + message.unknownEqFalse = Boolean(object.unknownEqFalse); + if (object.parallel_safe != null) + message.parallel_safe = Boolean(object.parallel_safe); + if (object.setParam) { + if (!Array.isArray(object.setParam)) + throw TypeError(".pg_query.SubPlan.setParam: array expected"); + message.setParam = []; + for (var i = 0; i < object.setParam.length; ++i) { + if (typeof object.setParam[i] !== "object") + throw TypeError(".pg_query.SubPlan.setParam: object expected"); + message.setParam[i] = $root.pg_query.Node.fromObject(object.setParam[i]); + } + } + if (object.parParam) { + if (!Array.isArray(object.parParam)) + throw TypeError(".pg_query.SubPlan.parParam: array expected"); + message.parParam = []; + for (var i = 0; i < object.parParam.length; ++i) { + if (typeof object.parParam[i] !== "object") + throw TypeError(".pg_query.SubPlan.parParam: object expected"); + message.parParam[i] = $root.pg_query.Node.fromObject(object.parParam[i]); + } + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.SubPlan.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.SubPlan.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.startup_cost != null) + message.startup_cost = Number(object.startup_cost); + if (object.per_call_cost != null) + message.per_call_cost = Number(object.per_call_cost); + return message; + }; + + /** + * Creates a plain object from a SubPlan message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.SubPlan + * @static + * @param {pg_query.SubPlan} message SubPlan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubPlan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.paramIds = []; + object.setParam = []; + object.parParam = []; + object.args = []; + } + if (options.defaults) { + object.xpr = null; + object.subLinkType = options.enums === String ? "SUB_LINK_TYPE_UNDEFINED" : 0; + object.testexpr = null; + object.plan_id = 0; + object.plan_name = ""; + object.firstColType = 0; + object.firstColTypmod = 0; + object.firstColCollation = 0; + object.useHashTable = false; + object.unknownEqFalse = false; + object.parallel_safe = false; + object.startup_cost = 0; + object.per_call_cost = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.subLinkType != null && message.hasOwnProperty("subLinkType")) + object.subLinkType = options.enums === String ? $root.pg_query.SubLinkType[message.subLinkType] === undefined ? message.subLinkType : $root.pg_query.SubLinkType[message.subLinkType] : message.subLinkType; + if (message.testexpr != null && message.hasOwnProperty("testexpr")) + object.testexpr = $root.pg_query.Node.toObject(message.testexpr, options); + if (message.paramIds && message.paramIds.length) { + object.paramIds = []; + for (var j = 0; j < message.paramIds.length; ++j) + object.paramIds[j] = $root.pg_query.Node.toObject(message.paramIds[j], options); + } + if (message.plan_id != null && message.hasOwnProperty("plan_id")) + object.plan_id = message.plan_id; + if (message.plan_name != null && message.hasOwnProperty("plan_name")) + object.plan_name = message.plan_name; + if (message.firstColType != null && message.hasOwnProperty("firstColType")) + object.firstColType = message.firstColType; + if (message.firstColTypmod != null && message.hasOwnProperty("firstColTypmod")) + object.firstColTypmod = message.firstColTypmod; + if (message.firstColCollation != null && message.hasOwnProperty("firstColCollation")) + object.firstColCollation = message.firstColCollation; + if (message.useHashTable != null && message.hasOwnProperty("useHashTable")) + object.useHashTable = message.useHashTable; + if (message.unknownEqFalse != null && message.hasOwnProperty("unknownEqFalse")) + object.unknownEqFalse = message.unknownEqFalse; + if (message.parallel_safe != null && message.hasOwnProperty("parallel_safe")) + object.parallel_safe = message.parallel_safe; + if (message.setParam && message.setParam.length) { + object.setParam = []; + for (var j = 0; j < message.setParam.length; ++j) + object.setParam[j] = $root.pg_query.Node.toObject(message.setParam[j], options); + } + if (message.parParam && message.parParam.length) { + object.parParam = []; + for (var j = 0; j < message.parParam.length; ++j) + object.parParam[j] = $root.pg_query.Node.toObject(message.parParam[j], options); + } + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.startup_cost != null && message.hasOwnProperty("startup_cost")) + object.startup_cost = options.json && !isFinite(message.startup_cost) ? String(message.startup_cost) : message.startup_cost; + if (message.per_call_cost != null && message.hasOwnProperty("per_call_cost")) + object.per_call_cost = options.json && !isFinite(message.per_call_cost) ? String(message.per_call_cost) : message.per_call_cost; + return object; + }; + + /** + * Converts this SubPlan to JSON. + * @function toJSON + * @memberof pg_query.SubPlan + * @instance + * @returns {Object.} JSON object + */ + SubPlan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubPlan + * @function getTypeUrl + * @memberof pg_query.SubPlan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.SubPlan"; + }; + + return SubPlan; + })(); + + pg_query.AlternativeSubPlan = (function() { + + /** + * Properties of an AlternativeSubPlan. + * @memberof pg_query + * @interface IAlternativeSubPlan + * @property {pg_query.INode|null} [xpr] AlternativeSubPlan xpr + * @property {Array.|null} [subplans] AlternativeSubPlan subplans + */ + + /** + * Constructs a new AlternativeSubPlan. + * @memberof pg_query + * @classdesc Represents an AlternativeSubPlan. + * @implements IAlternativeSubPlan + * @constructor + * @param {pg_query.IAlternativeSubPlan=} [properties] Properties to set + */ + function AlternativeSubPlan(properties) { + this.subplans = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlternativeSubPlan xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.AlternativeSubPlan + * @instance + */ + AlternativeSubPlan.prototype.xpr = null; + + /** + * AlternativeSubPlan subplans. + * @member {Array.} subplans + * @memberof pg_query.AlternativeSubPlan + * @instance + */ + AlternativeSubPlan.prototype.subplans = $util.emptyArray; + + /** + * Creates a new AlternativeSubPlan instance using the specified properties. + * @function create + * @memberof pg_query.AlternativeSubPlan + * @static + * @param {pg_query.IAlternativeSubPlan=} [properties] Properties to set + * @returns {pg_query.AlternativeSubPlan} AlternativeSubPlan instance + */ + AlternativeSubPlan.create = function create(properties) { + return new AlternativeSubPlan(properties); + }; + + /** + * Encodes the specified AlternativeSubPlan message. Does not implicitly {@link pg_query.AlternativeSubPlan.verify|verify} messages. + * @function encode + * @memberof pg_query.AlternativeSubPlan + * @static + * @param {pg_query.IAlternativeSubPlan} message AlternativeSubPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlternativeSubPlan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.subplans != null && message.subplans.length) + for (var i = 0; i < message.subplans.length; ++i) + $root.pg_query.Node.encode(message.subplans[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlternativeSubPlan message, length delimited. Does not implicitly {@link pg_query.AlternativeSubPlan.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlternativeSubPlan + * @static + * @param {pg_query.IAlternativeSubPlan} message AlternativeSubPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlternativeSubPlan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlternativeSubPlan message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlternativeSubPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlternativeSubPlan} AlternativeSubPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlternativeSubPlan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlternativeSubPlan(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.subplans && message.subplans.length)) + message.subplans = []; + message.subplans.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlternativeSubPlan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlternativeSubPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlternativeSubPlan} AlternativeSubPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlternativeSubPlan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlternativeSubPlan message. + * @function verify + * @memberof pg_query.AlternativeSubPlan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlternativeSubPlan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.subplans != null && message.hasOwnProperty("subplans")) { + if (!Array.isArray(message.subplans)) + return "subplans: array expected"; + for (var i = 0; i < message.subplans.length; ++i) { + var error = $root.pg_query.Node.verify(message.subplans[i]); + if (error) + return "subplans." + error; + } + } + return null; + }; + + /** + * Creates an AlternativeSubPlan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlternativeSubPlan + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlternativeSubPlan} AlternativeSubPlan + */ + AlternativeSubPlan.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlternativeSubPlan) + return object; + var message = new $root.pg_query.AlternativeSubPlan(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.AlternativeSubPlan.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.subplans) { + if (!Array.isArray(object.subplans)) + throw TypeError(".pg_query.AlternativeSubPlan.subplans: array expected"); + message.subplans = []; + for (var i = 0; i < object.subplans.length; ++i) { + if (typeof object.subplans[i] !== "object") + throw TypeError(".pg_query.AlternativeSubPlan.subplans: object expected"); + message.subplans[i] = $root.pg_query.Node.fromObject(object.subplans[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlternativeSubPlan message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlternativeSubPlan + * @static + * @param {pg_query.AlternativeSubPlan} message AlternativeSubPlan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlternativeSubPlan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subplans = []; + if (options.defaults) + object.xpr = null; + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.subplans && message.subplans.length) { + object.subplans = []; + for (var j = 0; j < message.subplans.length; ++j) + object.subplans[j] = $root.pg_query.Node.toObject(message.subplans[j], options); + } + return object; + }; + + /** + * Converts this AlternativeSubPlan to JSON. + * @function toJSON + * @memberof pg_query.AlternativeSubPlan + * @instance + * @returns {Object.} JSON object + */ + AlternativeSubPlan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlternativeSubPlan + * @function getTypeUrl + * @memberof pg_query.AlternativeSubPlan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlternativeSubPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlternativeSubPlan"; + }; + + return AlternativeSubPlan; + })(); + + pg_query.FieldSelect = (function() { + + /** + * Properties of a FieldSelect. + * @memberof pg_query + * @interface IFieldSelect + * @property {pg_query.INode|null} [xpr] FieldSelect xpr + * @property {pg_query.INode|null} [arg] FieldSelect arg + * @property {number|null} [fieldnum] FieldSelect fieldnum + * @property {number|null} [resulttype] FieldSelect resulttype + * @property {number|null} [resulttypmod] FieldSelect resulttypmod + * @property {number|null} [resultcollid] FieldSelect resultcollid + */ + + /** + * Constructs a new FieldSelect. + * @memberof pg_query + * @classdesc Represents a FieldSelect. + * @implements IFieldSelect + * @constructor + * @param {pg_query.IFieldSelect=} [properties] Properties to set + */ + function FieldSelect(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldSelect xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.FieldSelect + * @instance + */ + FieldSelect.prototype.xpr = null; + + /** + * FieldSelect arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.FieldSelect + * @instance + */ + FieldSelect.prototype.arg = null; + + /** + * FieldSelect fieldnum. + * @member {number} fieldnum + * @memberof pg_query.FieldSelect + * @instance + */ + FieldSelect.prototype.fieldnum = 0; + + /** + * FieldSelect resulttype. + * @member {number} resulttype + * @memberof pg_query.FieldSelect + * @instance + */ + FieldSelect.prototype.resulttype = 0; + + /** + * FieldSelect resulttypmod. + * @member {number} resulttypmod + * @memberof pg_query.FieldSelect + * @instance + */ + FieldSelect.prototype.resulttypmod = 0; + + /** + * FieldSelect resultcollid. + * @member {number} resultcollid + * @memberof pg_query.FieldSelect + * @instance + */ + FieldSelect.prototype.resultcollid = 0; + + /** + * Creates a new FieldSelect instance using the specified properties. + * @function create + * @memberof pg_query.FieldSelect + * @static + * @param {pg_query.IFieldSelect=} [properties] Properties to set + * @returns {pg_query.FieldSelect} FieldSelect instance + */ + FieldSelect.create = function create(properties) { + return new FieldSelect(properties); + }; + + /** + * Encodes the specified FieldSelect message. Does not implicitly {@link pg_query.FieldSelect.verify|verify} messages. + * @function encode + * @memberof pg_query.FieldSelect + * @static + * @param {pg_query.IFieldSelect} message FieldSelect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldSelect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fieldnum != null && Object.hasOwnProperty.call(message, "fieldnum")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.fieldnum); + if (message.resulttype != null && Object.hasOwnProperty.call(message, "resulttype")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.resulttype); + if (message.resulttypmod != null && Object.hasOwnProperty.call(message, "resulttypmod")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.resulttypmod); + if (message.resultcollid != null && Object.hasOwnProperty.call(message, "resultcollid")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.resultcollid); + return writer; + }; + + /** + * Encodes the specified FieldSelect message, length delimited. Does not implicitly {@link pg_query.FieldSelect.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.FieldSelect + * @static + * @param {pg_query.IFieldSelect} message FieldSelect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldSelect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldSelect message from the specified reader or buffer. + * @function decode + * @memberof pg_query.FieldSelect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.FieldSelect} FieldSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldSelect.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.FieldSelect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.fieldnum = reader.int32(); + break; + } + case 4: { + message.resulttype = reader.uint32(); + break; + } + case 5: { + message.resulttypmod = reader.int32(); + break; + } + case 6: { + message.resultcollid = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldSelect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.FieldSelect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.FieldSelect} FieldSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldSelect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldSelect message. + * @function verify + * @memberof pg_query.FieldSelect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldSelect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.fieldnum != null && message.hasOwnProperty("fieldnum")) + if (!$util.isInteger(message.fieldnum)) + return "fieldnum: integer expected"; + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + if (!$util.isInteger(message.resulttype)) + return "resulttype: integer expected"; + if (message.resulttypmod != null && message.hasOwnProperty("resulttypmod")) + if (!$util.isInteger(message.resulttypmod)) + return "resulttypmod: integer expected"; + if (message.resultcollid != null && message.hasOwnProperty("resultcollid")) + if (!$util.isInteger(message.resultcollid)) + return "resultcollid: integer expected"; + return null; + }; + + /** + * Creates a FieldSelect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.FieldSelect + * @static + * @param {Object.} object Plain object + * @returns {pg_query.FieldSelect} FieldSelect + */ + FieldSelect.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.FieldSelect) + return object; + var message = new $root.pg_query.FieldSelect(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.FieldSelect.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.FieldSelect.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.fieldnum != null) + message.fieldnum = object.fieldnum | 0; + if (object.resulttype != null) + message.resulttype = object.resulttype >>> 0; + if (object.resulttypmod != null) + message.resulttypmod = object.resulttypmod | 0; + if (object.resultcollid != null) + message.resultcollid = object.resultcollid >>> 0; + return message; + }; + + /** + * Creates a plain object from a FieldSelect message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.FieldSelect + * @static + * @param {pg_query.FieldSelect} message FieldSelect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldSelect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.arg = null; + object.fieldnum = 0; + object.resulttype = 0; + object.resulttypmod = 0; + object.resultcollid = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.fieldnum != null && message.hasOwnProperty("fieldnum")) + object.fieldnum = message.fieldnum; + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + object.resulttype = message.resulttype; + if (message.resulttypmod != null && message.hasOwnProperty("resulttypmod")) + object.resulttypmod = message.resulttypmod; + if (message.resultcollid != null && message.hasOwnProperty("resultcollid")) + object.resultcollid = message.resultcollid; + return object; + }; + + /** + * Converts this FieldSelect to JSON. + * @function toJSON + * @memberof pg_query.FieldSelect + * @instance + * @returns {Object.} JSON object + */ + FieldSelect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldSelect + * @function getTypeUrl + * @memberof pg_query.FieldSelect + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldSelect.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.FieldSelect"; + }; + + return FieldSelect; + })(); + + pg_query.FieldStore = (function() { + + /** + * Properties of a FieldStore. + * @memberof pg_query + * @interface IFieldStore + * @property {pg_query.INode|null} [xpr] FieldStore xpr + * @property {pg_query.INode|null} [arg] FieldStore arg + * @property {Array.|null} [newvals] FieldStore newvals + * @property {Array.|null} [fieldnums] FieldStore fieldnums + * @property {number|null} [resulttype] FieldStore resulttype + */ + + /** + * Constructs a new FieldStore. + * @memberof pg_query + * @classdesc Represents a FieldStore. + * @implements IFieldStore + * @constructor + * @param {pg_query.IFieldStore=} [properties] Properties to set + */ + function FieldStore(properties) { + this.newvals = []; + this.fieldnums = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldStore xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.FieldStore + * @instance + */ + FieldStore.prototype.xpr = null; + + /** + * FieldStore arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.FieldStore + * @instance + */ + FieldStore.prototype.arg = null; + + /** + * FieldStore newvals. + * @member {Array.} newvals + * @memberof pg_query.FieldStore + * @instance + */ + FieldStore.prototype.newvals = $util.emptyArray; + + /** + * FieldStore fieldnums. + * @member {Array.} fieldnums + * @memberof pg_query.FieldStore + * @instance + */ + FieldStore.prototype.fieldnums = $util.emptyArray; + + /** + * FieldStore resulttype. + * @member {number} resulttype + * @memberof pg_query.FieldStore + * @instance + */ + FieldStore.prototype.resulttype = 0; + + /** + * Creates a new FieldStore instance using the specified properties. + * @function create + * @memberof pg_query.FieldStore + * @static + * @param {pg_query.IFieldStore=} [properties] Properties to set + * @returns {pg_query.FieldStore} FieldStore instance + */ + FieldStore.create = function create(properties) { + return new FieldStore(properties); + }; + + /** + * Encodes the specified FieldStore message. Does not implicitly {@link pg_query.FieldStore.verify|verify} messages. + * @function encode + * @memberof pg_query.FieldStore + * @static + * @param {pg_query.IFieldStore} message FieldStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldStore.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newvals != null && message.newvals.length) + for (var i = 0; i < message.newvals.length; ++i) + $root.pg_query.Node.encode(message.newvals[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.fieldnums != null && message.fieldnums.length) + for (var i = 0; i < message.fieldnums.length; ++i) + $root.pg_query.Node.encode(message.fieldnums[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.resulttype != null && Object.hasOwnProperty.call(message, "resulttype")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.resulttype); + return writer; + }; + + /** + * Encodes the specified FieldStore message, length delimited. Does not implicitly {@link pg_query.FieldStore.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.FieldStore + * @static + * @param {pg_query.IFieldStore} message FieldStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldStore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldStore message from the specified reader or buffer. + * @function decode + * @memberof pg_query.FieldStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.FieldStore} FieldStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldStore.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.FieldStore(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.newvals && message.newvals.length)) + message.newvals = []; + message.newvals.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.fieldnums && message.fieldnums.length)) + message.fieldnums = []; + message.fieldnums.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.resulttype = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldStore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.FieldStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.FieldStore} FieldStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldStore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldStore message. + * @function verify + * @memberof pg_query.FieldStore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldStore.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.newvals != null && message.hasOwnProperty("newvals")) { + if (!Array.isArray(message.newvals)) + return "newvals: array expected"; + for (var i = 0; i < message.newvals.length; ++i) { + var error = $root.pg_query.Node.verify(message.newvals[i]); + if (error) + return "newvals." + error; + } + } + if (message.fieldnums != null && message.hasOwnProperty("fieldnums")) { + if (!Array.isArray(message.fieldnums)) + return "fieldnums: array expected"; + for (var i = 0; i < message.fieldnums.length; ++i) { + var error = $root.pg_query.Node.verify(message.fieldnums[i]); + if (error) + return "fieldnums." + error; + } + } + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + if (!$util.isInteger(message.resulttype)) + return "resulttype: integer expected"; + return null; + }; + + /** + * Creates a FieldStore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.FieldStore + * @static + * @param {Object.} object Plain object + * @returns {pg_query.FieldStore} FieldStore + */ + FieldStore.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.FieldStore) + return object; + var message = new $root.pg_query.FieldStore(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.FieldStore.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.FieldStore.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.newvals) { + if (!Array.isArray(object.newvals)) + throw TypeError(".pg_query.FieldStore.newvals: array expected"); + message.newvals = []; + for (var i = 0; i < object.newvals.length; ++i) { + if (typeof object.newvals[i] !== "object") + throw TypeError(".pg_query.FieldStore.newvals: object expected"); + message.newvals[i] = $root.pg_query.Node.fromObject(object.newvals[i]); + } + } + if (object.fieldnums) { + if (!Array.isArray(object.fieldnums)) + throw TypeError(".pg_query.FieldStore.fieldnums: array expected"); + message.fieldnums = []; + for (var i = 0; i < object.fieldnums.length; ++i) { + if (typeof object.fieldnums[i] !== "object") + throw TypeError(".pg_query.FieldStore.fieldnums: object expected"); + message.fieldnums[i] = $root.pg_query.Node.fromObject(object.fieldnums[i]); + } + } + if (object.resulttype != null) + message.resulttype = object.resulttype >>> 0; + return message; + }; + + /** + * Creates a plain object from a FieldStore message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.FieldStore + * @static + * @param {pg_query.FieldStore} message FieldStore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldStore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.newvals = []; + object.fieldnums = []; + } + if (options.defaults) { + object.xpr = null; + object.arg = null; + object.resulttype = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.newvals && message.newvals.length) { + object.newvals = []; + for (var j = 0; j < message.newvals.length; ++j) + object.newvals[j] = $root.pg_query.Node.toObject(message.newvals[j], options); + } + if (message.fieldnums && message.fieldnums.length) { + object.fieldnums = []; + for (var j = 0; j < message.fieldnums.length; ++j) + object.fieldnums[j] = $root.pg_query.Node.toObject(message.fieldnums[j], options); + } + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + object.resulttype = message.resulttype; + return object; + }; + + /** + * Converts this FieldStore to JSON. + * @function toJSON + * @memberof pg_query.FieldStore + * @instance + * @returns {Object.} JSON object + */ + FieldStore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldStore + * @function getTypeUrl + * @memberof pg_query.FieldStore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldStore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.FieldStore"; + }; + + return FieldStore; + })(); + + pg_query.RelabelType = (function() { + + /** + * Properties of a RelabelType. + * @memberof pg_query + * @interface IRelabelType + * @property {pg_query.INode|null} [xpr] RelabelType xpr + * @property {pg_query.INode|null} [arg] RelabelType arg + * @property {number|null} [resulttype] RelabelType resulttype + * @property {number|null} [resulttypmod] RelabelType resulttypmod + * @property {number|null} [resultcollid] RelabelType resultcollid + * @property {pg_query.CoercionForm|null} [relabelformat] RelabelType relabelformat + * @property {number|null} [location] RelabelType location + */ + + /** + * Constructs a new RelabelType. + * @memberof pg_query + * @classdesc Represents a RelabelType. + * @implements IRelabelType + * @constructor + * @param {pg_query.IRelabelType=} [properties] Properties to set + */ + function RelabelType(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RelabelType xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.RelabelType + * @instance + */ + RelabelType.prototype.xpr = null; + + /** + * RelabelType arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.RelabelType + * @instance + */ + RelabelType.prototype.arg = null; + + /** + * RelabelType resulttype. + * @member {number} resulttype + * @memberof pg_query.RelabelType + * @instance + */ + RelabelType.prototype.resulttype = 0; + + /** + * RelabelType resulttypmod. + * @member {number} resulttypmod + * @memberof pg_query.RelabelType + * @instance + */ + RelabelType.prototype.resulttypmod = 0; + + /** + * RelabelType resultcollid. + * @member {number} resultcollid + * @memberof pg_query.RelabelType + * @instance + */ + RelabelType.prototype.resultcollid = 0; + + /** + * RelabelType relabelformat. + * @member {pg_query.CoercionForm} relabelformat + * @memberof pg_query.RelabelType + * @instance + */ + RelabelType.prototype.relabelformat = 0; + + /** + * RelabelType location. + * @member {number} location + * @memberof pg_query.RelabelType + * @instance + */ + RelabelType.prototype.location = 0; + + /** + * Creates a new RelabelType instance using the specified properties. + * @function create + * @memberof pg_query.RelabelType + * @static + * @param {pg_query.IRelabelType=} [properties] Properties to set + * @returns {pg_query.RelabelType} RelabelType instance + */ + RelabelType.create = function create(properties) { + return new RelabelType(properties); + }; + + /** + * Encodes the specified RelabelType message. Does not implicitly {@link pg_query.RelabelType.verify|verify} messages. + * @function encode + * @memberof pg_query.RelabelType + * @static + * @param {pg_query.IRelabelType} message RelabelType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelabelType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resulttype != null && Object.hasOwnProperty.call(message, "resulttype")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.resulttype); + if (message.resulttypmod != null && Object.hasOwnProperty.call(message, "resulttypmod")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.resulttypmod); + if (message.resultcollid != null && Object.hasOwnProperty.call(message, "resultcollid")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.resultcollid); + if (message.relabelformat != null && Object.hasOwnProperty.call(message, "relabelformat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.relabelformat); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.location); + return writer; + }; + + /** + * Encodes the specified RelabelType message, length delimited. Does not implicitly {@link pg_query.RelabelType.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RelabelType + * @static + * @param {pg_query.IRelabelType} message RelabelType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelabelType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelabelType message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RelabelType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RelabelType} RelabelType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelabelType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RelabelType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resulttype = reader.uint32(); + break; + } + case 4: { + message.resulttypmod = reader.int32(); + break; + } + case 5: { + message.resultcollid = reader.uint32(); + break; + } + case 6: { + message.relabelformat = reader.int32(); + break; + } + case 7: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelabelType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RelabelType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RelabelType} RelabelType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelabelType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelabelType message. + * @function verify + * @memberof pg_query.RelabelType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelabelType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + if (!$util.isInteger(message.resulttype)) + return "resulttype: integer expected"; + if (message.resulttypmod != null && message.hasOwnProperty("resulttypmod")) + if (!$util.isInteger(message.resulttypmod)) + return "resulttypmod: integer expected"; + if (message.resultcollid != null && message.hasOwnProperty("resultcollid")) + if (!$util.isInteger(message.resultcollid)) + return "resultcollid: integer expected"; + if (message.relabelformat != null && message.hasOwnProperty("relabelformat")) + switch (message.relabelformat) { + default: + return "relabelformat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a RelabelType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RelabelType + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RelabelType} RelabelType + */ + RelabelType.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RelabelType) + return object; + var message = new $root.pg_query.RelabelType(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.RelabelType.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.RelabelType.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.resulttype != null) + message.resulttype = object.resulttype >>> 0; + if (object.resulttypmod != null) + message.resulttypmod = object.resulttypmod | 0; + if (object.resultcollid != null) + message.resultcollid = object.resultcollid >>> 0; + switch (object.relabelformat) { + default: + if (typeof object.relabelformat === "number") { + message.relabelformat = object.relabelformat; + break; + } + break; + case "COERCION_FORM_UNDEFINED": + case 0: + message.relabelformat = 0; + break; + case "COERCE_EXPLICIT_CALL": + case 1: + message.relabelformat = 1; + break; + case "COERCE_EXPLICIT_CAST": + case 2: + message.relabelformat = 2; + break; + case "COERCE_IMPLICIT_CAST": + case 3: + message.relabelformat = 3; + break; + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a RelabelType message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RelabelType + * @static + * @param {pg_query.RelabelType} message RelabelType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelabelType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.arg = null; + object.resulttype = 0; + object.resulttypmod = 0; + object.resultcollid = 0; + object.relabelformat = options.enums === String ? "COERCION_FORM_UNDEFINED" : 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + object.resulttype = message.resulttype; + if (message.resulttypmod != null && message.hasOwnProperty("resulttypmod")) + object.resulttypmod = message.resulttypmod; + if (message.resultcollid != null && message.hasOwnProperty("resultcollid")) + object.resultcollid = message.resultcollid; + if (message.relabelformat != null && message.hasOwnProperty("relabelformat")) + object.relabelformat = options.enums === String ? $root.pg_query.CoercionForm[message.relabelformat] === undefined ? message.relabelformat : $root.pg_query.CoercionForm[message.relabelformat] : message.relabelformat; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this RelabelType to JSON. + * @function toJSON + * @memberof pg_query.RelabelType + * @instance + * @returns {Object.} JSON object + */ + RelabelType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RelabelType + * @function getTypeUrl + * @memberof pg_query.RelabelType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelabelType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RelabelType"; + }; + + return RelabelType; + })(); + + pg_query.CoerceViaIO = (function() { + + /** + * Properties of a CoerceViaIO. + * @memberof pg_query + * @interface ICoerceViaIO + * @property {pg_query.INode|null} [xpr] CoerceViaIO xpr + * @property {pg_query.INode|null} [arg] CoerceViaIO arg + * @property {number|null} [resulttype] CoerceViaIO resulttype + * @property {number|null} [resultcollid] CoerceViaIO resultcollid + * @property {pg_query.CoercionForm|null} [coerceformat] CoerceViaIO coerceformat + * @property {number|null} [location] CoerceViaIO location + */ + + /** + * Constructs a new CoerceViaIO. + * @memberof pg_query + * @classdesc Represents a CoerceViaIO. + * @implements ICoerceViaIO + * @constructor + * @param {pg_query.ICoerceViaIO=} [properties] Properties to set + */ + function CoerceViaIO(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CoerceViaIO xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.CoerceViaIO + * @instance + */ + CoerceViaIO.prototype.xpr = null; + + /** + * CoerceViaIO arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.CoerceViaIO + * @instance + */ + CoerceViaIO.prototype.arg = null; + + /** + * CoerceViaIO resulttype. + * @member {number} resulttype + * @memberof pg_query.CoerceViaIO + * @instance + */ + CoerceViaIO.prototype.resulttype = 0; + + /** + * CoerceViaIO resultcollid. + * @member {number} resultcollid + * @memberof pg_query.CoerceViaIO + * @instance + */ + CoerceViaIO.prototype.resultcollid = 0; + + /** + * CoerceViaIO coerceformat. + * @member {pg_query.CoercionForm} coerceformat + * @memberof pg_query.CoerceViaIO + * @instance + */ + CoerceViaIO.prototype.coerceformat = 0; + + /** + * CoerceViaIO location. + * @member {number} location + * @memberof pg_query.CoerceViaIO + * @instance + */ + CoerceViaIO.prototype.location = 0; + + /** + * Creates a new CoerceViaIO instance using the specified properties. + * @function create + * @memberof pg_query.CoerceViaIO + * @static + * @param {pg_query.ICoerceViaIO=} [properties] Properties to set + * @returns {pg_query.CoerceViaIO} CoerceViaIO instance + */ + CoerceViaIO.create = function create(properties) { + return new CoerceViaIO(properties); + }; + + /** + * Encodes the specified CoerceViaIO message. Does not implicitly {@link pg_query.CoerceViaIO.verify|verify} messages. + * @function encode + * @memberof pg_query.CoerceViaIO + * @static + * @param {pg_query.ICoerceViaIO} message CoerceViaIO message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CoerceViaIO.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resulttype != null && Object.hasOwnProperty.call(message, "resulttype")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.resulttype); + if (message.resultcollid != null && Object.hasOwnProperty.call(message, "resultcollid")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.resultcollid); + if (message.coerceformat != null && Object.hasOwnProperty.call(message, "coerceformat")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.coerceformat); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.location); + return writer; + }; + + /** + * Encodes the specified CoerceViaIO message, length delimited. Does not implicitly {@link pg_query.CoerceViaIO.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CoerceViaIO + * @static + * @param {pg_query.ICoerceViaIO} message CoerceViaIO message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CoerceViaIO.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CoerceViaIO message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CoerceViaIO + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CoerceViaIO} CoerceViaIO + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CoerceViaIO.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CoerceViaIO(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resulttype = reader.uint32(); + break; + } + case 4: { + message.resultcollid = reader.uint32(); + break; + } + case 5: { + message.coerceformat = reader.int32(); + break; + } + case 6: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CoerceViaIO message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CoerceViaIO + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CoerceViaIO} CoerceViaIO + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CoerceViaIO.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CoerceViaIO message. + * @function verify + * @memberof pg_query.CoerceViaIO + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CoerceViaIO.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + if (!$util.isInteger(message.resulttype)) + return "resulttype: integer expected"; + if (message.resultcollid != null && message.hasOwnProperty("resultcollid")) + if (!$util.isInteger(message.resultcollid)) + return "resultcollid: integer expected"; + if (message.coerceformat != null && message.hasOwnProperty("coerceformat")) + switch (message.coerceformat) { + default: + return "coerceformat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a CoerceViaIO message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CoerceViaIO + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CoerceViaIO} CoerceViaIO + */ + CoerceViaIO.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CoerceViaIO) + return object; + var message = new $root.pg_query.CoerceViaIO(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.CoerceViaIO.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.CoerceViaIO.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.resulttype != null) + message.resulttype = object.resulttype >>> 0; + if (object.resultcollid != null) + message.resultcollid = object.resultcollid >>> 0; + switch (object.coerceformat) { + default: + if (typeof object.coerceformat === "number") { + message.coerceformat = object.coerceformat; + break; + } + break; + case "COERCION_FORM_UNDEFINED": + case 0: + message.coerceformat = 0; + break; + case "COERCE_EXPLICIT_CALL": + case 1: + message.coerceformat = 1; + break; + case "COERCE_EXPLICIT_CAST": + case 2: + message.coerceformat = 2; + break; + case "COERCE_IMPLICIT_CAST": + case 3: + message.coerceformat = 3; + break; + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a CoerceViaIO message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CoerceViaIO + * @static + * @param {pg_query.CoerceViaIO} message CoerceViaIO + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CoerceViaIO.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.arg = null; + object.resulttype = 0; + object.resultcollid = 0; + object.coerceformat = options.enums === String ? "COERCION_FORM_UNDEFINED" : 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + object.resulttype = message.resulttype; + if (message.resultcollid != null && message.hasOwnProperty("resultcollid")) + object.resultcollid = message.resultcollid; + if (message.coerceformat != null && message.hasOwnProperty("coerceformat")) + object.coerceformat = options.enums === String ? $root.pg_query.CoercionForm[message.coerceformat] === undefined ? message.coerceformat : $root.pg_query.CoercionForm[message.coerceformat] : message.coerceformat; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CoerceViaIO to JSON. + * @function toJSON + * @memberof pg_query.CoerceViaIO + * @instance + * @returns {Object.} JSON object + */ + CoerceViaIO.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CoerceViaIO + * @function getTypeUrl + * @memberof pg_query.CoerceViaIO + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CoerceViaIO.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CoerceViaIO"; + }; + + return CoerceViaIO; + })(); + + pg_query.ArrayCoerceExpr = (function() { + + /** + * Properties of an ArrayCoerceExpr. + * @memberof pg_query + * @interface IArrayCoerceExpr + * @property {pg_query.INode|null} [xpr] ArrayCoerceExpr xpr + * @property {pg_query.INode|null} [arg] ArrayCoerceExpr arg + * @property {pg_query.INode|null} [elemexpr] ArrayCoerceExpr elemexpr + * @property {number|null} [resulttype] ArrayCoerceExpr resulttype + * @property {number|null} [resulttypmod] ArrayCoerceExpr resulttypmod + * @property {number|null} [resultcollid] ArrayCoerceExpr resultcollid + * @property {pg_query.CoercionForm|null} [coerceformat] ArrayCoerceExpr coerceformat + * @property {number|null} [location] ArrayCoerceExpr location + */ + + /** + * Constructs a new ArrayCoerceExpr. + * @memberof pg_query + * @classdesc Represents an ArrayCoerceExpr. + * @implements IArrayCoerceExpr + * @constructor + * @param {pg_query.IArrayCoerceExpr=} [properties] Properties to set + */ + function ArrayCoerceExpr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrayCoerceExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.ArrayCoerceExpr + * @instance + */ + ArrayCoerceExpr.prototype.xpr = null; + + /** + * ArrayCoerceExpr arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.ArrayCoerceExpr + * @instance + */ + ArrayCoerceExpr.prototype.arg = null; + + /** + * ArrayCoerceExpr elemexpr. + * @member {pg_query.INode|null|undefined} elemexpr + * @memberof pg_query.ArrayCoerceExpr + * @instance + */ + ArrayCoerceExpr.prototype.elemexpr = null; + + /** + * ArrayCoerceExpr resulttype. + * @member {number} resulttype + * @memberof pg_query.ArrayCoerceExpr + * @instance + */ + ArrayCoerceExpr.prototype.resulttype = 0; + + /** + * ArrayCoerceExpr resulttypmod. + * @member {number} resulttypmod + * @memberof pg_query.ArrayCoerceExpr + * @instance + */ + ArrayCoerceExpr.prototype.resulttypmod = 0; + + /** + * ArrayCoerceExpr resultcollid. + * @member {number} resultcollid + * @memberof pg_query.ArrayCoerceExpr + * @instance + */ + ArrayCoerceExpr.prototype.resultcollid = 0; + + /** + * ArrayCoerceExpr coerceformat. + * @member {pg_query.CoercionForm} coerceformat + * @memberof pg_query.ArrayCoerceExpr + * @instance + */ + ArrayCoerceExpr.prototype.coerceformat = 0; + + /** + * ArrayCoerceExpr location. + * @member {number} location + * @memberof pg_query.ArrayCoerceExpr + * @instance + */ + ArrayCoerceExpr.prototype.location = 0; + + /** + * Creates a new ArrayCoerceExpr instance using the specified properties. + * @function create + * @memberof pg_query.ArrayCoerceExpr + * @static + * @param {pg_query.IArrayCoerceExpr=} [properties] Properties to set + * @returns {pg_query.ArrayCoerceExpr} ArrayCoerceExpr instance + */ + ArrayCoerceExpr.create = function create(properties) { + return new ArrayCoerceExpr(properties); + }; + + /** + * Encodes the specified ArrayCoerceExpr message. Does not implicitly {@link pg_query.ArrayCoerceExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.ArrayCoerceExpr + * @static + * @param {pg_query.IArrayCoerceExpr} message ArrayCoerceExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayCoerceExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.elemexpr != null && Object.hasOwnProperty.call(message, "elemexpr")) + $root.pg_query.Node.encode(message.elemexpr, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.resulttype != null && Object.hasOwnProperty.call(message, "resulttype")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.resulttype); + if (message.resulttypmod != null && Object.hasOwnProperty.call(message, "resulttypmod")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.resulttypmod); + if (message.resultcollid != null && Object.hasOwnProperty.call(message, "resultcollid")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.resultcollid); + if (message.coerceformat != null && Object.hasOwnProperty.call(message, "coerceformat")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.coerceformat); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.location); + return writer; + }; + + /** + * Encodes the specified ArrayCoerceExpr message, length delimited. Does not implicitly {@link pg_query.ArrayCoerceExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ArrayCoerceExpr + * @static + * @param {pg_query.IArrayCoerceExpr} message ArrayCoerceExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayCoerceExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrayCoerceExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ArrayCoerceExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ArrayCoerceExpr} ArrayCoerceExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayCoerceExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ArrayCoerceExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.elemexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.resulttype = reader.uint32(); + break; + } + case 5: { + message.resulttypmod = reader.int32(); + break; + } + case 6: { + message.resultcollid = reader.uint32(); + break; + } + case 7: { + message.coerceformat = reader.int32(); + break; + } + case 8: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrayCoerceExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ArrayCoerceExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ArrayCoerceExpr} ArrayCoerceExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayCoerceExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrayCoerceExpr message. + * @function verify + * @memberof pg_query.ArrayCoerceExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrayCoerceExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.elemexpr != null && message.hasOwnProperty("elemexpr")) { + var error = $root.pg_query.Node.verify(message.elemexpr); + if (error) + return "elemexpr." + error; + } + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + if (!$util.isInteger(message.resulttype)) + return "resulttype: integer expected"; + if (message.resulttypmod != null && message.hasOwnProperty("resulttypmod")) + if (!$util.isInteger(message.resulttypmod)) + return "resulttypmod: integer expected"; + if (message.resultcollid != null && message.hasOwnProperty("resultcollid")) + if (!$util.isInteger(message.resultcollid)) + return "resultcollid: integer expected"; + if (message.coerceformat != null && message.hasOwnProperty("coerceformat")) + switch (message.coerceformat) { + default: + return "coerceformat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates an ArrayCoerceExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ArrayCoerceExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ArrayCoerceExpr} ArrayCoerceExpr + */ + ArrayCoerceExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ArrayCoerceExpr) + return object; + var message = new $root.pg_query.ArrayCoerceExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.ArrayCoerceExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.ArrayCoerceExpr.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.elemexpr != null) { + if (typeof object.elemexpr !== "object") + throw TypeError(".pg_query.ArrayCoerceExpr.elemexpr: object expected"); + message.elemexpr = $root.pg_query.Node.fromObject(object.elemexpr); + } + if (object.resulttype != null) + message.resulttype = object.resulttype >>> 0; + if (object.resulttypmod != null) + message.resulttypmod = object.resulttypmod | 0; + if (object.resultcollid != null) + message.resultcollid = object.resultcollid >>> 0; + switch (object.coerceformat) { + default: + if (typeof object.coerceformat === "number") { + message.coerceformat = object.coerceformat; + break; + } + break; + case "COERCION_FORM_UNDEFINED": + case 0: + message.coerceformat = 0; + break; + case "COERCE_EXPLICIT_CALL": + case 1: + message.coerceformat = 1; + break; + case "COERCE_EXPLICIT_CAST": + case 2: + message.coerceformat = 2; + break; + case "COERCE_IMPLICIT_CAST": + case 3: + message.coerceformat = 3; + break; + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from an ArrayCoerceExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ArrayCoerceExpr + * @static + * @param {pg_query.ArrayCoerceExpr} message ArrayCoerceExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrayCoerceExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.arg = null; + object.elemexpr = null; + object.resulttype = 0; + object.resulttypmod = 0; + object.resultcollid = 0; + object.coerceformat = options.enums === String ? "COERCION_FORM_UNDEFINED" : 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.elemexpr != null && message.hasOwnProperty("elemexpr")) + object.elemexpr = $root.pg_query.Node.toObject(message.elemexpr, options); + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + object.resulttype = message.resulttype; + if (message.resulttypmod != null && message.hasOwnProperty("resulttypmod")) + object.resulttypmod = message.resulttypmod; + if (message.resultcollid != null && message.hasOwnProperty("resultcollid")) + object.resultcollid = message.resultcollid; + if (message.coerceformat != null && message.hasOwnProperty("coerceformat")) + object.coerceformat = options.enums === String ? $root.pg_query.CoercionForm[message.coerceformat] === undefined ? message.coerceformat : $root.pg_query.CoercionForm[message.coerceformat] : message.coerceformat; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this ArrayCoerceExpr to JSON. + * @function toJSON + * @memberof pg_query.ArrayCoerceExpr + * @instance + * @returns {Object.} JSON object + */ + ArrayCoerceExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArrayCoerceExpr + * @function getTypeUrl + * @memberof pg_query.ArrayCoerceExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrayCoerceExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ArrayCoerceExpr"; + }; + + return ArrayCoerceExpr; + })(); + + pg_query.ConvertRowtypeExpr = (function() { + + /** + * Properties of a ConvertRowtypeExpr. + * @memberof pg_query + * @interface IConvertRowtypeExpr + * @property {pg_query.INode|null} [xpr] ConvertRowtypeExpr xpr + * @property {pg_query.INode|null} [arg] ConvertRowtypeExpr arg + * @property {number|null} [resulttype] ConvertRowtypeExpr resulttype + * @property {pg_query.CoercionForm|null} [convertformat] ConvertRowtypeExpr convertformat + * @property {number|null} [location] ConvertRowtypeExpr location + */ + + /** + * Constructs a new ConvertRowtypeExpr. + * @memberof pg_query + * @classdesc Represents a ConvertRowtypeExpr. + * @implements IConvertRowtypeExpr + * @constructor + * @param {pg_query.IConvertRowtypeExpr=} [properties] Properties to set + */ + function ConvertRowtypeExpr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConvertRowtypeExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.ConvertRowtypeExpr + * @instance + */ + ConvertRowtypeExpr.prototype.xpr = null; + + /** + * ConvertRowtypeExpr arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.ConvertRowtypeExpr + * @instance + */ + ConvertRowtypeExpr.prototype.arg = null; + + /** + * ConvertRowtypeExpr resulttype. + * @member {number} resulttype + * @memberof pg_query.ConvertRowtypeExpr + * @instance + */ + ConvertRowtypeExpr.prototype.resulttype = 0; + + /** + * ConvertRowtypeExpr convertformat. + * @member {pg_query.CoercionForm} convertformat + * @memberof pg_query.ConvertRowtypeExpr + * @instance + */ + ConvertRowtypeExpr.prototype.convertformat = 0; + + /** + * ConvertRowtypeExpr location. + * @member {number} location + * @memberof pg_query.ConvertRowtypeExpr + * @instance + */ + ConvertRowtypeExpr.prototype.location = 0; + + /** + * Creates a new ConvertRowtypeExpr instance using the specified properties. + * @function create + * @memberof pg_query.ConvertRowtypeExpr + * @static + * @param {pg_query.IConvertRowtypeExpr=} [properties] Properties to set + * @returns {pg_query.ConvertRowtypeExpr} ConvertRowtypeExpr instance + */ + ConvertRowtypeExpr.create = function create(properties) { + return new ConvertRowtypeExpr(properties); + }; + + /** + * Encodes the specified ConvertRowtypeExpr message. Does not implicitly {@link pg_query.ConvertRowtypeExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.ConvertRowtypeExpr + * @static + * @param {pg_query.IConvertRowtypeExpr} message ConvertRowtypeExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConvertRowtypeExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resulttype != null && Object.hasOwnProperty.call(message, "resulttype")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.resulttype); + if (message.convertformat != null && Object.hasOwnProperty.call(message, "convertformat")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.convertformat); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified ConvertRowtypeExpr message, length delimited. Does not implicitly {@link pg_query.ConvertRowtypeExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ConvertRowtypeExpr + * @static + * @param {pg_query.IConvertRowtypeExpr} message ConvertRowtypeExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConvertRowtypeExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConvertRowtypeExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ConvertRowtypeExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ConvertRowtypeExpr} ConvertRowtypeExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConvertRowtypeExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ConvertRowtypeExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resulttype = reader.uint32(); + break; + } + case 4: { + message.convertformat = reader.int32(); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConvertRowtypeExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ConvertRowtypeExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ConvertRowtypeExpr} ConvertRowtypeExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConvertRowtypeExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConvertRowtypeExpr message. + * @function verify + * @memberof pg_query.ConvertRowtypeExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConvertRowtypeExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + if (!$util.isInteger(message.resulttype)) + return "resulttype: integer expected"; + if (message.convertformat != null && message.hasOwnProperty("convertformat")) + switch (message.convertformat) { + default: + return "convertformat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a ConvertRowtypeExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ConvertRowtypeExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ConvertRowtypeExpr} ConvertRowtypeExpr + */ + ConvertRowtypeExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ConvertRowtypeExpr) + return object; + var message = new $root.pg_query.ConvertRowtypeExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.ConvertRowtypeExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.ConvertRowtypeExpr.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.resulttype != null) + message.resulttype = object.resulttype >>> 0; + switch (object.convertformat) { + default: + if (typeof object.convertformat === "number") { + message.convertformat = object.convertformat; + break; + } + break; + case "COERCION_FORM_UNDEFINED": + case 0: + message.convertformat = 0; + break; + case "COERCE_EXPLICIT_CALL": + case 1: + message.convertformat = 1; + break; + case "COERCE_EXPLICIT_CAST": + case 2: + message.convertformat = 2; + break; + case "COERCE_IMPLICIT_CAST": + case 3: + message.convertformat = 3; + break; + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a ConvertRowtypeExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ConvertRowtypeExpr + * @static + * @param {pg_query.ConvertRowtypeExpr} message ConvertRowtypeExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConvertRowtypeExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.arg = null; + object.resulttype = 0; + object.convertformat = options.enums === String ? "COERCION_FORM_UNDEFINED" : 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + object.resulttype = message.resulttype; + if (message.convertformat != null && message.hasOwnProperty("convertformat")) + object.convertformat = options.enums === String ? $root.pg_query.CoercionForm[message.convertformat] === undefined ? message.convertformat : $root.pg_query.CoercionForm[message.convertformat] : message.convertformat; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this ConvertRowtypeExpr to JSON. + * @function toJSON + * @memberof pg_query.ConvertRowtypeExpr + * @instance + * @returns {Object.} JSON object + */ + ConvertRowtypeExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConvertRowtypeExpr + * @function getTypeUrl + * @memberof pg_query.ConvertRowtypeExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConvertRowtypeExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ConvertRowtypeExpr"; + }; + + return ConvertRowtypeExpr; + })(); + + pg_query.CollateExpr = (function() { + + /** + * Properties of a CollateExpr. + * @memberof pg_query + * @interface ICollateExpr + * @property {pg_query.INode|null} [xpr] CollateExpr xpr + * @property {pg_query.INode|null} [arg] CollateExpr arg + * @property {number|null} [collOid] CollateExpr collOid + * @property {number|null} [location] CollateExpr location + */ + + /** + * Constructs a new CollateExpr. + * @memberof pg_query + * @classdesc Represents a CollateExpr. + * @implements ICollateExpr + * @constructor + * @param {pg_query.ICollateExpr=} [properties] Properties to set + */ + function CollateExpr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CollateExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.CollateExpr + * @instance + */ + CollateExpr.prototype.xpr = null; + + /** + * CollateExpr arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.CollateExpr + * @instance + */ + CollateExpr.prototype.arg = null; + + /** + * CollateExpr collOid. + * @member {number} collOid + * @memberof pg_query.CollateExpr + * @instance + */ + CollateExpr.prototype.collOid = 0; + + /** + * CollateExpr location. + * @member {number} location + * @memberof pg_query.CollateExpr + * @instance + */ + CollateExpr.prototype.location = 0; + + /** + * Creates a new CollateExpr instance using the specified properties. + * @function create + * @memberof pg_query.CollateExpr + * @static + * @param {pg_query.ICollateExpr=} [properties] Properties to set + * @returns {pg_query.CollateExpr} CollateExpr instance + */ + CollateExpr.create = function create(properties) { + return new CollateExpr(properties); + }; + + /** + * Encodes the specified CollateExpr message. Does not implicitly {@link pg_query.CollateExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.CollateExpr + * @static + * @param {pg_query.ICollateExpr} message CollateExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CollateExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.collOid != null && Object.hasOwnProperty.call(message, "collOid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.collOid); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.location); + return writer; + }; + + /** + * Encodes the specified CollateExpr message, length delimited. Does not implicitly {@link pg_query.CollateExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CollateExpr + * @static + * @param {pg_query.ICollateExpr} message CollateExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CollateExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CollateExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CollateExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CollateExpr} CollateExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CollateExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CollateExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.collOid = reader.uint32(); + break; + } + case 4: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CollateExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CollateExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CollateExpr} CollateExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CollateExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CollateExpr message. + * @function verify + * @memberof pg_query.CollateExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CollateExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.collOid != null && message.hasOwnProperty("collOid")) + if (!$util.isInteger(message.collOid)) + return "collOid: integer expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a CollateExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CollateExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CollateExpr} CollateExpr + */ + CollateExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CollateExpr) + return object; + var message = new $root.pg_query.CollateExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.CollateExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.CollateExpr.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.collOid != null) + message.collOid = object.collOid >>> 0; + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a CollateExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CollateExpr + * @static + * @param {pg_query.CollateExpr} message CollateExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CollateExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.arg = null; + object.collOid = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.collOid != null && message.hasOwnProperty("collOid")) + object.collOid = message.collOid; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CollateExpr to JSON. + * @function toJSON + * @memberof pg_query.CollateExpr + * @instance + * @returns {Object.} JSON object + */ + CollateExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CollateExpr + * @function getTypeUrl + * @memberof pg_query.CollateExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CollateExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CollateExpr"; + }; + + return CollateExpr; + })(); + + pg_query.CaseExpr = (function() { + + /** + * Properties of a CaseExpr. + * @memberof pg_query + * @interface ICaseExpr + * @property {pg_query.INode|null} [xpr] CaseExpr xpr + * @property {number|null} [casetype] CaseExpr casetype + * @property {number|null} [casecollid] CaseExpr casecollid + * @property {pg_query.INode|null} [arg] CaseExpr arg + * @property {Array.|null} [args] CaseExpr args + * @property {pg_query.INode|null} [defresult] CaseExpr defresult + * @property {number|null} [location] CaseExpr location + */ + + /** + * Constructs a new CaseExpr. + * @memberof pg_query + * @classdesc Represents a CaseExpr. + * @implements ICaseExpr + * @constructor + * @param {pg_query.ICaseExpr=} [properties] Properties to set + */ + function CaseExpr(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CaseExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.CaseExpr + * @instance + */ + CaseExpr.prototype.xpr = null; + + /** + * CaseExpr casetype. + * @member {number} casetype + * @memberof pg_query.CaseExpr + * @instance + */ + CaseExpr.prototype.casetype = 0; + + /** + * CaseExpr casecollid. + * @member {number} casecollid + * @memberof pg_query.CaseExpr + * @instance + */ + CaseExpr.prototype.casecollid = 0; + + /** + * CaseExpr arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.CaseExpr + * @instance + */ + CaseExpr.prototype.arg = null; + + /** + * CaseExpr args. + * @member {Array.} args + * @memberof pg_query.CaseExpr + * @instance + */ + CaseExpr.prototype.args = $util.emptyArray; + + /** + * CaseExpr defresult. + * @member {pg_query.INode|null|undefined} defresult + * @memberof pg_query.CaseExpr + * @instance + */ + CaseExpr.prototype.defresult = null; + + /** + * CaseExpr location. + * @member {number} location + * @memberof pg_query.CaseExpr + * @instance + */ + CaseExpr.prototype.location = 0; + + /** + * Creates a new CaseExpr instance using the specified properties. + * @function create + * @memberof pg_query.CaseExpr + * @static + * @param {pg_query.ICaseExpr=} [properties] Properties to set + * @returns {pg_query.CaseExpr} CaseExpr instance + */ + CaseExpr.create = function create(properties) { + return new CaseExpr(properties); + }; + + /** + * Encodes the specified CaseExpr message. Does not implicitly {@link pg_query.CaseExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.CaseExpr + * @static + * @param {pg_query.ICaseExpr} message CaseExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.casetype != null && Object.hasOwnProperty.call(message, "casetype")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.casetype); + if (message.casecollid != null && Object.hasOwnProperty.call(message, "casecollid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.casecollid); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.defresult != null && Object.hasOwnProperty.call(message, "defresult")) + $root.pg_query.Node.encode(message.defresult, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.location); + return writer; + }; + + /** + * Encodes the specified CaseExpr message, length delimited. Does not implicitly {@link pg_query.CaseExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CaseExpr + * @static + * @param {pg_query.ICaseExpr} message CaseExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaseExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CaseExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CaseExpr} CaseExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CaseExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.casetype = reader.uint32(); + break; + } + case 3: { + message.casecollid = reader.uint32(); + break; + } + case 4: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.defresult = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 7: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CaseExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CaseExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CaseExpr} CaseExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaseExpr message. + * @function verify + * @memberof pg_query.CaseExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaseExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.casetype != null && message.hasOwnProperty("casetype")) + if (!$util.isInteger(message.casetype)) + return "casetype: integer expected"; + if (message.casecollid != null && message.hasOwnProperty("casecollid")) + if (!$util.isInteger(message.casecollid)) + return "casecollid: integer expected"; + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.defresult != null && message.hasOwnProperty("defresult")) { + var error = $root.pg_query.Node.verify(message.defresult); + if (error) + return "defresult." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a CaseExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CaseExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CaseExpr} CaseExpr + */ + CaseExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CaseExpr) + return object; + var message = new $root.pg_query.CaseExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.CaseExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.casetype != null) + message.casetype = object.casetype >>> 0; + if (object.casecollid != null) + message.casecollid = object.casecollid >>> 0; + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.CaseExpr.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.CaseExpr.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.CaseExpr.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.defresult != null) { + if (typeof object.defresult !== "object") + throw TypeError(".pg_query.CaseExpr.defresult: object expected"); + message.defresult = $root.pg_query.Node.fromObject(object.defresult); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a CaseExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CaseExpr + * @static + * @param {pg_query.CaseExpr} message CaseExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaseExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.xpr = null; + object.casetype = 0; + object.casecollid = 0; + object.arg = null; + object.defresult = null; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.casetype != null && message.hasOwnProperty("casetype")) + object.casetype = message.casetype; + if (message.casecollid != null && message.hasOwnProperty("casecollid")) + object.casecollid = message.casecollid; + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.defresult != null && message.hasOwnProperty("defresult")) + object.defresult = $root.pg_query.Node.toObject(message.defresult, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CaseExpr to JSON. + * @function toJSON + * @memberof pg_query.CaseExpr + * @instance + * @returns {Object.} JSON object + */ + CaseExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaseExpr + * @function getTypeUrl + * @memberof pg_query.CaseExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaseExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CaseExpr"; + }; + + return CaseExpr; + })(); + + pg_query.CaseWhen = (function() { + + /** + * Properties of a CaseWhen. + * @memberof pg_query + * @interface ICaseWhen + * @property {pg_query.INode|null} [xpr] CaseWhen xpr + * @property {pg_query.INode|null} [expr] CaseWhen expr + * @property {pg_query.INode|null} [result] CaseWhen result + * @property {number|null} [location] CaseWhen location + */ + + /** + * Constructs a new CaseWhen. + * @memberof pg_query + * @classdesc Represents a CaseWhen. + * @implements ICaseWhen + * @constructor + * @param {pg_query.ICaseWhen=} [properties] Properties to set + */ + function CaseWhen(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CaseWhen xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.CaseWhen + * @instance + */ + CaseWhen.prototype.xpr = null; + + /** + * CaseWhen expr. + * @member {pg_query.INode|null|undefined} expr + * @memberof pg_query.CaseWhen + * @instance + */ + CaseWhen.prototype.expr = null; + + /** + * CaseWhen result. + * @member {pg_query.INode|null|undefined} result + * @memberof pg_query.CaseWhen + * @instance + */ + CaseWhen.prototype.result = null; + + /** + * CaseWhen location. + * @member {number} location + * @memberof pg_query.CaseWhen + * @instance + */ + CaseWhen.prototype.location = 0; + + /** + * Creates a new CaseWhen instance using the specified properties. + * @function create + * @memberof pg_query.CaseWhen + * @static + * @param {pg_query.ICaseWhen=} [properties] Properties to set + * @returns {pg_query.CaseWhen} CaseWhen instance + */ + CaseWhen.create = function create(properties) { + return new CaseWhen(properties); + }; + + /** + * Encodes the specified CaseWhen message. Does not implicitly {@link pg_query.CaseWhen.verify|verify} messages. + * @function encode + * @memberof pg_query.CaseWhen + * @static + * @param {pg_query.ICaseWhen} message CaseWhen message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseWhen.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.expr != null && Object.hasOwnProperty.call(message, "expr")) + $root.pg_query.Node.encode(message.expr, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + $root.pg_query.Node.encode(message.result, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.location); + return writer; + }; + + /** + * Encodes the specified CaseWhen message, length delimited. Does not implicitly {@link pg_query.CaseWhen.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CaseWhen + * @static + * @param {pg_query.ICaseWhen} message CaseWhen message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseWhen.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaseWhen message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CaseWhen + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CaseWhen} CaseWhen + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseWhen.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CaseWhen(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.expr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.result = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CaseWhen message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CaseWhen + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CaseWhen} CaseWhen + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseWhen.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaseWhen message. + * @function verify + * @memberof pg_query.CaseWhen + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaseWhen.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.expr != null && message.hasOwnProperty("expr")) { + var error = $root.pg_query.Node.verify(message.expr); + if (error) + return "expr." + error; + } + if (message.result != null && message.hasOwnProperty("result")) { + var error = $root.pg_query.Node.verify(message.result); + if (error) + return "result." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a CaseWhen message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CaseWhen + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CaseWhen} CaseWhen + */ + CaseWhen.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CaseWhen) + return object; + var message = new $root.pg_query.CaseWhen(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.CaseWhen.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.expr != null) { + if (typeof object.expr !== "object") + throw TypeError(".pg_query.CaseWhen.expr: object expected"); + message.expr = $root.pg_query.Node.fromObject(object.expr); + } + if (object.result != null) { + if (typeof object.result !== "object") + throw TypeError(".pg_query.CaseWhen.result: object expected"); + message.result = $root.pg_query.Node.fromObject(object.result); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a CaseWhen message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CaseWhen + * @static + * @param {pg_query.CaseWhen} message CaseWhen + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaseWhen.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.expr = null; + object.result = null; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.expr != null && message.hasOwnProperty("expr")) + object.expr = $root.pg_query.Node.toObject(message.expr, options); + if (message.result != null && message.hasOwnProperty("result")) + object.result = $root.pg_query.Node.toObject(message.result, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CaseWhen to JSON. + * @function toJSON + * @memberof pg_query.CaseWhen + * @instance + * @returns {Object.} JSON object + */ + CaseWhen.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaseWhen + * @function getTypeUrl + * @memberof pg_query.CaseWhen + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaseWhen.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CaseWhen"; + }; + + return CaseWhen; + })(); + + pg_query.CaseTestExpr = (function() { + + /** + * Properties of a CaseTestExpr. + * @memberof pg_query + * @interface ICaseTestExpr + * @property {pg_query.INode|null} [xpr] CaseTestExpr xpr + * @property {number|null} [typeId] CaseTestExpr typeId + * @property {number|null} [typeMod] CaseTestExpr typeMod + * @property {number|null} [collation] CaseTestExpr collation + */ + + /** + * Constructs a new CaseTestExpr. + * @memberof pg_query + * @classdesc Represents a CaseTestExpr. + * @implements ICaseTestExpr + * @constructor + * @param {pg_query.ICaseTestExpr=} [properties] Properties to set + */ + function CaseTestExpr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CaseTestExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.CaseTestExpr + * @instance + */ + CaseTestExpr.prototype.xpr = null; + + /** + * CaseTestExpr typeId. + * @member {number} typeId + * @memberof pg_query.CaseTestExpr + * @instance + */ + CaseTestExpr.prototype.typeId = 0; + + /** + * CaseTestExpr typeMod. + * @member {number} typeMod + * @memberof pg_query.CaseTestExpr + * @instance + */ + CaseTestExpr.prototype.typeMod = 0; + + /** + * CaseTestExpr collation. + * @member {number} collation + * @memberof pg_query.CaseTestExpr + * @instance + */ + CaseTestExpr.prototype.collation = 0; + + /** + * Creates a new CaseTestExpr instance using the specified properties. + * @function create + * @memberof pg_query.CaseTestExpr + * @static + * @param {pg_query.ICaseTestExpr=} [properties] Properties to set + * @returns {pg_query.CaseTestExpr} CaseTestExpr instance + */ + CaseTestExpr.create = function create(properties) { + return new CaseTestExpr(properties); + }; + + /** + * Encodes the specified CaseTestExpr message. Does not implicitly {@link pg_query.CaseTestExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.CaseTestExpr + * @static + * @param {pg_query.ICaseTestExpr} message CaseTestExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseTestExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.typeId != null && Object.hasOwnProperty.call(message, "typeId")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.typeId); + if (message.typeMod != null && Object.hasOwnProperty.call(message, "typeMod")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.typeMod); + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.collation); + return writer; + }; + + /** + * Encodes the specified CaseTestExpr message, length delimited. Does not implicitly {@link pg_query.CaseTestExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CaseTestExpr + * @static + * @param {pg_query.ICaseTestExpr} message CaseTestExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CaseTestExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CaseTestExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CaseTestExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CaseTestExpr} CaseTestExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseTestExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CaseTestExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.typeId = reader.uint32(); + break; + } + case 3: { + message.typeMod = reader.int32(); + break; + } + case 4: { + message.collation = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CaseTestExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CaseTestExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CaseTestExpr} CaseTestExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CaseTestExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CaseTestExpr message. + * @function verify + * @memberof pg_query.CaseTestExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CaseTestExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.typeId != null && message.hasOwnProperty("typeId")) + if (!$util.isInteger(message.typeId)) + return "typeId: integer expected"; + if (message.typeMod != null && message.hasOwnProperty("typeMod")) + if (!$util.isInteger(message.typeMod)) + return "typeMod: integer expected"; + if (message.collation != null && message.hasOwnProperty("collation")) + if (!$util.isInteger(message.collation)) + return "collation: integer expected"; + return null; + }; + + /** + * Creates a CaseTestExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CaseTestExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CaseTestExpr} CaseTestExpr + */ + CaseTestExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CaseTestExpr) + return object; + var message = new $root.pg_query.CaseTestExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.CaseTestExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.typeId != null) + message.typeId = object.typeId >>> 0; + if (object.typeMod != null) + message.typeMod = object.typeMod | 0; + if (object.collation != null) + message.collation = object.collation >>> 0; + return message; + }; + + /** + * Creates a plain object from a CaseTestExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CaseTestExpr + * @static + * @param {pg_query.CaseTestExpr} message CaseTestExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CaseTestExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.typeId = 0; + object.typeMod = 0; + object.collation = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.typeId != null && message.hasOwnProperty("typeId")) + object.typeId = message.typeId; + if (message.typeMod != null && message.hasOwnProperty("typeMod")) + object.typeMod = message.typeMod; + if (message.collation != null && message.hasOwnProperty("collation")) + object.collation = message.collation; + return object; + }; + + /** + * Converts this CaseTestExpr to JSON. + * @function toJSON + * @memberof pg_query.CaseTestExpr + * @instance + * @returns {Object.} JSON object + */ + CaseTestExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CaseTestExpr + * @function getTypeUrl + * @memberof pg_query.CaseTestExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CaseTestExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CaseTestExpr"; + }; + + return CaseTestExpr; + })(); + + pg_query.ArrayExpr = (function() { + + /** + * Properties of an ArrayExpr. + * @memberof pg_query + * @interface IArrayExpr + * @property {pg_query.INode|null} [xpr] ArrayExpr xpr + * @property {number|null} [array_typeid] ArrayExpr array_typeid + * @property {number|null} [array_collid] ArrayExpr array_collid + * @property {number|null} [element_typeid] ArrayExpr element_typeid + * @property {Array.|null} [elements] ArrayExpr elements + * @property {boolean|null} [multidims] ArrayExpr multidims + * @property {number|null} [location] ArrayExpr location + */ + + /** + * Constructs a new ArrayExpr. + * @memberof pg_query + * @classdesc Represents an ArrayExpr. + * @implements IArrayExpr + * @constructor + * @param {pg_query.IArrayExpr=} [properties] Properties to set + */ + function ArrayExpr(properties) { + this.elements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrayExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.ArrayExpr + * @instance + */ + ArrayExpr.prototype.xpr = null; + + /** + * ArrayExpr array_typeid. + * @member {number} array_typeid + * @memberof pg_query.ArrayExpr + * @instance + */ + ArrayExpr.prototype.array_typeid = 0; + + /** + * ArrayExpr array_collid. + * @member {number} array_collid + * @memberof pg_query.ArrayExpr + * @instance + */ + ArrayExpr.prototype.array_collid = 0; + + /** + * ArrayExpr element_typeid. + * @member {number} element_typeid + * @memberof pg_query.ArrayExpr + * @instance + */ + ArrayExpr.prototype.element_typeid = 0; + + /** + * ArrayExpr elements. + * @member {Array.} elements + * @memberof pg_query.ArrayExpr + * @instance + */ + ArrayExpr.prototype.elements = $util.emptyArray; + + /** + * ArrayExpr multidims. + * @member {boolean} multidims + * @memberof pg_query.ArrayExpr + * @instance + */ + ArrayExpr.prototype.multidims = false; + + /** + * ArrayExpr location. + * @member {number} location + * @memberof pg_query.ArrayExpr + * @instance + */ + ArrayExpr.prototype.location = 0; + + /** + * Creates a new ArrayExpr instance using the specified properties. + * @function create + * @memberof pg_query.ArrayExpr + * @static + * @param {pg_query.IArrayExpr=} [properties] Properties to set + * @returns {pg_query.ArrayExpr} ArrayExpr instance + */ + ArrayExpr.create = function create(properties) { + return new ArrayExpr(properties); + }; + + /** + * Encodes the specified ArrayExpr message. Does not implicitly {@link pg_query.ArrayExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.ArrayExpr + * @static + * @param {pg_query.IArrayExpr} message ArrayExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.array_typeid != null && Object.hasOwnProperty.call(message, "array_typeid")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.array_typeid); + if (message.array_collid != null && Object.hasOwnProperty.call(message, "array_collid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.array_collid); + if (message.element_typeid != null && Object.hasOwnProperty.call(message, "element_typeid")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.element_typeid); + if (message.elements != null && message.elements.length) + for (var i = 0; i < message.elements.length; ++i) + $root.pg_query.Node.encode(message.elements[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.multidims != null && Object.hasOwnProperty.call(message, "multidims")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.multidims); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.location); + return writer; + }; + + /** + * Encodes the specified ArrayExpr message, length delimited. Does not implicitly {@link pg_query.ArrayExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ArrayExpr + * @static + * @param {pg_query.IArrayExpr} message ArrayExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrayExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ArrayExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ArrayExpr} ArrayExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ArrayExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.array_typeid = reader.uint32(); + break; + } + case 3: { + message.array_collid = reader.uint32(); + break; + } + case 4: { + message.element_typeid = reader.uint32(); + break; + } + case 5: { + if (!(message.elements && message.elements.length)) + message.elements = []; + message.elements.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.multidims = reader.bool(); + break; + } + case 7: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrayExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ArrayExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ArrayExpr} ArrayExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrayExpr message. + * @function verify + * @memberof pg_query.ArrayExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrayExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.array_typeid != null && message.hasOwnProperty("array_typeid")) + if (!$util.isInteger(message.array_typeid)) + return "array_typeid: integer expected"; + if (message.array_collid != null && message.hasOwnProperty("array_collid")) + if (!$util.isInteger(message.array_collid)) + return "array_collid: integer expected"; + if (message.element_typeid != null && message.hasOwnProperty("element_typeid")) + if (!$util.isInteger(message.element_typeid)) + return "element_typeid: integer expected"; + if (message.elements != null && message.hasOwnProperty("elements")) { + if (!Array.isArray(message.elements)) + return "elements: array expected"; + for (var i = 0; i < message.elements.length; ++i) { + var error = $root.pg_query.Node.verify(message.elements[i]); + if (error) + return "elements." + error; + } + } + if (message.multidims != null && message.hasOwnProperty("multidims")) + if (typeof message.multidims !== "boolean") + return "multidims: boolean expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates an ArrayExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ArrayExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ArrayExpr} ArrayExpr + */ + ArrayExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ArrayExpr) + return object; + var message = new $root.pg_query.ArrayExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.ArrayExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.array_typeid != null) + message.array_typeid = object.array_typeid >>> 0; + if (object.array_collid != null) + message.array_collid = object.array_collid >>> 0; + if (object.element_typeid != null) + message.element_typeid = object.element_typeid >>> 0; + if (object.elements) { + if (!Array.isArray(object.elements)) + throw TypeError(".pg_query.ArrayExpr.elements: array expected"); + message.elements = []; + for (var i = 0; i < object.elements.length; ++i) { + if (typeof object.elements[i] !== "object") + throw TypeError(".pg_query.ArrayExpr.elements: object expected"); + message.elements[i] = $root.pg_query.Node.fromObject(object.elements[i]); + } + } + if (object.multidims != null) + message.multidims = Boolean(object.multidims); + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from an ArrayExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ArrayExpr + * @static + * @param {pg_query.ArrayExpr} message ArrayExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrayExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.elements = []; + if (options.defaults) { + object.xpr = null; + object.array_typeid = 0; + object.array_collid = 0; + object.element_typeid = 0; + object.multidims = false; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.array_typeid != null && message.hasOwnProperty("array_typeid")) + object.array_typeid = message.array_typeid; + if (message.array_collid != null && message.hasOwnProperty("array_collid")) + object.array_collid = message.array_collid; + if (message.element_typeid != null && message.hasOwnProperty("element_typeid")) + object.element_typeid = message.element_typeid; + if (message.elements && message.elements.length) { + object.elements = []; + for (var j = 0; j < message.elements.length; ++j) + object.elements[j] = $root.pg_query.Node.toObject(message.elements[j], options); + } + if (message.multidims != null && message.hasOwnProperty("multidims")) + object.multidims = message.multidims; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this ArrayExpr to JSON. + * @function toJSON + * @memberof pg_query.ArrayExpr + * @instance + * @returns {Object.} JSON object + */ + ArrayExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArrayExpr + * @function getTypeUrl + * @memberof pg_query.ArrayExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArrayExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ArrayExpr"; + }; + + return ArrayExpr; + })(); + + pg_query.RowExpr = (function() { + + /** + * Properties of a RowExpr. + * @memberof pg_query + * @interface IRowExpr + * @property {pg_query.INode|null} [xpr] RowExpr xpr + * @property {Array.|null} [args] RowExpr args + * @property {number|null} [row_typeid] RowExpr row_typeid + * @property {pg_query.CoercionForm|null} [row_format] RowExpr row_format + * @property {Array.|null} [colnames] RowExpr colnames + * @property {number|null} [location] RowExpr location + */ + + /** + * Constructs a new RowExpr. + * @memberof pg_query + * @classdesc Represents a RowExpr. + * @implements IRowExpr + * @constructor + * @param {pg_query.IRowExpr=} [properties] Properties to set + */ + function RowExpr(properties) { + this.args = []; + this.colnames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.RowExpr + * @instance + */ + RowExpr.prototype.xpr = null; + + /** + * RowExpr args. + * @member {Array.} args + * @memberof pg_query.RowExpr + * @instance + */ + RowExpr.prototype.args = $util.emptyArray; + + /** + * RowExpr row_typeid. + * @member {number} row_typeid + * @memberof pg_query.RowExpr + * @instance + */ + RowExpr.prototype.row_typeid = 0; + + /** + * RowExpr row_format. + * @member {pg_query.CoercionForm} row_format + * @memberof pg_query.RowExpr + * @instance + */ + RowExpr.prototype.row_format = 0; + + /** + * RowExpr colnames. + * @member {Array.} colnames + * @memberof pg_query.RowExpr + * @instance + */ + RowExpr.prototype.colnames = $util.emptyArray; + + /** + * RowExpr location. + * @member {number} location + * @memberof pg_query.RowExpr + * @instance + */ + RowExpr.prototype.location = 0; + + /** + * Creates a new RowExpr instance using the specified properties. + * @function create + * @memberof pg_query.RowExpr + * @static + * @param {pg_query.IRowExpr=} [properties] Properties to set + * @returns {pg_query.RowExpr} RowExpr instance + */ + RowExpr.create = function create(properties) { + return new RowExpr(properties); + }; + + /** + * Encodes the specified RowExpr message. Does not implicitly {@link pg_query.RowExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.RowExpr + * @static + * @param {pg_query.IRowExpr} message RowExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.row_typeid != null && Object.hasOwnProperty.call(message, "row_typeid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.row_typeid); + if (message.row_format != null && Object.hasOwnProperty.call(message, "row_format")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.row_format); + if (message.colnames != null && message.colnames.length) + for (var i = 0; i < message.colnames.length; ++i) + $root.pg_query.Node.encode(message.colnames[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.location); + return writer; + }; + + /** + * Encodes the specified RowExpr message, length delimited. Does not implicitly {@link pg_query.RowExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RowExpr + * @static + * @param {pg_query.IRowExpr} message RowExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RowExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RowExpr} RowExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RowExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.row_typeid = reader.uint32(); + break; + } + case 4: { + message.row_format = reader.int32(); + break; + } + case 5: { + if (!(message.colnames && message.colnames.length)) + message.colnames = []; + message.colnames.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RowExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RowExpr} RowExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowExpr message. + * @function verify + * @memberof pg_query.RowExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.row_typeid != null && message.hasOwnProperty("row_typeid")) + if (!$util.isInteger(message.row_typeid)) + return "row_typeid: integer expected"; + if (message.row_format != null && message.hasOwnProperty("row_format")) + switch (message.row_format) { + default: + return "row_format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.colnames != null && message.hasOwnProperty("colnames")) { + if (!Array.isArray(message.colnames)) + return "colnames: array expected"; + for (var i = 0; i < message.colnames.length; ++i) { + var error = $root.pg_query.Node.verify(message.colnames[i]); + if (error) + return "colnames." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a RowExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RowExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RowExpr} RowExpr + */ + RowExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RowExpr) + return object; + var message = new $root.pg_query.RowExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.RowExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.RowExpr.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.RowExpr.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.row_typeid != null) + message.row_typeid = object.row_typeid >>> 0; + switch (object.row_format) { + default: + if (typeof object.row_format === "number") { + message.row_format = object.row_format; + break; + } + break; + case "COERCION_FORM_UNDEFINED": + case 0: + message.row_format = 0; + break; + case "COERCE_EXPLICIT_CALL": + case 1: + message.row_format = 1; + break; + case "COERCE_EXPLICIT_CAST": + case 2: + message.row_format = 2; + break; + case "COERCE_IMPLICIT_CAST": + case 3: + message.row_format = 3; + break; + } + if (object.colnames) { + if (!Array.isArray(object.colnames)) + throw TypeError(".pg_query.RowExpr.colnames: array expected"); + message.colnames = []; + for (var i = 0; i < object.colnames.length; ++i) { + if (typeof object.colnames[i] !== "object") + throw TypeError(".pg_query.RowExpr.colnames: object expected"); + message.colnames[i] = $root.pg_query.Node.fromObject(object.colnames[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a RowExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RowExpr + * @static + * @param {pg_query.RowExpr} message RowExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.args = []; + object.colnames = []; + } + if (options.defaults) { + object.xpr = null; + object.row_typeid = 0; + object.row_format = options.enums === String ? "COERCION_FORM_UNDEFINED" : 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.row_typeid != null && message.hasOwnProperty("row_typeid")) + object.row_typeid = message.row_typeid; + if (message.row_format != null && message.hasOwnProperty("row_format")) + object.row_format = options.enums === String ? $root.pg_query.CoercionForm[message.row_format] === undefined ? message.row_format : $root.pg_query.CoercionForm[message.row_format] : message.row_format; + if (message.colnames && message.colnames.length) { + object.colnames = []; + for (var j = 0; j < message.colnames.length; ++j) + object.colnames[j] = $root.pg_query.Node.toObject(message.colnames[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this RowExpr to JSON. + * @function toJSON + * @memberof pg_query.RowExpr + * @instance + * @returns {Object.} JSON object + */ + RowExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowExpr + * @function getTypeUrl + * @memberof pg_query.RowExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RowExpr"; + }; + + return RowExpr; + })(); + + pg_query.RowCompareExpr = (function() { + + /** + * Properties of a RowCompareExpr. + * @memberof pg_query + * @interface IRowCompareExpr + * @property {pg_query.INode|null} [xpr] RowCompareExpr xpr + * @property {pg_query.RowCompareType|null} [rctype] RowCompareExpr rctype + * @property {Array.|null} [opnos] RowCompareExpr opnos + * @property {Array.|null} [opfamilies] RowCompareExpr opfamilies + * @property {Array.|null} [inputcollids] RowCompareExpr inputcollids + * @property {Array.|null} [largs] RowCompareExpr largs + * @property {Array.|null} [rargs] RowCompareExpr rargs + */ + + /** + * Constructs a new RowCompareExpr. + * @memberof pg_query + * @classdesc Represents a RowCompareExpr. + * @implements IRowCompareExpr + * @constructor + * @param {pg_query.IRowCompareExpr=} [properties] Properties to set + */ + function RowCompareExpr(properties) { + this.opnos = []; + this.opfamilies = []; + this.inputcollids = []; + this.largs = []; + this.rargs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowCompareExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.RowCompareExpr + * @instance + */ + RowCompareExpr.prototype.xpr = null; + + /** + * RowCompareExpr rctype. + * @member {pg_query.RowCompareType} rctype + * @memberof pg_query.RowCompareExpr + * @instance + */ + RowCompareExpr.prototype.rctype = 0; + + /** + * RowCompareExpr opnos. + * @member {Array.} opnos + * @memberof pg_query.RowCompareExpr + * @instance + */ + RowCompareExpr.prototype.opnos = $util.emptyArray; + + /** + * RowCompareExpr opfamilies. + * @member {Array.} opfamilies + * @memberof pg_query.RowCompareExpr + * @instance + */ + RowCompareExpr.prototype.opfamilies = $util.emptyArray; + + /** + * RowCompareExpr inputcollids. + * @member {Array.} inputcollids + * @memberof pg_query.RowCompareExpr + * @instance + */ + RowCompareExpr.prototype.inputcollids = $util.emptyArray; + + /** + * RowCompareExpr largs. + * @member {Array.} largs + * @memberof pg_query.RowCompareExpr + * @instance + */ + RowCompareExpr.prototype.largs = $util.emptyArray; + + /** + * RowCompareExpr rargs. + * @member {Array.} rargs + * @memberof pg_query.RowCompareExpr + * @instance + */ + RowCompareExpr.prototype.rargs = $util.emptyArray; + + /** + * Creates a new RowCompareExpr instance using the specified properties. + * @function create + * @memberof pg_query.RowCompareExpr + * @static + * @param {pg_query.IRowCompareExpr=} [properties] Properties to set + * @returns {pg_query.RowCompareExpr} RowCompareExpr instance + */ + RowCompareExpr.create = function create(properties) { + return new RowCompareExpr(properties); + }; + + /** + * Encodes the specified RowCompareExpr message. Does not implicitly {@link pg_query.RowCompareExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.RowCompareExpr + * @static + * @param {pg_query.IRowCompareExpr} message RowCompareExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowCompareExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rctype != null && Object.hasOwnProperty.call(message, "rctype")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rctype); + if (message.opnos != null && message.opnos.length) + for (var i = 0; i < message.opnos.length; ++i) + $root.pg_query.Node.encode(message.opnos[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.opfamilies != null && message.opfamilies.length) + for (var i = 0; i < message.opfamilies.length; ++i) + $root.pg_query.Node.encode(message.opfamilies[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputcollids != null && message.inputcollids.length) + for (var i = 0; i < message.inputcollids.length; ++i) + $root.pg_query.Node.encode(message.inputcollids[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.largs != null && message.largs.length) + for (var i = 0; i < message.largs.length; ++i) + $root.pg_query.Node.encode(message.largs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.rargs != null && message.rargs.length) + for (var i = 0; i < message.rargs.length; ++i) + $root.pg_query.Node.encode(message.rargs[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RowCompareExpr message, length delimited. Does not implicitly {@link pg_query.RowCompareExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RowCompareExpr + * @static + * @param {pg_query.IRowCompareExpr} message RowCompareExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowCompareExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowCompareExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RowCompareExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RowCompareExpr} RowCompareExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowCompareExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RowCompareExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.rctype = reader.int32(); + break; + } + case 3: { + if (!(message.opnos && message.opnos.length)) + message.opnos = []; + message.opnos.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.opfamilies && message.opfamilies.length)) + message.opfamilies = []; + message.opfamilies.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.inputcollids && message.inputcollids.length)) + message.inputcollids = []; + message.inputcollids.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.largs && message.largs.length)) + message.largs = []; + message.largs.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.rargs && message.rargs.length)) + message.rargs = []; + message.rargs.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowCompareExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RowCompareExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RowCompareExpr} RowCompareExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowCompareExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowCompareExpr message. + * @function verify + * @memberof pg_query.RowCompareExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowCompareExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.rctype != null && message.hasOwnProperty("rctype")) + switch (message.rctype) { + default: + return "rctype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.opnos != null && message.hasOwnProperty("opnos")) { + if (!Array.isArray(message.opnos)) + return "opnos: array expected"; + for (var i = 0; i < message.opnos.length; ++i) { + var error = $root.pg_query.Node.verify(message.opnos[i]); + if (error) + return "opnos." + error; + } + } + if (message.opfamilies != null && message.hasOwnProperty("opfamilies")) { + if (!Array.isArray(message.opfamilies)) + return "opfamilies: array expected"; + for (var i = 0; i < message.opfamilies.length; ++i) { + var error = $root.pg_query.Node.verify(message.opfamilies[i]); + if (error) + return "opfamilies." + error; + } + } + if (message.inputcollids != null && message.hasOwnProperty("inputcollids")) { + if (!Array.isArray(message.inputcollids)) + return "inputcollids: array expected"; + for (var i = 0; i < message.inputcollids.length; ++i) { + var error = $root.pg_query.Node.verify(message.inputcollids[i]); + if (error) + return "inputcollids." + error; + } + } + if (message.largs != null && message.hasOwnProperty("largs")) { + if (!Array.isArray(message.largs)) + return "largs: array expected"; + for (var i = 0; i < message.largs.length; ++i) { + var error = $root.pg_query.Node.verify(message.largs[i]); + if (error) + return "largs." + error; + } + } + if (message.rargs != null && message.hasOwnProperty("rargs")) { + if (!Array.isArray(message.rargs)) + return "rargs: array expected"; + for (var i = 0; i < message.rargs.length; ++i) { + var error = $root.pg_query.Node.verify(message.rargs[i]); + if (error) + return "rargs." + error; + } + } + return null; + }; + + /** + * Creates a RowCompareExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RowCompareExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RowCompareExpr} RowCompareExpr + */ + RowCompareExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RowCompareExpr) + return object; + var message = new $root.pg_query.RowCompareExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.RowCompareExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + switch (object.rctype) { + default: + if (typeof object.rctype === "number") { + message.rctype = object.rctype; + break; + } + break; + case "ROW_COMPARE_TYPE_UNDEFINED": + case 0: + message.rctype = 0; + break; + case "ROWCOMPARE_LT": + case 1: + message.rctype = 1; + break; + case "ROWCOMPARE_LE": + case 2: + message.rctype = 2; + break; + case "ROWCOMPARE_EQ": + case 3: + message.rctype = 3; + break; + case "ROWCOMPARE_GE": + case 4: + message.rctype = 4; + break; + case "ROWCOMPARE_GT": + case 5: + message.rctype = 5; + break; + case "ROWCOMPARE_NE": + case 6: + message.rctype = 6; + break; + } + if (object.opnos) { + if (!Array.isArray(object.opnos)) + throw TypeError(".pg_query.RowCompareExpr.opnos: array expected"); + message.opnos = []; + for (var i = 0; i < object.opnos.length; ++i) { + if (typeof object.opnos[i] !== "object") + throw TypeError(".pg_query.RowCompareExpr.opnos: object expected"); + message.opnos[i] = $root.pg_query.Node.fromObject(object.opnos[i]); + } + } + if (object.opfamilies) { + if (!Array.isArray(object.opfamilies)) + throw TypeError(".pg_query.RowCompareExpr.opfamilies: array expected"); + message.opfamilies = []; + for (var i = 0; i < object.opfamilies.length; ++i) { + if (typeof object.opfamilies[i] !== "object") + throw TypeError(".pg_query.RowCompareExpr.opfamilies: object expected"); + message.opfamilies[i] = $root.pg_query.Node.fromObject(object.opfamilies[i]); + } + } + if (object.inputcollids) { + if (!Array.isArray(object.inputcollids)) + throw TypeError(".pg_query.RowCompareExpr.inputcollids: array expected"); + message.inputcollids = []; + for (var i = 0; i < object.inputcollids.length; ++i) { + if (typeof object.inputcollids[i] !== "object") + throw TypeError(".pg_query.RowCompareExpr.inputcollids: object expected"); + message.inputcollids[i] = $root.pg_query.Node.fromObject(object.inputcollids[i]); + } + } + if (object.largs) { + if (!Array.isArray(object.largs)) + throw TypeError(".pg_query.RowCompareExpr.largs: array expected"); + message.largs = []; + for (var i = 0; i < object.largs.length; ++i) { + if (typeof object.largs[i] !== "object") + throw TypeError(".pg_query.RowCompareExpr.largs: object expected"); + message.largs[i] = $root.pg_query.Node.fromObject(object.largs[i]); + } + } + if (object.rargs) { + if (!Array.isArray(object.rargs)) + throw TypeError(".pg_query.RowCompareExpr.rargs: array expected"); + message.rargs = []; + for (var i = 0; i < object.rargs.length; ++i) { + if (typeof object.rargs[i] !== "object") + throw TypeError(".pg_query.RowCompareExpr.rargs: object expected"); + message.rargs[i] = $root.pg_query.Node.fromObject(object.rargs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RowCompareExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RowCompareExpr + * @static + * @param {pg_query.RowCompareExpr} message RowCompareExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowCompareExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.opnos = []; + object.opfamilies = []; + object.inputcollids = []; + object.largs = []; + object.rargs = []; + } + if (options.defaults) { + object.xpr = null; + object.rctype = options.enums === String ? "ROW_COMPARE_TYPE_UNDEFINED" : 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.rctype != null && message.hasOwnProperty("rctype")) + object.rctype = options.enums === String ? $root.pg_query.RowCompareType[message.rctype] === undefined ? message.rctype : $root.pg_query.RowCompareType[message.rctype] : message.rctype; + if (message.opnos && message.opnos.length) { + object.opnos = []; + for (var j = 0; j < message.opnos.length; ++j) + object.opnos[j] = $root.pg_query.Node.toObject(message.opnos[j], options); + } + if (message.opfamilies && message.opfamilies.length) { + object.opfamilies = []; + for (var j = 0; j < message.opfamilies.length; ++j) + object.opfamilies[j] = $root.pg_query.Node.toObject(message.opfamilies[j], options); + } + if (message.inputcollids && message.inputcollids.length) { + object.inputcollids = []; + for (var j = 0; j < message.inputcollids.length; ++j) + object.inputcollids[j] = $root.pg_query.Node.toObject(message.inputcollids[j], options); + } + if (message.largs && message.largs.length) { + object.largs = []; + for (var j = 0; j < message.largs.length; ++j) + object.largs[j] = $root.pg_query.Node.toObject(message.largs[j], options); + } + if (message.rargs && message.rargs.length) { + object.rargs = []; + for (var j = 0; j < message.rargs.length; ++j) + object.rargs[j] = $root.pg_query.Node.toObject(message.rargs[j], options); + } + return object; + }; + + /** + * Converts this RowCompareExpr to JSON. + * @function toJSON + * @memberof pg_query.RowCompareExpr + * @instance + * @returns {Object.} JSON object + */ + RowCompareExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowCompareExpr + * @function getTypeUrl + * @memberof pg_query.RowCompareExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowCompareExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RowCompareExpr"; + }; + + return RowCompareExpr; + })(); + + pg_query.CoalesceExpr = (function() { + + /** + * Properties of a CoalesceExpr. + * @memberof pg_query + * @interface ICoalesceExpr + * @property {pg_query.INode|null} [xpr] CoalesceExpr xpr + * @property {number|null} [coalescetype] CoalesceExpr coalescetype + * @property {number|null} [coalescecollid] CoalesceExpr coalescecollid + * @property {Array.|null} [args] CoalesceExpr args + * @property {number|null} [location] CoalesceExpr location + */ + + /** + * Constructs a new CoalesceExpr. + * @memberof pg_query + * @classdesc Represents a CoalesceExpr. + * @implements ICoalesceExpr + * @constructor + * @param {pg_query.ICoalesceExpr=} [properties] Properties to set + */ + function CoalesceExpr(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CoalesceExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.CoalesceExpr + * @instance + */ + CoalesceExpr.prototype.xpr = null; + + /** + * CoalesceExpr coalescetype. + * @member {number} coalescetype + * @memberof pg_query.CoalesceExpr + * @instance + */ + CoalesceExpr.prototype.coalescetype = 0; + + /** + * CoalesceExpr coalescecollid. + * @member {number} coalescecollid + * @memberof pg_query.CoalesceExpr + * @instance + */ + CoalesceExpr.prototype.coalescecollid = 0; + + /** + * CoalesceExpr args. + * @member {Array.} args + * @memberof pg_query.CoalesceExpr + * @instance + */ + CoalesceExpr.prototype.args = $util.emptyArray; + + /** + * CoalesceExpr location. + * @member {number} location + * @memberof pg_query.CoalesceExpr + * @instance + */ + CoalesceExpr.prototype.location = 0; + + /** + * Creates a new CoalesceExpr instance using the specified properties. + * @function create + * @memberof pg_query.CoalesceExpr + * @static + * @param {pg_query.ICoalesceExpr=} [properties] Properties to set + * @returns {pg_query.CoalesceExpr} CoalesceExpr instance + */ + CoalesceExpr.create = function create(properties) { + return new CoalesceExpr(properties); + }; + + /** + * Encodes the specified CoalesceExpr message. Does not implicitly {@link pg_query.CoalesceExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.CoalesceExpr + * @static + * @param {pg_query.ICoalesceExpr} message CoalesceExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CoalesceExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.coalescetype != null && Object.hasOwnProperty.call(message, "coalescetype")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coalescetype); + if (message.coalescecollid != null && Object.hasOwnProperty.call(message, "coalescecollid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.coalescecollid); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified CoalesceExpr message, length delimited. Does not implicitly {@link pg_query.CoalesceExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CoalesceExpr + * @static + * @param {pg_query.ICoalesceExpr} message CoalesceExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CoalesceExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CoalesceExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CoalesceExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CoalesceExpr} CoalesceExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CoalesceExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CoalesceExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.coalescetype = reader.uint32(); + break; + } + case 3: { + message.coalescecollid = reader.uint32(); + break; + } + case 4: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CoalesceExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CoalesceExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CoalesceExpr} CoalesceExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CoalesceExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CoalesceExpr message. + * @function verify + * @memberof pg_query.CoalesceExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CoalesceExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.coalescetype != null && message.hasOwnProperty("coalescetype")) + if (!$util.isInteger(message.coalescetype)) + return "coalescetype: integer expected"; + if (message.coalescecollid != null && message.hasOwnProperty("coalescecollid")) + if (!$util.isInteger(message.coalescecollid)) + return "coalescecollid: integer expected"; + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a CoalesceExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CoalesceExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CoalesceExpr} CoalesceExpr + */ + CoalesceExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CoalesceExpr) + return object; + var message = new $root.pg_query.CoalesceExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.CoalesceExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.coalescetype != null) + message.coalescetype = object.coalescetype >>> 0; + if (object.coalescecollid != null) + message.coalescecollid = object.coalescecollid >>> 0; + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.CoalesceExpr.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.CoalesceExpr.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a CoalesceExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CoalesceExpr + * @static + * @param {pg_query.CoalesceExpr} message CoalesceExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CoalesceExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.xpr = null; + object.coalescetype = 0; + object.coalescecollid = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.coalescetype != null && message.hasOwnProperty("coalescetype")) + object.coalescetype = message.coalescetype; + if (message.coalescecollid != null && message.hasOwnProperty("coalescecollid")) + object.coalescecollid = message.coalescecollid; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CoalesceExpr to JSON. + * @function toJSON + * @memberof pg_query.CoalesceExpr + * @instance + * @returns {Object.} JSON object + */ + CoalesceExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CoalesceExpr + * @function getTypeUrl + * @memberof pg_query.CoalesceExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CoalesceExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CoalesceExpr"; + }; + + return CoalesceExpr; + })(); + + pg_query.MinMaxExpr = (function() { + + /** + * Properties of a MinMaxExpr. + * @memberof pg_query + * @interface IMinMaxExpr + * @property {pg_query.INode|null} [xpr] MinMaxExpr xpr + * @property {number|null} [minmaxtype] MinMaxExpr minmaxtype + * @property {number|null} [minmaxcollid] MinMaxExpr minmaxcollid + * @property {number|null} [inputcollid] MinMaxExpr inputcollid + * @property {pg_query.MinMaxOp|null} [op] MinMaxExpr op + * @property {Array.|null} [args] MinMaxExpr args + * @property {number|null} [location] MinMaxExpr location + */ + + /** + * Constructs a new MinMaxExpr. + * @memberof pg_query + * @classdesc Represents a MinMaxExpr. + * @implements IMinMaxExpr + * @constructor + * @param {pg_query.IMinMaxExpr=} [properties] Properties to set + */ + function MinMaxExpr(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MinMaxExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.MinMaxExpr + * @instance + */ + MinMaxExpr.prototype.xpr = null; + + /** + * MinMaxExpr minmaxtype. + * @member {number} minmaxtype + * @memberof pg_query.MinMaxExpr + * @instance + */ + MinMaxExpr.prototype.minmaxtype = 0; + + /** + * MinMaxExpr minmaxcollid. + * @member {number} minmaxcollid + * @memberof pg_query.MinMaxExpr + * @instance + */ + MinMaxExpr.prototype.minmaxcollid = 0; + + /** + * MinMaxExpr inputcollid. + * @member {number} inputcollid + * @memberof pg_query.MinMaxExpr + * @instance + */ + MinMaxExpr.prototype.inputcollid = 0; + + /** + * MinMaxExpr op. + * @member {pg_query.MinMaxOp} op + * @memberof pg_query.MinMaxExpr + * @instance + */ + MinMaxExpr.prototype.op = 0; + + /** + * MinMaxExpr args. + * @member {Array.} args + * @memberof pg_query.MinMaxExpr + * @instance + */ + MinMaxExpr.prototype.args = $util.emptyArray; + + /** + * MinMaxExpr location. + * @member {number} location + * @memberof pg_query.MinMaxExpr + * @instance + */ + MinMaxExpr.prototype.location = 0; + + /** + * Creates a new MinMaxExpr instance using the specified properties. + * @function create + * @memberof pg_query.MinMaxExpr + * @static + * @param {pg_query.IMinMaxExpr=} [properties] Properties to set + * @returns {pg_query.MinMaxExpr} MinMaxExpr instance + */ + MinMaxExpr.create = function create(properties) { + return new MinMaxExpr(properties); + }; + + /** + * Encodes the specified MinMaxExpr message. Does not implicitly {@link pg_query.MinMaxExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.MinMaxExpr + * @static + * @param {pg_query.IMinMaxExpr} message MinMaxExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MinMaxExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minmaxtype != null && Object.hasOwnProperty.call(message, "minmaxtype")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.minmaxtype); + if (message.minmaxcollid != null && Object.hasOwnProperty.call(message, "minmaxcollid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.minmaxcollid); + if (message.inputcollid != null && Object.hasOwnProperty.call(message, "inputcollid")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.inputcollid); + if (message.op != null && Object.hasOwnProperty.call(message, "op")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.op); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.location); + return writer; + }; + + /** + * Encodes the specified MinMaxExpr message, length delimited. Does not implicitly {@link pg_query.MinMaxExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.MinMaxExpr + * @static + * @param {pg_query.IMinMaxExpr} message MinMaxExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MinMaxExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MinMaxExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.MinMaxExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.MinMaxExpr} MinMaxExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MinMaxExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.MinMaxExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.minmaxtype = reader.uint32(); + break; + } + case 3: { + message.minmaxcollid = reader.uint32(); + break; + } + case 4: { + message.inputcollid = reader.uint32(); + break; + } + case 5: { + message.op = reader.int32(); + break; + } + case 6: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MinMaxExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.MinMaxExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.MinMaxExpr} MinMaxExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MinMaxExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MinMaxExpr message. + * @function verify + * @memberof pg_query.MinMaxExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MinMaxExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.minmaxtype != null && message.hasOwnProperty("minmaxtype")) + if (!$util.isInteger(message.minmaxtype)) + return "minmaxtype: integer expected"; + if (message.minmaxcollid != null && message.hasOwnProperty("minmaxcollid")) + if (!$util.isInteger(message.minmaxcollid)) + return "minmaxcollid: integer expected"; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + if (!$util.isInteger(message.inputcollid)) + return "inputcollid: integer expected"; + if (message.op != null && message.hasOwnProperty("op")) + switch (message.op) { + default: + return "op: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a MinMaxExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.MinMaxExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.MinMaxExpr} MinMaxExpr + */ + MinMaxExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.MinMaxExpr) + return object; + var message = new $root.pg_query.MinMaxExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.MinMaxExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.minmaxtype != null) + message.minmaxtype = object.minmaxtype >>> 0; + if (object.minmaxcollid != null) + message.minmaxcollid = object.minmaxcollid >>> 0; + if (object.inputcollid != null) + message.inputcollid = object.inputcollid >>> 0; + switch (object.op) { + default: + if (typeof object.op === "number") { + message.op = object.op; + break; + } + break; + case "MIN_MAX_OP_UNDEFINED": + case 0: + message.op = 0; + break; + case "IS_GREATEST": + case 1: + message.op = 1; + break; + case "IS_LEAST": + case 2: + message.op = 2; + break; + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.MinMaxExpr.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.MinMaxExpr.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a MinMaxExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.MinMaxExpr + * @static + * @param {pg_query.MinMaxExpr} message MinMaxExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MinMaxExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.xpr = null; + object.minmaxtype = 0; + object.minmaxcollid = 0; + object.inputcollid = 0; + object.op = options.enums === String ? "MIN_MAX_OP_UNDEFINED" : 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.minmaxtype != null && message.hasOwnProperty("minmaxtype")) + object.minmaxtype = message.minmaxtype; + if (message.minmaxcollid != null && message.hasOwnProperty("minmaxcollid")) + object.minmaxcollid = message.minmaxcollid; + if (message.inputcollid != null && message.hasOwnProperty("inputcollid")) + object.inputcollid = message.inputcollid; + if (message.op != null && message.hasOwnProperty("op")) + object.op = options.enums === String ? $root.pg_query.MinMaxOp[message.op] === undefined ? message.op : $root.pg_query.MinMaxOp[message.op] : message.op; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this MinMaxExpr to JSON. + * @function toJSON + * @memberof pg_query.MinMaxExpr + * @instance + * @returns {Object.} JSON object + */ + MinMaxExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MinMaxExpr + * @function getTypeUrl + * @memberof pg_query.MinMaxExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MinMaxExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.MinMaxExpr"; + }; + + return MinMaxExpr; + })(); + + pg_query.SQLValueFunction = (function() { + + /** + * Properties of a SQLValueFunction. + * @memberof pg_query + * @interface ISQLValueFunction + * @property {pg_query.INode|null} [xpr] SQLValueFunction xpr + * @property {pg_query.SQLValueFunctionOp|null} [op] SQLValueFunction op + * @property {number|null} [type] SQLValueFunction type + * @property {number|null} [typmod] SQLValueFunction typmod + * @property {number|null} [location] SQLValueFunction location + */ + + /** + * Constructs a new SQLValueFunction. + * @memberof pg_query + * @classdesc Represents a SQLValueFunction. + * @implements ISQLValueFunction + * @constructor + * @param {pg_query.ISQLValueFunction=} [properties] Properties to set + */ + function SQLValueFunction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SQLValueFunction xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.SQLValueFunction + * @instance + */ + SQLValueFunction.prototype.xpr = null; + + /** + * SQLValueFunction op. + * @member {pg_query.SQLValueFunctionOp} op + * @memberof pg_query.SQLValueFunction + * @instance + */ + SQLValueFunction.prototype.op = 0; + + /** + * SQLValueFunction type. + * @member {number} type + * @memberof pg_query.SQLValueFunction + * @instance + */ + SQLValueFunction.prototype.type = 0; + + /** + * SQLValueFunction typmod. + * @member {number} typmod + * @memberof pg_query.SQLValueFunction + * @instance + */ + SQLValueFunction.prototype.typmod = 0; + + /** + * SQLValueFunction location. + * @member {number} location + * @memberof pg_query.SQLValueFunction + * @instance + */ + SQLValueFunction.prototype.location = 0; + + /** + * Creates a new SQLValueFunction instance using the specified properties. + * @function create + * @memberof pg_query.SQLValueFunction + * @static + * @param {pg_query.ISQLValueFunction=} [properties] Properties to set + * @returns {pg_query.SQLValueFunction} SQLValueFunction instance + */ + SQLValueFunction.create = function create(properties) { + return new SQLValueFunction(properties); + }; + + /** + * Encodes the specified SQLValueFunction message. Does not implicitly {@link pg_query.SQLValueFunction.verify|verify} messages. + * @function encode + * @memberof pg_query.SQLValueFunction + * @static + * @param {pg_query.ISQLValueFunction} message SQLValueFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SQLValueFunction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.op != null && Object.hasOwnProperty.call(message, "op")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.op); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.type); + if (message.typmod != null && Object.hasOwnProperty.call(message, "typmod")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.typmod); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified SQLValueFunction message, length delimited. Does not implicitly {@link pg_query.SQLValueFunction.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.SQLValueFunction + * @static + * @param {pg_query.ISQLValueFunction} message SQLValueFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SQLValueFunction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SQLValueFunction message from the specified reader or buffer. + * @function decode + * @memberof pg_query.SQLValueFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.SQLValueFunction} SQLValueFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SQLValueFunction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.SQLValueFunction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.op = reader.int32(); + break; + } + case 3: { + message.type = reader.uint32(); + break; + } + case 4: { + message.typmod = reader.int32(); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SQLValueFunction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.SQLValueFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.SQLValueFunction} SQLValueFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SQLValueFunction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SQLValueFunction message. + * @function verify + * @memberof pg_query.SQLValueFunction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SQLValueFunction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.op != null && message.hasOwnProperty("op")) + switch (message.op) { + default: + return "op: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isInteger(message.type)) + return "type: integer expected"; + if (message.typmod != null && message.hasOwnProperty("typmod")) + if (!$util.isInteger(message.typmod)) + return "typmod: integer expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a SQLValueFunction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.SQLValueFunction + * @static + * @param {Object.} object Plain object + * @returns {pg_query.SQLValueFunction} SQLValueFunction + */ + SQLValueFunction.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.SQLValueFunction) + return object; + var message = new $root.pg_query.SQLValueFunction(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.SQLValueFunction.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + switch (object.op) { + default: + if (typeof object.op === "number") { + message.op = object.op; + break; + } + break; + case "SQLVALUE_FUNCTION_OP_UNDEFINED": + case 0: + message.op = 0; + break; + case "SVFOP_CURRENT_DATE": + case 1: + message.op = 1; + break; + case "SVFOP_CURRENT_TIME": + case 2: + message.op = 2; + break; + case "SVFOP_CURRENT_TIME_N": + case 3: + message.op = 3; + break; + case "SVFOP_CURRENT_TIMESTAMP": + case 4: + message.op = 4; + break; + case "SVFOP_CURRENT_TIMESTAMP_N": + case 5: + message.op = 5; + break; + case "SVFOP_LOCALTIME": + case 6: + message.op = 6; + break; + case "SVFOP_LOCALTIME_N": + case 7: + message.op = 7; + break; + case "SVFOP_LOCALTIMESTAMP": + case 8: + message.op = 8; + break; + case "SVFOP_LOCALTIMESTAMP_N": + case 9: + message.op = 9; + break; + case "SVFOP_CURRENT_ROLE": + case 10: + message.op = 10; + break; + case "SVFOP_CURRENT_USER": + case 11: + message.op = 11; + break; + case "SVFOP_USER": + case 12: + message.op = 12; + break; + case "SVFOP_SESSION_USER": + case 13: + message.op = 13; + break; + case "SVFOP_CURRENT_CATALOG": + case 14: + message.op = 14; + break; + case "SVFOP_CURRENT_SCHEMA": + case 15: + message.op = 15; + break; + } + if (object.type != null) + message.type = object.type >>> 0; + if (object.typmod != null) + message.typmod = object.typmod | 0; + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a SQLValueFunction message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.SQLValueFunction + * @static + * @param {pg_query.SQLValueFunction} message SQLValueFunction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SQLValueFunction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.op = options.enums === String ? "SQLVALUE_FUNCTION_OP_UNDEFINED" : 0; + object.type = 0; + object.typmod = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.op != null && message.hasOwnProperty("op")) + object.op = options.enums === String ? $root.pg_query.SQLValueFunctionOp[message.op] === undefined ? message.op : $root.pg_query.SQLValueFunctionOp[message.op] : message.op; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.typmod != null && message.hasOwnProperty("typmod")) + object.typmod = message.typmod; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this SQLValueFunction to JSON. + * @function toJSON + * @memberof pg_query.SQLValueFunction + * @instance + * @returns {Object.} JSON object + */ + SQLValueFunction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SQLValueFunction + * @function getTypeUrl + * @memberof pg_query.SQLValueFunction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SQLValueFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.SQLValueFunction"; + }; + + return SQLValueFunction; + })(); + + pg_query.XmlExpr = (function() { + + /** + * Properties of a XmlExpr. + * @memberof pg_query + * @interface IXmlExpr + * @property {pg_query.INode|null} [xpr] XmlExpr xpr + * @property {pg_query.XmlExprOp|null} [op] XmlExpr op + * @property {string|null} [name] XmlExpr name + * @property {Array.|null} [named_args] XmlExpr named_args + * @property {Array.|null} [arg_names] XmlExpr arg_names + * @property {Array.|null} [args] XmlExpr args + * @property {pg_query.XmlOptionType|null} [xmloption] XmlExpr xmloption + * @property {number|null} [type] XmlExpr type + * @property {number|null} [typmod] XmlExpr typmod + * @property {number|null} [location] XmlExpr location + */ + + /** + * Constructs a new XmlExpr. + * @memberof pg_query + * @classdesc Represents a XmlExpr. + * @implements IXmlExpr + * @constructor + * @param {pg_query.IXmlExpr=} [properties] Properties to set + */ + function XmlExpr(properties) { + this.named_args = []; + this.arg_names = []; + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * XmlExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.XmlExpr + * @instance + */ + XmlExpr.prototype.xpr = null; + + /** + * XmlExpr op. + * @member {pg_query.XmlExprOp} op + * @memberof pg_query.XmlExpr + * @instance + */ + XmlExpr.prototype.op = 0; + + /** + * XmlExpr name. + * @member {string} name + * @memberof pg_query.XmlExpr + * @instance + */ + XmlExpr.prototype.name = ""; + + /** + * XmlExpr named_args. + * @member {Array.} named_args + * @memberof pg_query.XmlExpr + * @instance + */ + XmlExpr.prototype.named_args = $util.emptyArray; + + /** + * XmlExpr arg_names. + * @member {Array.} arg_names + * @memberof pg_query.XmlExpr + * @instance + */ + XmlExpr.prototype.arg_names = $util.emptyArray; + + /** + * XmlExpr args. + * @member {Array.} args + * @memberof pg_query.XmlExpr + * @instance + */ + XmlExpr.prototype.args = $util.emptyArray; + + /** + * XmlExpr xmloption. + * @member {pg_query.XmlOptionType} xmloption + * @memberof pg_query.XmlExpr + * @instance + */ + XmlExpr.prototype.xmloption = 0; + + /** + * XmlExpr type. + * @member {number} type + * @memberof pg_query.XmlExpr + * @instance + */ + XmlExpr.prototype.type = 0; + + /** + * XmlExpr typmod. + * @member {number} typmod + * @memberof pg_query.XmlExpr + * @instance + */ + XmlExpr.prototype.typmod = 0; + + /** + * XmlExpr location. + * @member {number} location + * @memberof pg_query.XmlExpr + * @instance + */ + XmlExpr.prototype.location = 0; + + /** + * Creates a new XmlExpr instance using the specified properties. + * @function create + * @memberof pg_query.XmlExpr + * @static + * @param {pg_query.IXmlExpr=} [properties] Properties to set + * @returns {pg_query.XmlExpr} XmlExpr instance + */ + XmlExpr.create = function create(properties) { + return new XmlExpr(properties); + }; + + /** + * Encodes the specified XmlExpr message. Does not implicitly {@link pg_query.XmlExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.XmlExpr + * @static + * @param {pg_query.IXmlExpr} message XmlExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + XmlExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.op != null && Object.hasOwnProperty.call(message, "op")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.op); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.named_args != null && message.named_args.length) + for (var i = 0; i < message.named_args.length; ++i) + $root.pg_query.Node.encode(message.named_args[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.arg_names != null && message.arg_names.length) + for (var i = 0; i < message.arg_names.length; ++i) + $root.pg_query.Node.encode(message.arg_names[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.xmloption != null && Object.hasOwnProperty.call(message, "xmloption")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.xmloption); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.type); + if (message.typmod != null && Object.hasOwnProperty.call(message, "typmod")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.typmod); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.location); + return writer; + }; + + /** + * Encodes the specified XmlExpr message, length delimited. Does not implicitly {@link pg_query.XmlExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.XmlExpr + * @static + * @param {pg_query.IXmlExpr} message XmlExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + XmlExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a XmlExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.XmlExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.XmlExpr} XmlExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + XmlExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.XmlExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.op = reader.int32(); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 4: { + if (!(message.named_args && message.named_args.length)) + message.named_args = []; + message.named_args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.arg_names && message.arg_names.length)) + message.arg_names = []; + message.arg_names.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + message.xmloption = reader.int32(); + break; + } + case 8: { + message.type = reader.uint32(); + break; + } + case 9: { + message.typmod = reader.int32(); + break; + } + case 10: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a XmlExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.XmlExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.XmlExpr} XmlExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + XmlExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a XmlExpr message. + * @function verify + * @memberof pg_query.XmlExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + XmlExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.op != null && message.hasOwnProperty("op")) + switch (message.op) { + default: + return "op: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.named_args != null && message.hasOwnProperty("named_args")) { + if (!Array.isArray(message.named_args)) + return "named_args: array expected"; + for (var i = 0; i < message.named_args.length; ++i) { + var error = $root.pg_query.Node.verify(message.named_args[i]); + if (error) + return "named_args." + error; + } + } + if (message.arg_names != null && message.hasOwnProperty("arg_names")) { + if (!Array.isArray(message.arg_names)) + return "arg_names: array expected"; + for (var i = 0; i < message.arg_names.length; ++i) { + var error = $root.pg_query.Node.verify(message.arg_names[i]); + if (error) + return "arg_names." + error; + } + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.xmloption != null && message.hasOwnProperty("xmloption")) + switch (message.xmloption) { + default: + return "xmloption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isInteger(message.type)) + return "type: integer expected"; + if (message.typmod != null && message.hasOwnProperty("typmod")) + if (!$util.isInteger(message.typmod)) + return "typmod: integer expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a XmlExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.XmlExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.XmlExpr} XmlExpr + */ + XmlExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.XmlExpr) + return object; + var message = new $root.pg_query.XmlExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.XmlExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + switch (object.op) { + default: + if (typeof object.op === "number") { + message.op = object.op; + break; + } + break; + case "XML_EXPR_OP_UNDEFINED": + case 0: + message.op = 0; + break; + case "IS_XMLCONCAT": + case 1: + message.op = 1; + break; + case "IS_XMLELEMENT": + case 2: + message.op = 2; + break; + case "IS_XMLFOREST": + case 3: + message.op = 3; + break; + case "IS_XMLPARSE": + case 4: + message.op = 4; + break; + case "IS_XMLPI": + case 5: + message.op = 5; + break; + case "IS_XMLROOT": + case 6: + message.op = 6; + break; + case "IS_XMLSERIALIZE": + case 7: + message.op = 7; + break; + case "IS_DOCUMENT": + case 8: + message.op = 8; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.named_args) { + if (!Array.isArray(object.named_args)) + throw TypeError(".pg_query.XmlExpr.named_args: array expected"); + message.named_args = []; + for (var i = 0; i < object.named_args.length; ++i) { + if (typeof object.named_args[i] !== "object") + throw TypeError(".pg_query.XmlExpr.named_args: object expected"); + message.named_args[i] = $root.pg_query.Node.fromObject(object.named_args[i]); + } + } + if (object.arg_names) { + if (!Array.isArray(object.arg_names)) + throw TypeError(".pg_query.XmlExpr.arg_names: array expected"); + message.arg_names = []; + for (var i = 0; i < object.arg_names.length; ++i) { + if (typeof object.arg_names[i] !== "object") + throw TypeError(".pg_query.XmlExpr.arg_names: object expected"); + message.arg_names[i] = $root.pg_query.Node.fromObject(object.arg_names[i]); + } + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.XmlExpr.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.XmlExpr.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + switch (object.xmloption) { + default: + if (typeof object.xmloption === "number") { + message.xmloption = object.xmloption; + break; + } + break; + case "XML_OPTION_TYPE_UNDEFINED": + case 0: + message.xmloption = 0; + break; + case "XMLOPTION_DOCUMENT": + case 1: + message.xmloption = 1; + break; + case "XMLOPTION_CONTENT": + case 2: + message.xmloption = 2; + break; + } + if (object.type != null) + message.type = object.type >>> 0; + if (object.typmod != null) + message.typmod = object.typmod | 0; + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a XmlExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.XmlExpr + * @static + * @param {pg_query.XmlExpr} message XmlExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + XmlExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.named_args = []; + object.arg_names = []; + object.args = []; + } + if (options.defaults) { + object.xpr = null; + object.op = options.enums === String ? "XML_EXPR_OP_UNDEFINED" : 0; + object.name = ""; + object.xmloption = options.enums === String ? "XML_OPTION_TYPE_UNDEFINED" : 0; + object.type = 0; + object.typmod = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.op != null && message.hasOwnProperty("op")) + object.op = options.enums === String ? $root.pg_query.XmlExprOp[message.op] === undefined ? message.op : $root.pg_query.XmlExprOp[message.op] : message.op; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.named_args && message.named_args.length) { + object.named_args = []; + for (var j = 0; j < message.named_args.length; ++j) + object.named_args[j] = $root.pg_query.Node.toObject(message.named_args[j], options); + } + if (message.arg_names && message.arg_names.length) { + object.arg_names = []; + for (var j = 0; j < message.arg_names.length; ++j) + object.arg_names[j] = $root.pg_query.Node.toObject(message.arg_names[j], options); + } + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.xmloption != null && message.hasOwnProperty("xmloption")) + object.xmloption = options.enums === String ? $root.pg_query.XmlOptionType[message.xmloption] === undefined ? message.xmloption : $root.pg_query.XmlOptionType[message.xmloption] : message.xmloption; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.typmod != null && message.hasOwnProperty("typmod")) + object.typmod = message.typmod; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this XmlExpr to JSON. + * @function toJSON + * @memberof pg_query.XmlExpr + * @instance + * @returns {Object.} JSON object + */ + XmlExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for XmlExpr + * @function getTypeUrl + * @memberof pg_query.XmlExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + XmlExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.XmlExpr"; + }; + + return XmlExpr; + })(); + + pg_query.NullTest = (function() { + + /** + * Properties of a NullTest. + * @memberof pg_query + * @interface INullTest + * @property {pg_query.INode|null} [xpr] NullTest xpr + * @property {pg_query.INode|null} [arg] NullTest arg + * @property {pg_query.NullTestType|null} [nulltesttype] NullTest nulltesttype + * @property {boolean|null} [argisrow] NullTest argisrow + * @property {number|null} [location] NullTest location + */ + + /** + * Constructs a new NullTest. + * @memberof pg_query + * @classdesc Represents a NullTest. + * @implements INullTest + * @constructor + * @param {pg_query.INullTest=} [properties] Properties to set + */ + function NullTest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NullTest xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.NullTest + * @instance + */ + NullTest.prototype.xpr = null; + + /** + * NullTest arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.NullTest + * @instance + */ + NullTest.prototype.arg = null; + + /** + * NullTest nulltesttype. + * @member {pg_query.NullTestType} nulltesttype + * @memberof pg_query.NullTest + * @instance + */ + NullTest.prototype.nulltesttype = 0; + + /** + * NullTest argisrow. + * @member {boolean} argisrow + * @memberof pg_query.NullTest + * @instance + */ + NullTest.prototype.argisrow = false; + + /** + * NullTest location. + * @member {number} location + * @memberof pg_query.NullTest + * @instance + */ + NullTest.prototype.location = 0; + + /** + * Creates a new NullTest instance using the specified properties. + * @function create + * @memberof pg_query.NullTest + * @static + * @param {pg_query.INullTest=} [properties] Properties to set + * @returns {pg_query.NullTest} NullTest instance + */ + NullTest.create = function create(properties) { + return new NullTest(properties); + }; + + /** + * Encodes the specified NullTest message. Does not implicitly {@link pg_query.NullTest.verify|verify} messages. + * @function encode + * @memberof pg_query.NullTest + * @static + * @param {pg_query.INullTest} message NullTest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NullTest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nulltesttype != null && Object.hasOwnProperty.call(message, "nulltesttype")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.nulltesttype); + if (message.argisrow != null && Object.hasOwnProperty.call(message, "argisrow")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.argisrow); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified NullTest message, length delimited. Does not implicitly {@link pg_query.NullTest.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.NullTest + * @static + * @param {pg_query.INullTest} message NullTest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NullTest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NullTest message from the specified reader or buffer. + * @function decode + * @memberof pg_query.NullTest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.NullTest} NullTest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NullTest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.NullTest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nulltesttype = reader.int32(); + break; + } + case 4: { + message.argisrow = reader.bool(); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NullTest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.NullTest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.NullTest} NullTest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NullTest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NullTest message. + * @function verify + * @memberof pg_query.NullTest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NullTest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.nulltesttype != null && message.hasOwnProperty("nulltesttype")) + switch (message.nulltesttype) { + default: + return "nulltesttype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.argisrow != null && message.hasOwnProperty("argisrow")) + if (typeof message.argisrow !== "boolean") + return "argisrow: boolean expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a NullTest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.NullTest + * @static + * @param {Object.} object Plain object + * @returns {pg_query.NullTest} NullTest + */ + NullTest.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.NullTest) + return object; + var message = new $root.pg_query.NullTest(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.NullTest.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.NullTest.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + switch (object.nulltesttype) { + default: + if (typeof object.nulltesttype === "number") { + message.nulltesttype = object.nulltesttype; + break; + } + break; + case "NULL_TEST_TYPE_UNDEFINED": + case 0: + message.nulltesttype = 0; + break; + case "IS_NULL": + case 1: + message.nulltesttype = 1; + break; + case "IS_NOT_NULL": + case 2: + message.nulltesttype = 2; + break; + } + if (object.argisrow != null) + message.argisrow = Boolean(object.argisrow); + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a NullTest message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.NullTest + * @static + * @param {pg_query.NullTest} message NullTest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NullTest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.arg = null; + object.nulltesttype = options.enums === String ? "NULL_TEST_TYPE_UNDEFINED" : 0; + object.argisrow = false; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.nulltesttype != null && message.hasOwnProperty("nulltesttype")) + object.nulltesttype = options.enums === String ? $root.pg_query.NullTestType[message.nulltesttype] === undefined ? message.nulltesttype : $root.pg_query.NullTestType[message.nulltesttype] : message.nulltesttype; + if (message.argisrow != null && message.hasOwnProperty("argisrow")) + object.argisrow = message.argisrow; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this NullTest to JSON. + * @function toJSON + * @memberof pg_query.NullTest + * @instance + * @returns {Object.} JSON object + */ + NullTest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NullTest + * @function getTypeUrl + * @memberof pg_query.NullTest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NullTest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.NullTest"; + }; + + return NullTest; + })(); + + pg_query.BooleanTest = (function() { + + /** + * Properties of a BooleanTest. + * @memberof pg_query + * @interface IBooleanTest + * @property {pg_query.INode|null} [xpr] BooleanTest xpr + * @property {pg_query.INode|null} [arg] BooleanTest arg + * @property {pg_query.BoolTestType|null} [booltesttype] BooleanTest booltesttype + * @property {number|null} [location] BooleanTest location + */ + + /** + * Constructs a new BooleanTest. + * @memberof pg_query + * @classdesc Represents a BooleanTest. + * @implements IBooleanTest + * @constructor + * @param {pg_query.IBooleanTest=} [properties] Properties to set + */ + function BooleanTest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BooleanTest xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.BooleanTest + * @instance + */ + BooleanTest.prototype.xpr = null; + + /** + * BooleanTest arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.BooleanTest + * @instance + */ + BooleanTest.prototype.arg = null; + + /** + * BooleanTest booltesttype. + * @member {pg_query.BoolTestType} booltesttype + * @memberof pg_query.BooleanTest + * @instance + */ + BooleanTest.prototype.booltesttype = 0; + + /** + * BooleanTest location. + * @member {number} location + * @memberof pg_query.BooleanTest + * @instance + */ + BooleanTest.prototype.location = 0; + + /** + * Creates a new BooleanTest instance using the specified properties. + * @function create + * @memberof pg_query.BooleanTest + * @static + * @param {pg_query.IBooleanTest=} [properties] Properties to set + * @returns {pg_query.BooleanTest} BooleanTest instance + */ + BooleanTest.create = function create(properties) { + return new BooleanTest(properties); + }; + + /** + * Encodes the specified BooleanTest message. Does not implicitly {@link pg_query.BooleanTest.verify|verify} messages. + * @function encode + * @memberof pg_query.BooleanTest + * @static + * @param {pg_query.IBooleanTest} message BooleanTest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanTest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.booltesttype != null && Object.hasOwnProperty.call(message, "booltesttype")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.booltesttype); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.location); + return writer; + }; + + /** + * Encodes the specified BooleanTest message, length delimited. Does not implicitly {@link pg_query.BooleanTest.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.BooleanTest + * @static + * @param {pg_query.IBooleanTest} message BooleanTest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanTest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BooleanTest message from the specified reader or buffer. + * @function decode + * @memberof pg_query.BooleanTest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.BooleanTest} BooleanTest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanTest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.BooleanTest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.booltesttype = reader.int32(); + break; + } + case 4: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BooleanTest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.BooleanTest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.BooleanTest} BooleanTest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanTest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BooleanTest message. + * @function verify + * @memberof pg_query.BooleanTest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BooleanTest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.booltesttype != null && message.hasOwnProperty("booltesttype")) + switch (message.booltesttype) { + default: + return "booltesttype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a BooleanTest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.BooleanTest + * @static + * @param {Object.} object Plain object + * @returns {pg_query.BooleanTest} BooleanTest + */ + BooleanTest.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.BooleanTest) + return object; + var message = new $root.pg_query.BooleanTest(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.BooleanTest.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.BooleanTest.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + switch (object.booltesttype) { + default: + if (typeof object.booltesttype === "number") { + message.booltesttype = object.booltesttype; + break; + } + break; + case "BOOL_TEST_TYPE_UNDEFINED": + case 0: + message.booltesttype = 0; + break; + case "IS_TRUE": + case 1: + message.booltesttype = 1; + break; + case "IS_NOT_TRUE": + case 2: + message.booltesttype = 2; + break; + case "IS_FALSE": + case 3: + message.booltesttype = 3; + break; + case "IS_NOT_FALSE": + case 4: + message.booltesttype = 4; + break; + case "IS_UNKNOWN": + case 5: + message.booltesttype = 5; + break; + case "IS_NOT_UNKNOWN": + case 6: + message.booltesttype = 6; + break; + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a BooleanTest message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.BooleanTest + * @static + * @param {pg_query.BooleanTest} message BooleanTest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BooleanTest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.arg = null; + object.booltesttype = options.enums === String ? "BOOL_TEST_TYPE_UNDEFINED" : 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.booltesttype != null && message.hasOwnProperty("booltesttype")) + object.booltesttype = options.enums === String ? $root.pg_query.BoolTestType[message.booltesttype] === undefined ? message.booltesttype : $root.pg_query.BoolTestType[message.booltesttype] : message.booltesttype; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this BooleanTest to JSON. + * @function toJSON + * @memberof pg_query.BooleanTest + * @instance + * @returns {Object.} JSON object + */ + BooleanTest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BooleanTest + * @function getTypeUrl + * @memberof pg_query.BooleanTest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BooleanTest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.BooleanTest"; + }; + + return BooleanTest; + })(); + + pg_query.CoerceToDomain = (function() { + + /** + * Properties of a CoerceToDomain. + * @memberof pg_query + * @interface ICoerceToDomain + * @property {pg_query.INode|null} [xpr] CoerceToDomain xpr + * @property {pg_query.INode|null} [arg] CoerceToDomain arg + * @property {number|null} [resulttype] CoerceToDomain resulttype + * @property {number|null} [resulttypmod] CoerceToDomain resulttypmod + * @property {number|null} [resultcollid] CoerceToDomain resultcollid + * @property {pg_query.CoercionForm|null} [coercionformat] CoerceToDomain coercionformat + * @property {number|null} [location] CoerceToDomain location + */ + + /** + * Constructs a new CoerceToDomain. + * @memberof pg_query + * @classdesc Represents a CoerceToDomain. + * @implements ICoerceToDomain + * @constructor + * @param {pg_query.ICoerceToDomain=} [properties] Properties to set + */ + function CoerceToDomain(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CoerceToDomain xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.CoerceToDomain + * @instance + */ + CoerceToDomain.prototype.xpr = null; + + /** + * CoerceToDomain arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.CoerceToDomain + * @instance + */ + CoerceToDomain.prototype.arg = null; + + /** + * CoerceToDomain resulttype. + * @member {number} resulttype + * @memberof pg_query.CoerceToDomain + * @instance + */ + CoerceToDomain.prototype.resulttype = 0; + + /** + * CoerceToDomain resulttypmod. + * @member {number} resulttypmod + * @memberof pg_query.CoerceToDomain + * @instance + */ + CoerceToDomain.prototype.resulttypmod = 0; + + /** + * CoerceToDomain resultcollid. + * @member {number} resultcollid + * @memberof pg_query.CoerceToDomain + * @instance + */ + CoerceToDomain.prototype.resultcollid = 0; + + /** + * CoerceToDomain coercionformat. + * @member {pg_query.CoercionForm} coercionformat + * @memberof pg_query.CoerceToDomain + * @instance + */ + CoerceToDomain.prototype.coercionformat = 0; + + /** + * CoerceToDomain location. + * @member {number} location + * @memberof pg_query.CoerceToDomain + * @instance + */ + CoerceToDomain.prototype.location = 0; + + /** + * Creates a new CoerceToDomain instance using the specified properties. + * @function create + * @memberof pg_query.CoerceToDomain + * @static + * @param {pg_query.ICoerceToDomain=} [properties] Properties to set + * @returns {pg_query.CoerceToDomain} CoerceToDomain instance + */ + CoerceToDomain.create = function create(properties) { + return new CoerceToDomain(properties); + }; + + /** + * Encodes the specified CoerceToDomain message. Does not implicitly {@link pg_query.CoerceToDomain.verify|verify} messages. + * @function encode + * @memberof pg_query.CoerceToDomain + * @static + * @param {pg_query.ICoerceToDomain} message CoerceToDomain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CoerceToDomain.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resulttype != null && Object.hasOwnProperty.call(message, "resulttype")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.resulttype); + if (message.resulttypmod != null && Object.hasOwnProperty.call(message, "resulttypmod")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.resulttypmod); + if (message.resultcollid != null && Object.hasOwnProperty.call(message, "resultcollid")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.resultcollid); + if (message.coercionformat != null && Object.hasOwnProperty.call(message, "coercionformat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.coercionformat); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.location); + return writer; + }; + + /** + * Encodes the specified CoerceToDomain message, length delimited. Does not implicitly {@link pg_query.CoerceToDomain.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CoerceToDomain + * @static + * @param {pg_query.ICoerceToDomain} message CoerceToDomain message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CoerceToDomain.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CoerceToDomain message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CoerceToDomain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CoerceToDomain} CoerceToDomain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CoerceToDomain.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CoerceToDomain(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resulttype = reader.uint32(); + break; + } + case 4: { + message.resulttypmod = reader.int32(); + break; + } + case 5: { + message.resultcollid = reader.uint32(); + break; + } + case 6: { + message.coercionformat = reader.int32(); + break; + } + case 7: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CoerceToDomain message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CoerceToDomain + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CoerceToDomain} CoerceToDomain + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CoerceToDomain.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CoerceToDomain message. + * @function verify + * @memberof pg_query.CoerceToDomain + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CoerceToDomain.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + if (!$util.isInteger(message.resulttype)) + return "resulttype: integer expected"; + if (message.resulttypmod != null && message.hasOwnProperty("resulttypmod")) + if (!$util.isInteger(message.resulttypmod)) + return "resulttypmod: integer expected"; + if (message.resultcollid != null && message.hasOwnProperty("resultcollid")) + if (!$util.isInteger(message.resultcollid)) + return "resultcollid: integer expected"; + if (message.coercionformat != null && message.hasOwnProperty("coercionformat")) + switch (message.coercionformat) { + default: + return "coercionformat: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a CoerceToDomain message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CoerceToDomain + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CoerceToDomain} CoerceToDomain + */ + CoerceToDomain.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CoerceToDomain) + return object; + var message = new $root.pg_query.CoerceToDomain(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.CoerceToDomain.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.CoerceToDomain.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.resulttype != null) + message.resulttype = object.resulttype >>> 0; + if (object.resulttypmod != null) + message.resulttypmod = object.resulttypmod | 0; + if (object.resultcollid != null) + message.resultcollid = object.resultcollid >>> 0; + switch (object.coercionformat) { + default: + if (typeof object.coercionformat === "number") { + message.coercionformat = object.coercionformat; + break; + } + break; + case "COERCION_FORM_UNDEFINED": + case 0: + message.coercionformat = 0; + break; + case "COERCE_EXPLICIT_CALL": + case 1: + message.coercionformat = 1; + break; + case "COERCE_EXPLICIT_CAST": + case 2: + message.coercionformat = 2; + break; + case "COERCE_IMPLICIT_CAST": + case 3: + message.coercionformat = 3; + break; + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a CoerceToDomain message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CoerceToDomain + * @static + * @param {pg_query.CoerceToDomain} message CoerceToDomain + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CoerceToDomain.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.arg = null; + object.resulttype = 0; + object.resulttypmod = 0; + object.resultcollid = 0; + object.coercionformat = options.enums === String ? "COERCION_FORM_UNDEFINED" : 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.resulttype != null && message.hasOwnProperty("resulttype")) + object.resulttype = message.resulttype; + if (message.resulttypmod != null && message.hasOwnProperty("resulttypmod")) + object.resulttypmod = message.resulttypmod; + if (message.resultcollid != null && message.hasOwnProperty("resultcollid")) + object.resultcollid = message.resultcollid; + if (message.coercionformat != null && message.hasOwnProperty("coercionformat")) + object.coercionformat = options.enums === String ? $root.pg_query.CoercionForm[message.coercionformat] === undefined ? message.coercionformat : $root.pg_query.CoercionForm[message.coercionformat] : message.coercionformat; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CoerceToDomain to JSON. + * @function toJSON + * @memberof pg_query.CoerceToDomain + * @instance + * @returns {Object.} JSON object + */ + CoerceToDomain.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CoerceToDomain + * @function getTypeUrl + * @memberof pg_query.CoerceToDomain + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CoerceToDomain.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CoerceToDomain"; + }; + + return CoerceToDomain; + })(); + + pg_query.CoerceToDomainValue = (function() { + + /** + * Properties of a CoerceToDomainValue. + * @memberof pg_query + * @interface ICoerceToDomainValue + * @property {pg_query.INode|null} [xpr] CoerceToDomainValue xpr + * @property {number|null} [typeId] CoerceToDomainValue typeId + * @property {number|null} [typeMod] CoerceToDomainValue typeMod + * @property {number|null} [collation] CoerceToDomainValue collation + * @property {number|null} [location] CoerceToDomainValue location + */ + + /** + * Constructs a new CoerceToDomainValue. + * @memberof pg_query + * @classdesc Represents a CoerceToDomainValue. + * @implements ICoerceToDomainValue + * @constructor + * @param {pg_query.ICoerceToDomainValue=} [properties] Properties to set + */ + function CoerceToDomainValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CoerceToDomainValue xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.CoerceToDomainValue + * @instance + */ + CoerceToDomainValue.prototype.xpr = null; + + /** + * CoerceToDomainValue typeId. + * @member {number} typeId + * @memberof pg_query.CoerceToDomainValue + * @instance + */ + CoerceToDomainValue.prototype.typeId = 0; + + /** + * CoerceToDomainValue typeMod. + * @member {number} typeMod + * @memberof pg_query.CoerceToDomainValue + * @instance + */ + CoerceToDomainValue.prototype.typeMod = 0; + + /** + * CoerceToDomainValue collation. + * @member {number} collation + * @memberof pg_query.CoerceToDomainValue + * @instance + */ + CoerceToDomainValue.prototype.collation = 0; + + /** + * CoerceToDomainValue location. + * @member {number} location + * @memberof pg_query.CoerceToDomainValue + * @instance + */ + CoerceToDomainValue.prototype.location = 0; + + /** + * Creates a new CoerceToDomainValue instance using the specified properties. + * @function create + * @memberof pg_query.CoerceToDomainValue + * @static + * @param {pg_query.ICoerceToDomainValue=} [properties] Properties to set + * @returns {pg_query.CoerceToDomainValue} CoerceToDomainValue instance + */ + CoerceToDomainValue.create = function create(properties) { + return new CoerceToDomainValue(properties); + }; + + /** + * Encodes the specified CoerceToDomainValue message. Does not implicitly {@link pg_query.CoerceToDomainValue.verify|verify} messages. + * @function encode + * @memberof pg_query.CoerceToDomainValue + * @static + * @param {pg_query.ICoerceToDomainValue} message CoerceToDomainValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CoerceToDomainValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.typeId != null && Object.hasOwnProperty.call(message, "typeId")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.typeId); + if (message.typeMod != null && Object.hasOwnProperty.call(message, "typeMod")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.typeMod); + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.collation); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified CoerceToDomainValue message, length delimited. Does not implicitly {@link pg_query.CoerceToDomainValue.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CoerceToDomainValue + * @static + * @param {pg_query.ICoerceToDomainValue} message CoerceToDomainValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CoerceToDomainValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CoerceToDomainValue message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CoerceToDomainValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CoerceToDomainValue} CoerceToDomainValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CoerceToDomainValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CoerceToDomainValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.typeId = reader.uint32(); + break; + } + case 3: { + message.typeMod = reader.int32(); + break; + } + case 4: { + message.collation = reader.uint32(); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CoerceToDomainValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CoerceToDomainValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CoerceToDomainValue} CoerceToDomainValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CoerceToDomainValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CoerceToDomainValue message. + * @function verify + * @memberof pg_query.CoerceToDomainValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CoerceToDomainValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.typeId != null && message.hasOwnProperty("typeId")) + if (!$util.isInteger(message.typeId)) + return "typeId: integer expected"; + if (message.typeMod != null && message.hasOwnProperty("typeMod")) + if (!$util.isInteger(message.typeMod)) + return "typeMod: integer expected"; + if (message.collation != null && message.hasOwnProperty("collation")) + if (!$util.isInteger(message.collation)) + return "collation: integer expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a CoerceToDomainValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CoerceToDomainValue + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CoerceToDomainValue} CoerceToDomainValue + */ + CoerceToDomainValue.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CoerceToDomainValue) + return object; + var message = new $root.pg_query.CoerceToDomainValue(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.CoerceToDomainValue.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.typeId != null) + message.typeId = object.typeId >>> 0; + if (object.typeMod != null) + message.typeMod = object.typeMod | 0; + if (object.collation != null) + message.collation = object.collation >>> 0; + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a CoerceToDomainValue message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CoerceToDomainValue + * @static + * @param {pg_query.CoerceToDomainValue} message CoerceToDomainValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CoerceToDomainValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.typeId = 0; + object.typeMod = 0; + object.collation = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.typeId != null && message.hasOwnProperty("typeId")) + object.typeId = message.typeId; + if (message.typeMod != null && message.hasOwnProperty("typeMod")) + object.typeMod = message.typeMod; + if (message.collation != null && message.hasOwnProperty("collation")) + object.collation = message.collation; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CoerceToDomainValue to JSON. + * @function toJSON + * @memberof pg_query.CoerceToDomainValue + * @instance + * @returns {Object.} JSON object + */ + CoerceToDomainValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CoerceToDomainValue + * @function getTypeUrl + * @memberof pg_query.CoerceToDomainValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CoerceToDomainValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CoerceToDomainValue"; + }; + + return CoerceToDomainValue; + })(); + + pg_query.SetToDefault = (function() { + + /** + * Properties of a SetToDefault. + * @memberof pg_query + * @interface ISetToDefault + * @property {pg_query.INode|null} [xpr] SetToDefault xpr + * @property {number|null} [typeId] SetToDefault typeId + * @property {number|null} [typeMod] SetToDefault typeMod + * @property {number|null} [collation] SetToDefault collation + * @property {number|null} [location] SetToDefault location + */ + + /** + * Constructs a new SetToDefault. + * @memberof pg_query + * @classdesc Represents a SetToDefault. + * @implements ISetToDefault + * @constructor + * @param {pg_query.ISetToDefault=} [properties] Properties to set + */ + function SetToDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetToDefault xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.SetToDefault + * @instance + */ + SetToDefault.prototype.xpr = null; + + /** + * SetToDefault typeId. + * @member {number} typeId + * @memberof pg_query.SetToDefault + * @instance + */ + SetToDefault.prototype.typeId = 0; + + /** + * SetToDefault typeMod. + * @member {number} typeMod + * @memberof pg_query.SetToDefault + * @instance + */ + SetToDefault.prototype.typeMod = 0; + + /** + * SetToDefault collation. + * @member {number} collation + * @memberof pg_query.SetToDefault + * @instance + */ + SetToDefault.prototype.collation = 0; + + /** + * SetToDefault location. + * @member {number} location + * @memberof pg_query.SetToDefault + * @instance + */ + SetToDefault.prototype.location = 0; + + /** + * Creates a new SetToDefault instance using the specified properties. + * @function create + * @memberof pg_query.SetToDefault + * @static + * @param {pg_query.ISetToDefault=} [properties] Properties to set + * @returns {pg_query.SetToDefault} SetToDefault instance + */ + SetToDefault.create = function create(properties) { + return new SetToDefault(properties); + }; + + /** + * Encodes the specified SetToDefault message. Does not implicitly {@link pg_query.SetToDefault.verify|verify} messages. + * @function encode + * @memberof pg_query.SetToDefault + * @static + * @param {pg_query.ISetToDefault} message SetToDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetToDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.typeId != null && Object.hasOwnProperty.call(message, "typeId")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.typeId); + if (message.typeMod != null && Object.hasOwnProperty.call(message, "typeMod")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.typeMod); + if (message.collation != null && Object.hasOwnProperty.call(message, "collation")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.collation); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified SetToDefault message, length delimited. Does not implicitly {@link pg_query.SetToDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.SetToDefault + * @static + * @param {pg_query.ISetToDefault} message SetToDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetToDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetToDefault message from the specified reader or buffer. + * @function decode + * @memberof pg_query.SetToDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.SetToDefault} SetToDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetToDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.SetToDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.typeId = reader.uint32(); + break; + } + case 3: { + message.typeMod = reader.int32(); + break; + } + case 4: { + message.collation = reader.uint32(); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetToDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.SetToDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.SetToDefault} SetToDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetToDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetToDefault message. + * @function verify + * @memberof pg_query.SetToDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetToDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.typeId != null && message.hasOwnProperty("typeId")) + if (!$util.isInteger(message.typeId)) + return "typeId: integer expected"; + if (message.typeMod != null && message.hasOwnProperty("typeMod")) + if (!$util.isInteger(message.typeMod)) + return "typeMod: integer expected"; + if (message.collation != null && message.hasOwnProperty("collation")) + if (!$util.isInteger(message.collation)) + return "collation: integer expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a SetToDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.SetToDefault + * @static + * @param {Object.} object Plain object + * @returns {pg_query.SetToDefault} SetToDefault + */ + SetToDefault.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.SetToDefault) + return object; + var message = new $root.pg_query.SetToDefault(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.SetToDefault.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.typeId != null) + message.typeId = object.typeId >>> 0; + if (object.typeMod != null) + message.typeMod = object.typeMod | 0; + if (object.collation != null) + message.collation = object.collation >>> 0; + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a SetToDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.SetToDefault + * @static + * @param {pg_query.SetToDefault} message SetToDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetToDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.typeId = 0; + object.typeMod = 0; + object.collation = 0; + object.location = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.typeId != null && message.hasOwnProperty("typeId")) + object.typeId = message.typeId; + if (message.typeMod != null && message.hasOwnProperty("typeMod")) + object.typeMod = message.typeMod; + if (message.collation != null && message.hasOwnProperty("collation")) + object.collation = message.collation; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this SetToDefault to JSON. + * @function toJSON + * @memberof pg_query.SetToDefault + * @instance + * @returns {Object.} JSON object + */ + SetToDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetToDefault + * @function getTypeUrl + * @memberof pg_query.SetToDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetToDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.SetToDefault"; + }; + + return SetToDefault; + })(); + + pg_query.CurrentOfExpr = (function() { + + /** + * Properties of a CurrentOfExpr. + * @memberof pg_query + * @interface ICurrentOfExpr + * @property {pg_query.INode|null} [xpr] CurrentOfExpr xpr + * @property {number|null} [cvarno] CurrentOfExpr cvarno + * @property {string|null} [cursor_name] CurrentOfExpr cursor_name + * @property {number|null} [cursor_param] CurrentOfExpr cursor_param + */ + + /** + * Constructs a new CurrentOfExpr. + * @memberof pg_query + * @classdesc Represents a CurrentOfExpr. + * @implements ICurrentOfExpr + * @constructor + * @param {pg_query.ICurrentOfExpr=} [properties] Properties to set + */ + function CurrentOfExpr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CurrentOfExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.CurrentOfExpr + * @instance + */ + CurrentOfExpr.prototype.xpr = null; + + /** + * CurrentOfExpr cvarno. + * @member {number} cvarno + * @memberof pg_query.CurrentOfExpr + * @instance + */ + CurrentOfExpr.prototype.cvarno = 0; + + /** + * CurrentOfExpr cursor_name. + * @member {string} cursor_name + * @memberof pg_query.CurrentOfExpr + * @instance + */ + CurrentOfExpr.prototype.cursor_name = ""; + + /** + * CurrentOfExpr cursor_param. + * @member {number} cursor_param + * @memberof pg_query.CurrentOfExpr + * @instance + */ + CurrentOfExpr.prototype.cursor_param = 0; + + /** + * Creates a new CurrentOfExpr instance using the specified properties. + * @function create + * @memberof pg_query.CurrentOfExpr + * @static + * @param {pg_query.ICurrentOfExpr=} [properties] Properties to set + * @returns {pg_query.CurrentOfExpr} CurrentOfExpr instance + */ + CurrentOfExpr.create = function create(properties) { + return new CurrentOfExpr(properties); + }; + + /** + * Encodes the specified CurrentOfExpr message. Does not implicitly {@link pg_query.CurrentOfExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.CurrentOfExpr + * @static + * @param {pg_query.ICurrentOfExpr} message CurrentOfExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentOfExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cvarno != null && Object.hasOwnProperty.call(message, "cvarno")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.cvarno); + if (message.cursor_name != null && Object.hasOwnProperty.call(message, "cursor_name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.cursor_name); + if (message.cursor_param != null && Object.hasOwnProperty.call(message, "cursor_param")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.cursor_param); + return writer; + }; + + /** + * Encodes the specified CurrentOfExpr message, length delimited. Does not implicitly {@link pg_query.CurrentOfExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CurrentOfExpr + * @static + * @param {pg_query.ICurrentOfExpr} message CurrentOfExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CurrentOfExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CurrentOfExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CurrentOfExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CurrentOfExpr} CurrentOfExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentOfExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CurrentOfExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.cvarno = reader.uint32(); + break; + } + case 3: { + message.cursor_name = reader.string(); + break; + } + case 4: { + message.cursor_param = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CurrentOfExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CurrentOfExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CurrentOfExpr} CurrentOfExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CurrentOfExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CurrentOfExpr message. + * @function verify + * @memberof pg_query.CurrentOfExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CurrentOfExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.cvarno != null && message.hasOwnProperty("cvarno")) + if (!$util.isInteger(message.cvarno)) + return "cvarno: integer expected"; + if (message.cursor_name != null && message.hasOwnProperty("cursor_name")) + if (!$util.isString(message.cursor_name)) + return "cursor_name: string expected"; + if (message.cursor_param != null && message.hasOwnProperty("cursor_param")) + if (!$util.isInteger(message.cursor_param)) + return "cursor_param: integer expected"; + return null; + }; + + /** + * Creates a CurrentOfExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CurrentOfExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CurrentOfExpr} CurrentOfExpr + */ + CurrentOfExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CurrentOfExpr) + return object; + var message = new $root.pg_query.CurrentOfExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.CurrentOfExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.cvarno != null) + message.cvarno = object.cvarno >>> 0; + if (object.cursor_name != null) + message.cursor_name = String(object.cursor_name); + if (object.cursor_param != null) + message.cursor_param = object.cursor_param | 0; + return message; + }; + + /** + * Creates a plain object from a CurrentOfExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CurrentOfExpr + * @static + * @param {pg_query.CurrentOfExpr} message CurrentOfExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CurrentOfExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.cvarno = 0; + object.cursor_name = ""; + object.cursor_param = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.cvarno != null && message.hasOwnProperty("cvarno")) + object.cvarno = message.cvarno; + if (message.cursor_name != null && message.hasOwnProperty("cursor_name")) + object.cursor_name = message.cursor_name; + if (message.cursor_param != null && message.hasOwnProperty("cursor_param")) + object.cursor_param = message.cursor_param; + return object; + }; + + /** + * Converts this CurrentOfExpr to JSON. + * @function toJSON + * @memberof pg_query.CurrentOfExpr + * @instance + * @returns {Object.} JSON object + */ + CurrentOfExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CurrentOfExpr + * @function getTypeUrl + * @memberof pg_query.CurrentOfExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CurrentOfExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CurrentOfExpr"; + }; + + return CurrentOfExpr; + })(); + + pg_query.NextValueExpr = (function() { + + /** + * Properties of a NextValueExpr. + * @memberof pg_query + * @interface INextValueExpr + * @property {pg_query.INode|null} [xpr] NextValueExpr xpr + * @property {number|null} [seqid] NextValueExpr seqid + * @property {number|null} [typeId] NextValueExpr typeId + */ + + /** + * Constructs a new NextValueExpr. + * @memberof pg_query + * @classdesc Represents a NextValueExpr. + * @implements INextValueExpr + * @constructor + * @param {pg_query.INextValueExpr=} [properties] Properties to set + */ + function NextValueExpr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NextValueExpr xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.NextValueExpr + * @instance + */ + NextValueExpr.prototype.xpr = null; + + /** + * NextValueExpr seqid. + * @member {number} seqid + * @memberof pg_query.NextValueExpr + * @instance + */ + NextValueExpr.prototype.seqid = 0; + + /** + * NextValueExpr typeId. + * @member {number} typeId + * @memberof pg_query.NextValueExpr + * @instance + */ + NextValueExpr.prototype.typeId = 0; + + /** + * Creates a new NextValueExpr instance using the specified properties. + * @function create + * @memberof pg_query.NextValueExpr + * @static + * @param {pg_query.INextValueExpr=} [properties] Properties to set + * @returns {pg_query.NextValueExpr} NextValueExpr instance + */ + NextValueExpr.create = function create(properties) { + return new NextValueExpr(properties); + }; + + /** + * Encodes the specified NextValueExpr message. Does not implicitly {@link pg_query.NextValueExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.NextValueExpr + * @static + * @param {pg_query.INextValueExpr} message NextValueExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NextValueExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.seqid != null && Object.hasOwnProperty.call(message, "seqid")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.seqid); + if (message.typeId != null && Object.hasOwnProperty.call(message, "typeId")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.typeId); + return writer; + }; + + /** + * Encodes the specified NextValueExpr message, length delimited. Does not implicitly {@link pg_query.NextValueExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.NextValueExpr + * @static + * @param {pg_query.INextValueExpr} message NextValueExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NextValueExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NextValueExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.NextValueExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.NextValueExpr} NextValueExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NextValueExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.NextValueExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.seqid = reader.uint32(); + break; + } + case 3: { + message.typeId = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NextValueExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.NextValueExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.NextValueExpr} NextValueExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NextValueExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NextValueExpr message. + * @function verify + * @memberof pg_query.NextValueExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NextValueExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.seqid != null && message.hasOwnProperty("seqid")) + if (!$util.isInteger(message.seqid)) + return "seqid: integer expected"; + if (message.typeId != null && message.hasOwnProperty("typeId")) + if (!$util.isInteger(message.typeId)) + return "typeId: integer expected"; + return null; + }; + + /** + * Creates a NextValueExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.NextValueExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.NextValueExpr} NextValueExpr + */ + NextValueExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.NextValueExpr) + return object; + var message = new $root.pg_query.NextValueExpr(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.NextValueExpr.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.seqid != null) + message.seqid = object.seqid >>> 0; + if (object.typeId != null) + message.typeId = object.typeId >>> 0; + return message; + }; + + /** + * Creates a plain object from a NextValueExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.NextValueExpr + * @static + * @param {pg_query.NextValueExpr} message NextValueExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NextValueExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.seqid = 0; + object.typeId = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.seqid != null && message.hasOwnProperty("seqid")) + object.seqid = message.seqid; + if (message.typeId != null && message.hasOwnProperty("typeId")) + object.typeId = message.typeId; + return object; + }; + + /** + * Converts this NextValueExpr to JSON. + * @function toJSON + * @memberof pg_query.NextValueExpr + * @instance + * @returns {Object.} JSON object + */ + NextValueExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NextValueExpr + * @function getTypeUrl + * @memberof pg_query.NextValueExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NextValueExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.NextValueExpr"; + }; + + return NextValueExpr; + })(); + + pg_query.InferenceElem = (function() { + + /** + * Properties of an InferenceElem. + * @memberof pg_query + * @interface IInferenceElem + * @property {pg_query.INode|null} [xpr] InferenceElem xpr + * @property {pg_query.INode|null} [expr] InferenceElem expr + * @property {number|null} [infercollid] InferenceElem infercollid + * @property {number|null} [inferopclass] InferenceElem inferopclass + */ + + /** + * Constructs a new InferenceElem. + * @memberof pg_query + * @classdesc Represents an InferenceElem. + * @implements IInferenceElem + * @constructor + * @param {pg_query.IInferenceElem=} [properties] Properties to set + */ + function InferenceElem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InferenceElem xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.InferenceElem + * @instance + */ + InferenceElem.prototype.xpr = null; + + /** + * InferenceElem expr. + * @member {pg_query.INode|null|undefined} expr + * @memberof pg_query.InferenceElem + * @instance + */ + InferenceElem.prototype.expr = null; + + /** + * InferenceElem infercollid. + * @member {number} infercollid + * @memberof pg_query.InferenceElem + * @instance + */ + InferenceElem.prototype.infercollid = 0; + + /** + * InferenceElem inferopclass. + * @member {number} inferopclass + * @memberof pg_query.InferenceElem + * @instance + */ + InferenceElem.prototype.inferopclass = 0; + + /** + * Creates a new InferenceElem instance using the specified properties. + * @function create + * @memberof pg_query.InferenceElem + * @static + * @param {pg_query.IInferenceElem=} [properties] Properties to set + * @returns {pg_query.InferenceElem} InferenceElem instance + */ + InferenceElem.create = function create(properties) { + return new InferenceElem(properties); + }; + + /** + * Encodes the specified InferenceElem message. Does not implicitly {@link pg_query.InferenceElem.verify|verify} messages. + * @function encode + * @memberof pg_query.InferenceElem + * @static + * @param {pg_query.IInferenceElem} message InferenceElem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InferenceElem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.expr != null && Object.hasOwnProperty.call(message, "expr")) + $root.pg_query.Node.encode(message.expr, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.infercollid != null && Object.hasOwnProperty.call(message, "infercollid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.infercollid); + if (message.inferopclass != null && Object.hasOwnProperty.call(message, "inferopclass")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.inferopclass); + return writer; + }; + + /** + * Encodes the specified InferenceElem message, length delimited. Does not implicitly {@link pg_query.InferenceElem.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.InferenceElem + * @static + * @param {pg_query.IInferenceElem} message InferenceElem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InferenceElem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InferenceElem message from the specified reader or buffer. + * @function decode + * @memberof pg_query.InferenceElem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.InferenceElem} InferenceElem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InferenceElem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.InferenceElem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.expr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.infercollid = reader.uint32(); + break; + } + case 4: { + message.inferopclass = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InferenceElem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.InferenceElem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.InferenceElem} InferenceElem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InferenceElem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InferenceElem message. + * @function verify + * @memberof pg_query.InferenceElem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InferenceElem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.expr != null && message.hasOwnProperty("expr")) { + var error = $root.pg_query.Node.verify(message.expr); + if (error) + return "expr." + error; + } + if (message.infercollid != null && message.hasOwnProperty("infercollid")) + if (!$util.isInteger(message.infercollid)) + return "infercollid: integer expected"; + if (message.inferopclass != null && message.hasOwnProperty("inferopclass")) + if (!$util.isInteger(message.inferopclass)) + return "inferopclass: integer expected"; + return null; + }; + + /** + * Creates an InferenceElem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.InferenceElem + * @static + * @param {Object.} object Plain object + * @returns {pg_query.InferenceElem} InferenceElem + */ + InferenceElem.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.InferenceElem) + return object; + var message = new $root.pg_query.InferenceElem(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.InferenceElem.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.expr != null) { + if (typeof object.expr !== "object") + throw TypeError(".pg_query.InferenceElem.expr: object expected"); + message.expr = $root.pg_query.Node.fromObject(object.expr); + } + if (object.infercollid != null) + message.infercollid = object.infercollid >>> 0; + if (object.inferopclass != null) + message.inferopclass = object.inferopclass >>> 0; + return message; + }; + + /** + * Creates a plain object from an InferenceElem message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.InferenceElem + * @static + * @param {pg_query.InferenceElem} message InferenceElem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InferenceElem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.expr = null; + object.infercollid = 0; + object.inferopclass = 0; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.expr != null && message.hasOwnProperty("expr")) + object.expr = $root.pg_query.Node.toObject(message.expr, options); + if (message.infercollid != null && message.hasOwnProperty("infercollid")) + object.infercollid = message.infercollid; + if (message.inferopclass != null && message.hasOwnProperty("inferopclass")) + object.inferopclass = message.inferopclass; + return object; + }; + + /** + * Converts this InferenceElem to JSON. + * @function toJSON + * @memberof pg_query.InferenceElem + * @instance + * @returns {Object.} JSON object + */ + InferenceElem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InferenceElem + * @function getTypeUrl + * @memberof pg_query.InferenceElem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InferenceElem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.InferenceElem"; + }; + + return InferenceElem; + })(); + + pg_query.TargetEntry = (function() { + + /** + * Properties of a TargetEntry. + * @memberof pg_query + * @interface ITargetEntry + * @property {pg_query.INode|null} [xpr] TargetEntry xpr + * @property {pg_query.INode|null} [expr] TargetEntry expr + * @property {number|null} [resno] TargetEntry resno + * @property {string|null} [resname] TargetEntry resname + * @property {number|null} [ressortgroupref] TargetEntry ressortgroupref + * @property {number|null} [resorigtbl] TargetEntry resorigtbl + * @property {number|null} [resorigcol] TargetEntry resorigcol + * @property {boolean|null} [resjunk] TargetEntry resjunk + */ + + /** + * Constructs a new TargetEntry. + * @memberof pg_query + * @classdesc Represents a TargetEntry. + * @implements ITargetEntry + * @constructor + * @param {pg_query.ITargetEntry=} [properties] Properties to set + */ + function TargetEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetEntry xpr. + * @member {pg_query.INode|null|undefined} xpr + * @memberof pg_query.TargetEntry + * @instance + */ + TargetEntry.prototype.xpr = null; + + /** + * TargetEntry expr. + * @member {pg_query.INode|null|undefined} expr + * @memberof pg_query.TargetEntry + * @instance + */ + TargetEntry.prototype.expr = null; + + /** + * TargetEntry resno. + * @member {number} resno + * @memberof pg_query.TargetEntry + * @instance + */ + TargetEntry.prototype.resno = 0; + + /** + * TargetEntry resname. + * @member {string} resname + * @memberof pg_query.TargetEntry + * @instance + */ + TargetEntry.prototype.resname = ""; + + /** + * TargetEntry ressortgroupref. + * @member {number} ressortgroupref + * @memberof pg_query.TargetEntry + * @instance + */ + TargetEntry.prototype.ressortgroupref = 0; + + /** + * TargetEntry resorigtbl. + * @member {number} resorigtbl + * @memberof pg_query.TargetEntry + * @instance + */ + TargetEntry.prototype.resorigtbl = 0; + + /** + * TargetEntry resorigcol. + * @member {number} resorigcol + * @memberof pg_query.TargetEntry + * @instance + */ + TargetEntry.prototype.resorigcol = 0; + + /** + * TargetEntry resjunk. + * @member {boolean} resjunk + * @memberof pg_query.TargetEntry + * @instance + */ + TargetEntry.prototype.resjunk = false; + + /** + * Creates a new TargetEntry instance using the specified properties. + * @function create + * @memberof pg_query.TargetEntry + * @static + * @param {pg_query.ITargetEntry=} [properties] Properties to set + * @returns {pg_query.TargetEntry} TargetEntry instance + */ + TargetEntry.create = function create(properties) { + return new TargetEntry(properties); + }; + + /** + * Encodes the specified TargetEntry message. Does not implicitly {@link pg_query.TargetEntry.verify|verify} messages. + * @function encode + * @memberof pg_query.TargetEntry + * @static + * @param {pg_query.ITargetEntry} message TargetEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xpr != null && Object.hasOwnProperty.call(message, "xpr")) + $root.pg_query.Node.encode(message.xpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.expr != null && Object.hasOwnProperty.call(message, "expr")) + $root.pg_query.Node.encode(message.expr, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.resno != null && Object.hasOwnProperty.call(message, "resno")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.resno); + if (message.resname != null && Object.hasOwnProperty.call(message, "resname")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resname); + if (message.ressortgroupref != null && Object.hasOwnProperty.call(message, "ressortgroupref")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.ressortgroupref); + if (message.resorigtbl != null && Object.hasOwnProperty.call(message, "resorigtbl")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.resorigtbl); + if (message.resorigcol != null && Object.hasOwnProperty.call(message, "resorigcol")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.resorigcol); + if (message.resjunk != null && Object.hasOwnProperty.call(message, "resjunk")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.resjunk); + return writer; + }; + + /** + * Encodes the specified TargetEntry message, length delimited. Does not implicitly {@link pg_query.TargetEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.TargetEntry + * @static + * @param {pg_query.ITargetEntry} message TargetEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetEntry message from the specified reader or buffer. + * @function decode + * @memberof pg_query.TargetEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.TargetEntry} TargetEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.TargetEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.expr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.resno = reader.int32(); + break; + } + case 4: { + message.resname = reader.string(); + break; + } + case 5: { + message.ressortgroupref = reader.uint32(); + break; + } + case 6: { + message.resorigtbl = reader.uint32(); + break; + } + case 7: { + message.resorigcol = reader.int32(); + break; + } + case 8: { + message.resjunk = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.TargetEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.TargetEntry} TargetEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetEntry message. + * @function verify + * @memberof pg_query.TargetEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xpr != null && message.hasOwnProperty("xpr")) { + var error = $root.pg_query.Node.verify(message.xpr); + if (error) + return "xpr." + error; + } + if (message.expr != null && message.hasOwnProperty("expr")) { + var error = $root.pg_query.Node.verify(message.expr); + if (error) + return "expr." + error; + } + if (message.resno != null && message.hasOwnProperty("resno")) + if (!$util.isInteger(message.resno)) + return "resno: integer expected"; + if (message.resname != null && message.hasOwnProperty("resname")) + if (!$util.isString(message.resname)) + return "resname: string expected"; + if (message.ressortgroupref != null && message.hasOwnProperty("ressortgroupref")) + if (!$util.isInteger(message.ressortgroupref)) + return "ressortgroupref: integer expected"; + if (message.resorigtbl != null && message.hasOwnProperty("resorigtbl")) + if (!$util.isInteger(message.resorigtbl)) + return "resorigtbl: integer expected"; + if (message.resorigcol != null && message.hasOwnProperty("resorigcol")) + if (!$util.isInteger(message.resorigcol)) + return "resorigcol: integer expected"; + if (message.resjunk != null && message.hasOwnProperty("resjunk")) + if (typeof message.resjunk !== "boolean") + return "resjunk: boolean expected"; + return null; + }; + + /** + * Creates a TargetEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.TargetEntry + * @static + * @param {Object.} object Plain object + * @returns {pg_query.TargetEntry} TargetEntry + */ + TargetEntry.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.TargetEntry) + return object; + var message = new $root.pg_query.TargetEntry(); + if (object.xpr != null) { + if (typeof object.xpr !== "object") + throw TypeError(".pg_query.TargetEntry.xpr: object expected"); + message.xpr = $root.pg_query.Node.fromObject(object.xpr); + } + if (object.expr != null) { + if (typeof object.expr !== "object") + throw TypeError(".pg_query.TargetEntry.expr: object expected"); + message.expr = $root.pg_query.Node.fromObject(object.expr); + } + if (object.resno != null) + message.resno = object.resno | 0; + if (object.resname != null) + message.resname = String(object.resname); + if (object.ressortgroupref != null) + message.ressortgroupref = object.ressortgroupref >>> 0; + if (object.resorigtbl != null) + message.resorigtbl = object.resorigtbl >>> 0; + if (object.resorigcol != null) + message.resorigcol = object.resorigcol | 0; + if (object.resjunk != null) + message.resjunk = Boolean(object.resjunk); + return message; + }; + + /** + * Creates a plain object from a TargetEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.TargetEntry + * @static + * @param {pg_query.TargetEntry} message TargetEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xpr = null; + object.expr = null; + object.resno = 0; + object.resname = ""; + object.ressortgroupref = 0; + object.resorigtbl = 0; + object.resorigcol = 0; + object.resjunk = false; + } + if (message.xpr != null && message.hasOwnProperty("xpr")) + object.xpr = $root.pg_query.Node.toObject(message.xpr, options); + if (message.expr != null && message.hasOwnProperty("expr")) + object.expr = $root.pg_query.Node.toObject(message.expr, options); + if (message.resno != null && message.hasOwnProperty("resno")) + object.resno = message.resno; + if (message.resname != null && message.hasOwnProperty("resname")) + object.resname = message.resname; + if (message.ressortgroupref != null && message.hasOwnProperty("ressortgroupref")) + object.ressortgroupref = message.ressortgroupref; + if (message.resorigtbl != null && message.hasOwnProperty("resorigtbl")) + object.resorigtbl = message.resorigtbl; + if (message.resorigcol != null && message.hasOwnProperty("resorigcol")) + object.resorigcol = message.resorigcol; + if (message.resjunk != null && message.hasOwnProperty("resjunk")) + object.resjunk = message.resjunk; + return object; + }; + + /** + * Converts this TargetEntry to JSON. + * @function toJSON + * @memberof pg_query.TargetEntry + * @instance + * @returns {Object.} JSON object + */ + TargetEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetEntry + * @function getTypeUrl + * @memberof pg_query.TargetEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.TargetEntry"; + }; + + return TargetEntry; + })(); + + pg_query.RangeTblRef = (function() { + + /** + * Properties of a RangeTblRef. + * @memberof pg_query + * @interface IRangeTblRef + * @property {number|null} [rtindex] RangeTblRef rtindex + */ + + /** + * Constructs a new RangeTblRef. + * @memberof pg_query + * @classdesc Represents a RangeTblRef. + * @implements IRangeTblRef + * @constructor + * @param {pg_query.IRangeTblRef=} [properties] Properties to set + */ + function RangeTblRef(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RangeTblRef rtindex. + * @member {number} rtindex + * @memberof pg_query.RangeTblRef + * @instance + */ + RangeTblRef.prototype.rtindex = 0; + + /** + * Creates a new RangeTblRef instance using the specified properties. + * @function create + * @memberof pg_query.RangeTblRef + * @static + * @param {pg_query.IRangeTblRef=} [properties] Properties to set + * @returns {pg_query.RangeTblRef} RangeTblRef instance + */ + RangeTblRef.create = function create(properties) { + return new RangeTblRef(properties); + }; + + /** + * Encodes the specified RangeTblRef message. Does not implicitly {@link pg_query.RangeTblRef.verify|verify} messages. + * @function encode + * @memberof pg_query.RangeTblRef + * @static + * @param {pg_query.IRangeTblRef} message RangeTblRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeTblRef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rtindex != null && Object.hasOwnProperty.call(message, "rtindex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rtindex); + return writer; + }; + + /** + * Encodes the specified RangeTblRef message, length delimited. Does not implicitly {@link pg_query.RangeTblRef.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RangeTblRef + * @static + * @param {pg_query.IRangeTblRef} message RangeTblRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeTblRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RangeTblRef message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RangeTblRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RangeTblRef} RangeTblRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeTblRef.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RangeTblRef(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rtindex = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RangeTblRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RangeTblRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RangeTblRef} RangeTblRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeTblRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RangeTblRef message. + * @function verify + * @memberof pg_query.RangeTblRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RangeTblRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rtindex != null && message.hasOwnProperty("rtindex")) + if (!$util.isInteger(message.rtindex)) + return "rtindex: integer expected"; + return null; + }; + + /** + * Creates a RangeTblRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RangeTblRef + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RangeTblRef} RangeTblRef + */ + RangeTblRef.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RangeTblRef) + return object; + var message = new $root.pg_query.RangeTblRef(); + if (object.rtindex != null) + message.rtindex = object.rtindex | 0; + return message; + }; + + /** + * Creates a plain object from a RangeTblRef message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RangeTblRef + * @static + * @param {pg_query.RangeTblRef} message RangeTblRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RangeTblRef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.rtindex = 0; + if (message.rtindex != null && message.hasOwnProperty("rtindex")) + object.rtindex = message.rtindex; + return object; + }; + + /** + * Converts this RangeTblRef to JSON. + * @function toJSON + * @memberof pg_query.RangeTblRef + * @instance + * @returns {Object.} JSON object + */ + RangeTblRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RangeTblRef + * @function getTypeUrl + * @memberof pg_query.RangeTblRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RangeTblRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RangeTblRef"; + }; + + return RangeTblRef; + })(); + + pg_query.JoinExpr = (function() { + + /** + * Properties of a JoinExpr. + * @memberof pg_query + * @interface IJoinExpr + * @property {pg_query.JoinType|null} [jointype] JoinExpr jointype + * @property {boolean|null} [isNatural] JoinExpr isNatural + * @property {pg_query.INode|null} [larg] JoinExpr larg + * @property {pg_query.INode|null} [rarg] JoinExpr rarg + * @property {Array.|null} [usingClause] JoinExpr usingClause + * @property {pg_query.INode|null} [quals] JoinExpr quals + * @property {pg_query.IAlias|null} [alias] JoinExpr alias + * @property {number|null} [rtindex] JoinExpr rtindex + */ + + /** + * Constructs a new JoinExpr. + * @memberof pg_query + * @classdesc Represents a JoinExpr. + * @implements IJoinExpr + * @constructor + * @param {pg_query.IJoinExpr=} [properties] Properties to set + */ + function JoinExpr(properties) { + this.usingClause = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JoinExpr jointype. + * @member {pg_query.JoinType} jointype + * @memberof pg_query.JoinExpr + * @instance + */ + JoinExpr.prototype.jointype = 0; + + /** + * JoinExpr isNatural. + * @member {boolean} isNatural + * @memberof pg_query.JoinExpr + * @instance + */ + JoinExpr.prototype.isNatural = false; + + /** + * JoinExpr larg. + * @member {pg_query.INode|null|undefined} larg + * @memberof pg_query.JoinExpr + * @instance + */ + JoinExpr.prototype.larg = null; + + /** + * JoinExpr rarg. + * @member {pg_query.INode|null|undefined} rarg + * @memberof pg_query.JoinExpr + * @instance + */ + JoinExpr.prototype.rarg = null; + + /** + * JoinExpr usingClause. + * @member {Array.} usingClause + * @memberof pg_query.JoinExpr + * @instance + */ + JoinExpr.prototype.usingClause = $util.emptyArray; + + /** + * JoinExpr quals. + * @member {pg_query.INode|null|undefined} quals + * @memberof pg_query.JoinExpr + * @instance + */ + JoinExpr.prototype.quals = null; + + /** + * JoinExpr alias. + * @member {pg_query.IAlias|null|undefined} alias + * @memberof pg_query.JoinExpr + * @instance + */ + JoinExpr.prototype.alias = null; + + /** + * JoinExpr rtindex. + * @member {number} rtindex + * @memberof pg_query.JoinExpr + * @instance + */ + JoinExpr.prototype.rtindex = 0; + + /** + * Creates a new JoinExpr instance using the specified properties. + * @function create + * @memberof pg_query.JoinExpr + * @static + * @param {pg_query.IJoinExpr=} [properties] Properties to set + * @returns {pg_query.JoinExpr} JoinExpr instance + */ + JoinExpr.create = function create(properties) { + return new JoinExpr(properties); + }; + + /** + * Encodes the specified JoinExpr message. Does not implicitly {@link pg_query.JoinExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.JoinExpr + * @static + * @param {pg_query.IJoinExpr} message JoinExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JoinExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jointype != null && Object.hasOwnProperty.call(message, "jointype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.jointype); + if (message.isNatural != null && Object.hasOwnProperty.call(message, "isNatural")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isNatural); + if (message.larg != null && Object.hasOwnProperty.call(message, "larg")) + $root.pg_query.Node.encode(message.larg, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rarg != null && Object.hasOwnProperty.call(message, "rarg")) + $root.pg_query.Node.encode(message.rarg, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.usingClause != null && message.usingClause.length) + for (var i = 0; i < message.usingClause.length; ++i) + $root.pg_query.Node.encode(message.usingClause[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.quals != null && Object.hasOwnProperty.call(message, "quals")) + $root.pg_query.Node.encode(message.quals, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + $root.pg_query.Alias.encode(message.alias, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.rtindex != null && Object.hasOwnProperty.call(message, "rtindex")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.rtindex); + return writer; + }; + + /** + * Encodes the specified JoinExpr message, length delimited. Does not implicitly {@link pg_query.JoinExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.JoinExpr + * @static + * @param {pg_query.IJoinExpr} message JoinExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JoinExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JoinExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.JoinExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.JoinExpr} JoinExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JoinExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.JoinExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.jointype = reader.int32(); + break; + } + case 2: { + message.isNatural = reader.bool(); + break; + } + case 3: { + message.larg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.rarg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.usingClause && message.usingClause.length)) + message.usingClause = []; + message.usingClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.quals = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 7: { + message.alias = $root.pg_query.Alias.decode(reader, reader.uint32()); + break; + } + case 8: { + message.rtindex = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JoinExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.JoinExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.JoinExpr} JoinExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JoinExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JoinExpr message. + * @function verify + * @memberof pg_query.JoinExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JoinExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jointype != null && message.hasOwnProperty("jointype")) + switch (message.jointype) { + default: + return "jointype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.isNatural != null && message.hasOwnProperty("isNatural")) + if (typeof message.isNatural !== "boolean") + return "isNatural: boolean expected"; + if (message.larg != null && message.hasOwnProperty("larg")) { + var error = $root.pg_query.Node.verify(message.larg); + if (error) + return "larg." + error; + } + if (message.rarg != null && message.hasOwnProperty("rarg")) { + var error = $root.pg_query.Node.verify(message.rarg); + if (error) + return "rarg." + error; + } + if (message.usingClause != null && message.hasOwnProperty("usingClause")) { + if (!Array.isArray(message.usingClause)) + return "usingClause: array expected"; + for (var i = 0; i < message.usingClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.usingClause[i]); + if (error) + return "usingClause." + error; + } + } + if (message.quals != null && message.hasOwnProperty("quals")) { + var error = $root.pg_query.Node.verify(message.quals); + if (error) + return "quals." + error; + } + if (message.alias != null && message.hasOwnProperty("alias")) { + var error = $root.pg_query.Alias.verify(message.alias); + if (error) + return "alias." + error; + } + if (message.rtindex != null && message.hasOwnProperty("rtindex")) + if (!$util.isInteger(message.rtindex)) + return "rtindex: integer expected"; + return null; + }; + + /** + * Creates a JoinExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.JoinExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.JoinExpr} JoinExpr + */ + JoinExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.JoinExpr) + return object; + var message = new $root.pg_query.JoinExpr(); + switch (object.jointype) { + default: + if (typeof object.jointype === "number") { + message.jointype = object.jointype; + break; + } + break; + case "JOIN_TYPE_UNDEFINED": + case 0: + message.jointype = 0; + break; + case "JOIN_INNER": + case 1: + message.jointype = 1; + break; + case "JOIN_LEFT": + case 2: + message.jointype = 2; + break; + case "JOIN_FULL": + case 3: + message.jointype = 3; + break; + case "JOIN_RIGHT": + case 4: + message.jointype = 4; + break; + case "JOIN_SEMI": + case 5: + message.jointype = 5; + break; + case "JOIN_ANTI": + case 6: + message.jointype = 6; + break; + case "JOIN_UNIQUE_OUTER": + case 7: + message.jointype = 7; + break; + case "JOIN_UNIQUE_INNER": + case 8: + message.jointype = 8; + break; + } + if (object.isNatural != null) + message.isNatural = Boolean(object.isNatural); + if (object.larg != null) { + if (typeof object.larg !== "object") + throw TypeError(".pg_query.JoinExpr.larg: object expected"); + message.larg = $root.pg_query.Node.fromObject(object.larg); + } + if (object.rarg != null) { + if (typeof object.rarg !== "object") + throw TypeError(".pg_query.JoinExpr.rarg: object expected"); + message.rarg = $root.pg_query.Node.fromObject(object.rarg); + } + if (object.usingClause) { + if (!Array.isArray(object.usingClause)) + throw TypeError(".pg_query.JoinExpr.usingClause: array expected"); + message.usingClause = []; + for (var i = 0; i < object.usingClause.length; ++i) { + if (typeof object.usingClause[i] !== "object") + throw TypeError(".pg_query.JoinExpr.usingClause: object expected"); + message.usingClause[i] = $root.pg_query.Node.fromObject(object.usingClause[i]); + } + } + if (object.quals != null) { + if (typeof object.quals !== "object") + throw TypeError(".pg_query.JoinExpr.quals: object expected"); + message.quals = $root.pg_query.Node.fromObject(object.quals); + } + if (object.alias != null) { + if (typeof object.alias !== "object") + throw TypeError(".pg_query.JoinExpr.alias: object expected"); + message.alias = $root.pg_query.Alias.fromObject(object.alias); + } + if (object.rtindex != null) + message.rtindex = object.rtindex | 0; + return message; + }; + + /** + * Creates a plain object from a JoinExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.JoinExpr + * @static + * @param {pg_query.JoinExpr} message JoinExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JoinExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.usingClause = []; + if (options.defaults) { + object.jointype = options.enums === String ? "JOIN_TYPE_UNDEFINED" : 0; + object.isNatural = false; + object.larg = null; + object.rarg = null; + object.quals = null; + object.alias = null; + object.rtindex = 0; + } + if (message.jointype != null && message.hasOwnProperty("jointype")) + object.jointype = options.enums === String ? $root.pg_query.JoinType[message.jointype] === undefined ? message.jointype : $root.pg_query.JoinType[message.jointype] : message.jointype; + if (message.isNatural != null && message.hasOwnProperty("isNatural")) + object.isNatural = message.isNatural; + if (message.larg != null && message.hasOwnProperty("larg")) + object.larg = $root.pg_query.Node.toObject(message.larg, options); + if (message.rarg != null && message.hasOwnProperty("rarg")) + object.rarg = $root.pg_query.Node.toObject(message.rarg, options); + if (message.usingClause && message.usingClause.length) { + object.usingClause = []; + for (var j = 0; j < message.usingClause.length; ++j) + object.usingClause[j] = $root.pg_query.Node.toObject(message.usingClause[j], options); + } + if (message.quals != null && message.hasOwnProperty("quals")) + object.quals = $root.pg_query.Node.toObject(message.quals, options); + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = $root.pg_query.Alias.toObject(message.alias, options); + if (message.rtindex != null && message.hasOwnProperty("rtindex")) + object.rtindex = message.rtindex; + return object; + }; + + /** + * Converts this JoinExpr to JSON. + * @function toJSON + * @memberof pg_query.JoinExpr + * @instance + * @returns {Object.} JSON object + */ + JoinExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JoinExpr + * @function getTypeUrl + * @memberof pg_query.JoinExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JoinExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.JoinExpr"; + }; + + return JoinExpr; + })(); + + pg_query.FromExpr = (function() { + + /** + * Properties of a FromExpr. + * @memberof pg_query + * @interface IFromExpr + * @property {Array.|null} [fromlist] FromExpr fromlist + * @property {pg_query.INode|null} [quals] FromExpr quals + */ + + /** + * Constructs a new FromExpr. + * @memberof pg_query + * @classdesc Represents a FromExpr. + * @implements IFromExpr + * @constructor + * @param {pg_query.IFromExpr=} [properties] Properties to set + */ + function FromExpr(properties) { + this.fromlist = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FromExpr fromlist. + * @member {Array.} fromlist + * @memberof pg_query.FromExpr + * @instance + */ + FromExpr.prototype.fromlist = $util.emptyArray; + + /** + * FromExpr quals. + * @member {pg_query.INode|null|undefined} quals + * @memberof pg_query.FromExpr + * @instance + */ + FromExpr.prototype.quals = null; + + /** + * Creates a new FromExpr instance using the specified properties. + * @function create + * @memberof pg_query.FromExpr + * @static + * @param {pg_query.IFromExpr=} [properties] Properties to set + * @returns {pg_query.FromExpr} FromExpr instance + */ + FromExpr.create = function create(properties) { + return new FromExpr(properties); + }; + + /** + * Encodes the specified FromExpr message. Does not implicitly {@link pg_query.FromExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.FromExpr + * @static + * @param {pg_query.IFromExpr} message FromExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FromExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fromlist != null && message.fromlist.length) + for (var i = 0; i < message.fromlist.length; ++i) + $root.pg_query.Node.encode(message.fromlist[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.quals != null && Object.hasOwnProperty.call(message, "quals")) + $root.pg_query.Node.encode(message.quals, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FromExpr message, length delimited. Does not implicitly {@link pg_query.FromExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.FromExpr + * @static + * @param {pg_query.IFromExpr} message FromExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FromExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FromExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.FromExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.FromExpr} FromExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FromExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.FromExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.fromlist && message.fromlist.length)) + message.fromlist = []; + message.fromlist.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.quals = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FromExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.FromExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.FromExpr} FromExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FromExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FromExpr message. + * @function verify + * @memberof pg_query.FromExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FromExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fromlist != null && message.hasOwnProperty("fromlist")) { + if (!Array.isArray(message.fromlist)) + return "fromlist: array expected"; + for (var i = 0; i < message.fromlist.length; ++i) { + var error = $root.pg_query.Node.verify(message.fromlist[i]); + if (error) + return "fromlist." + error; + } + } + if (message.quals != null && message.hasOwnProperty("quals")) { + var error = $root.pg_query.Node.verify(message.quals); + if (error) + return "quals." + error; + } + return null; + }; + + /** + * Creates a FromExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.FromExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.FromExpr} FromExpr + */ + FromExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.FromExpr) + return object; + var message = new $root.pg_query.FromExpr(); + if (object.fromlist) { + if (!Array.isArray(object.fromlist)) + throw TypeError(".pg_query.FromExpr.fromlist: array expected"); + message.fromlist = []; + for (var i = 0; i < object.fromlist.length; ++i) { + if (typeof object.fromlist[i] !== "object") + throw TypeError(".pg_query.FromExpr.fromlist: object expected"); + message.fromlist[i] = $root.pg_query.Node.fromObject(object.fromlist[i]); + } + } + if (object.quals != null) { + if (typeof object.quals !== "object") + throw TypeError(".pg_query.FromExpr.quals: object expected"); + message.quals = $root.pg_query.Node.fromObject(object.quals); + } + return message; + }; + + /** + * Creates a plain object from a FromExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.FromExpr + * @static + * @param {pg_query.FromExpr} message FromExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FromExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fromlist = []; + if (options.defaults) + object.quals = null; + if (message.fromlist && message.fromlist.length) { + object.fromlist = []; + for (var j = 0; j < message.fromlist.length; ++j) + object.fromlist[j] = $root.pg_query.Node.toObject(message.fromlist[j], options); + } + if (message.quals != null && message.hasOwnProperty("quals")) + object.quals = $root.pg_query.Node.toObject(message.quals, options); + return object; + }; + + /** + * Converts this FromExpr to JSON. + * @function toJSON + * @memberof pg_query.FromExpr + * @instance + * @returns {Object.} JSON object + */ + FromExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FromExpr + * @function getTypeUrl + * @memberof pg_query.FromExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FromExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.FromExpr"; + }; + + return FromExpr; + })(); + + pg_query.OnConflictExpr = (function() { + + /** + * Properties of an OnConflictExpr. + * @memberof pg_query + * @interface IOnConflictExpr + * @property {pg_query.OnConflictAction|null} [action] OnConflictExpr action + * @property {Array.|null} [arbiterElems] OnConflictExpr arbiterElems + * @property {pg_query.INode|null} [arbiterWhere] OnConflictExpr arbiterWhere + * @property {number|null} [constraint] OnConflictExpr constraint + * @property {Array.|null} [onConflictSet] OnConflictExpr onConflictSet + * @property {pg_query.INode|null} [onConflictWhere] OnConflictExpr onConflictWhere + * @property {number|null} [exclRelIndex] OnConflictExpr exclRelIndex + * @property {Array.|null} [exclRelTlist] OnConflictExpr exclRelTlist + */ + + /** + * Constructs a new OnConflictExpr. + * @memberof pg_query + * @classdesc Represents an OnConflictExpr. + * @implements IOnConflictExpr + * @constructor + * @param {pg_query.IOnConflictExpr=} [properties] Properties to set + */ + function OnConflictExpr(properties) { + this.arbiterElems = []; + this.onConflictSet = []; + this.exclRelTlist = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OnConflictExpr action. + * @member {pg_query.OnConflictAction} action + * @memberof pg_query.OnConflictExpr + * @instance + */ + OnConflictExpr.prototype.action = 0; + + /** + * OnConflictExpr arbiterElems. + * @member {Array.} arbiterElems + * @memberof pg_query.OnConflictExpr + * @instance + */ + OnConflictExpr.prototype.arbiterElems = $util.emptyArray; + + /** + * OnConflictExpr arbiterWhere. + * @member {pg_query.INode|null|undefined} arbiterWhere + * @memberof pg_query.OnConflictExpr + * @instance + */ + OnConflictExpr.prototype.arbiterWhere = null; + + /** + * OnConflictExpr constraint. + * @member {number} constraint + * @memberof pg_query.OnConflictExpr + * @instance + */ + OnConflictExpr.prototype.constraint = 0; + + /** + * OnConflictExpr onConflictSet. + * @member {Array.} onConflictSet + * @memberof pg_query.OnConflictExpr + * @instance + */ + OnConflictExpr.prototype.onConflictSet = $util.emptyArray; + + /** + * OnConflictExpr onConflictWhere. + * @member {pg_query.INode|null|undefined} onConflictWhere + * @memberof pg_query.OnConflictExpr + * @instance + */ + OnConflictExpr.prototype.onConflictWhere = null; + + /** + * OnConflictExpr exclRelIndex. + * @member {number} exclRelIndex + * @memberof pg_query.OnConflictExpr + * @instance + */ + OnConflictExpr.prototype.exclRelIndex = 0; + + /** + * OnConflictExpr exclRelTlist. + * @member {Array.} exclRelTlist + * @memberof pg_query.OnConflictExpr + * @instance + */ + OnConflictExpr.prototype.exclRelTlist = $util.emptyArray; + + /** + * Creates a new OnConflictExpr instance using the specified properties. + * @function create + * @memberof pg_query.OnConflictExpr + * @static + * @param {pg_query.IOnConflictExpr=} [properties] Properties to set + * @returns {pg_query.OnConflictExpr} OnConflictExpr instance + */ + OnConflictExpr.create = function create(properties) { + return new OnConflictExpr(properties); + }; + + /** + * Encodes the specified OnConflictExpr message. Does not implicitly {@link pg_query.OnConflictExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.OnConflictExpr + * @static + * @param {pg_query.IOnConflictExpr} message OnConflictExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnConflictExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.arbiterElems != null && message.arbiterElems.length) + for (var i = 0; i < message.arbiterElems.length; ++i) + $root.pg_query.Node.encode(message.arbiterElems[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.arbiterWhere != null && Object.hasOwnProperty.call(message, "arbiterWhere")) + $root.pg_query.Node.encode(message.arbiterWhere, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.constraint != null && Object.hasOwnProperty.call(message, "constraint")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.constraint); + if (message.onConflictSet != null && message.onConflictSet.length) + for (var i = 0; i < message.onConflictSet.length; ++i) + $root.pg_query.Node.encode(message.onConflictSet[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.onConflictWhere != null && Object.hasOwnProperty.call(message, "onConflictWhere")) + $root.pg_query.Node.encode(message.onConflictWhere, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.exclRelIndex != null && Object.hasOwnProperty.call(message, "exclRelIndex")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.exclRelIndex); + if (message.exclRelTlist != null && message.exclRelTlist.length) + for (var i = 0; i < message.exclRelTlist.length; ++i) + $root.pg_query.Node.encode(message.exclRelTlist[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OnConflictExpr message, length delimited. Does not implicitly {@link pg_query.OnConflictExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.OnConflictExpr + * @static + * @param {pg_query.IOnConflictExpr} message OnConflictExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnConflictExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OnConflictExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.OnConflictExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.OnConflictExpr} OnConflictExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnConflictExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.OnConflictExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + if (!(message.arbiterElems && message.arbiterElems.length)) + message.arbiterElems = []; + message.arbiterElems.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.arbiterWhere = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.constraint = reader.uint32(); + break; + } + case 5: { + if (!(message.onConflictSet && message.onConflictSet.length)) + message.onConflictSet = []; + message.onConflictSet.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.onConflictWhere = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 7: { + message.exclRelIndex = reader.int32(); + break; + } + case 8: { + if (!(message.exclRelTlist && message.exclRelTlist.length)) + message.exclRelTlist = []; + message.exclRelTlist.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OnConflictExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.OnConflictExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.OnConflictExpr} OnConflictExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnConflictExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OnConflictExpr message. + * @function verify + * @memberof pg_query.OnConflictExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnConflictExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.arbiterElems != null && message.hasOwnProperty("arbiterElems")) { + if (!Array.isArray(message.arbiterElems)) + return "arbiterElems: array expected"; + for (var i = 0; i < message.arbiterElems.length; ++i) { + var error = $root.pg_query.Node.verify(message.arbiterElems[i]); + if (error) + return "arbiterElems." + error; + } + } + if (message.arbiterWhere != null && message.hasOwnProperty("arbiterWhere")) { + var error = $root.pg_query.Node.verify(message.arbiterWhere); + if (error) + return "arbiterWhere." + error; + } + if (message.constraint != null && message.hasOwnProperty("constraint")) + if (!$util.isInteger(message.constraint)) + return "constraint: integer expected"; + if (message.onConflictSet != null && message.hasOwnProperty("onConflictSet")) { + if (!Array.isArray(message.onConflictSet)) + return "onConflictSet: array expected"; + for (var i = 0; i < message.onConflictSet.length; ++i) { + var error = $root.pg_query.Node.verify(message.onConflictSet[i]); + if (error) + return "onConflictSet." + error; + } + } + if (message.onConflictWhere != null && message.hasOwnProperty("onConflictWhere")) { + var error = $root.pg_query.Node.verify(message.onConflictWhere); + if (error) + return "onConflictWhere." + error; + } + if (message.exclRelIndex != null && message.hasOwnProperty("exclRelIndex")) + if (!$util.isInteger(message.exclRelIndex)) + return "exclRelIndex: integer expected"; + if (message.exclRelTlist != null && message.hasOwnProperty("exclRelTlist")) { + if (!Array.isArray(message.exclRelTlist)) + return "exclRelTlist: array expected"; + for (var i = 0; i < message.exclRelTlist.length; ++i) { + var error = $root.pg_query.Node.verify(message.exclRelTlist[i]); + if (error) + return "exclRelTlist." + error; + } + } + return null; + }; + + /** + * Creates an OnConflictExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.OnConflictExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.OnConflictExpr} OnConflictExpr + */ + OnConflictExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.OnConflictExpr) + return object; + var message = new $root.pg_query.OnConflictExpr(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ON_CONFLICT_ACTION_UNDEFINED": + case 0: + message.action = 0; + break; + case "ONCONFLICT_NONE": + case 1: + message.action = 1; + break; + case "ONCONFLICT_NOTHING": + case 2: + message.action = 2; + break; + case "ONCONFLICT_UPDATE": + case 3: + message.action = 3; + break; + } + if (object.arbiterElems) { + if (!Array.isArray(object.arbiterElems)) + throw TypeError(".pg_query.OnConflictExpr.arbiterElems: array expected"); + message.arbiterElems = []; + for (var i = 0; i < object.arbiterElems.length; ++i) { + if (typeof object.arbiterElems[i] !== "object") + throw TypeError(".pg_query.OnConflictExpr.arbiterElems: object expected"); + message.arbiterElems[i] = $root.pg_query.Node.fromObject(object.arbiterElems[i]); + } + } + if (object.arbiterWhere != null) { + if (typeof object.arbiterWhere !== "object") + throw TypeError(".pg_query.OnConflictExpr.arbiterWhere: object expected"); + message.arbiterWhere = $root.pg_query.Node.fromObject(object.arbiterWhere); + } + if (object.constraint != null) + message.constraint = object.constraint >>> 0; + if (object.onConflictSet) { + if (!Array.isArray(object.onConflictSet)) + throw TypeError(".pg_query.OnConflictExpr.onConflictSet: array expected"); + message.onConflictSet = []; + for (var i = 0; i < object.onConflictSet.length; ++i) { + if (typeof object.onConflictSet[i] !== "object") + throw TypeError(".pg_query.OnConflictExpr.onConflictSet: object expected"); + message.onConflictSet[i] = $root.pg_query.Node.fromObject(object.onConflictSet[i]); + } + } + if (object.onConflictWhere != null) { + if (typeof object.onConflictWhere !== "object") + throw TypeError(".pg_query.OnConflictExpr.onConflictWhere: object expected"); + message.onConflictWhere = $root.pg_query.Node.fromObject(object.onConflictWhere); + } + if (object.exclRelIndex != null) + message.exclRelIndex = object.exclRelIndex | 0; + if (object.exclRelTlist) { + if (!Array.isArray(object.exclRelTlist)) + throw TypeError(".pg_query.OnConflictExpr.exclRelTlist: array expected"); + message.exclRelTlist = []; + for (var i = 0; i < object.exclRelTlist.length; ++i) { + if (typeof object.exclRelTlist[i] !== "object") + throw TypeError(".pg_query.OnConflictExpr.exclRelTlist: object expected"); + message.exclRelTlist[i] = $root.pg_query.Node.fromObject(object.exclRelTlist[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OnConflictExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.OnConflictExpr + * @static + * @param {pg_query.OnConflictExpr} message OnConflictExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnConflictExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.arbiterElems = []; + object.onConflictSet = []; + object.exclRelTlist = []; + } + if (options.defaults) { + object.action = options.enums === String ? "ON_CONFLICT_ACTION_UNDEFINED" : 0; + object.arbiterWhere = null; + object.constraint = 0; + object.onConflictWhere = null; + object.exclRelIndex = 0; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.pg_query.OnConflictAction[message.action] === undefined ? message.action : $root.pg_query.OnConflictAction[message.action] : message.action; + if (message.arbiterElems && message.arbiterElems.length) { + object.arbiterElems = []; + for (var j = 0; j < message.arbiterElems.length; ++j) + object.arbiterElems[j] = $root.pg_query.Node.toObject(message.arbiterElems[j], options); + } + if (message.arbiterWhere != null && message.hasOwnProperty("arbiterWhere")) + object.arbiterWhere = $root.pg_query.Node.toObject(message.arbiterWhere, options); + if (message.constraint != null && message.hasOwnProperty("constraint")) + object.constraint = message.constraint; + if (message.onConflictSet && message.onConflictSet.length) { + object.onConflictSet = []; + for (var j = 0; j < message.onConflictSet.length; ++j) + object.onConflictSet[j] = $root.pg_query.Node.toObject(message.onConflictSet[j], options); + } + if (message.onConflictWhere != null && message.hasOwnProperty("onConflictWhere")) + object.onConflictWhere = $root.pg_query.Node.toObject(message.onConflictWhere, options); + if (message.exclRelIndex != null && message.hasOwnProperty("exclRelIndex")) + object.exclRelIndex = message.exclRelIndex; + if (message.exclRelTlist && message.exclRelTlist.length) { + object.exclRelTlist = []; + for (var j = 0; j < message.exclRelTlist.length; ++j) + object.exclRelTlist[j] = $root.pg_query.Node.toObject(message.exclRelTlist[j], options); + } + return object; + }; + + /** + * Converts this OnConflictExpr to JSON. + * @function toJSON + * @memberof pg_query.OnConflictExpr + * @instance + * @returns {Object.} JSON object + */ + OnConflictExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OnConflictExpr + * @function getTypeUrl + * @memberof pg_query.OnConflictExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnConflictExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.OnConflictExpr"; + }; + + return OnConflictExpr; + })(); + + pg_query.IntoClause = (function() { + + /** + * Properties of an IntoClause. + * @memberof pg_query + * @interface IIntoClause + * @property {pg_query.IRangeVar|null} [rel] IntoClause rel + * @property {Array.|null} [colNames] IntoClause colNames + * @property {string|null} [accessMethod] IntoClause accessMethod + * @property {Array.|null} [options] IntoClause options + * @property {pg_query.OnCommitAction|null} [onCommit] IntoClause onCommit + * @property {string|null} [tableSpaceName] IntoClause tableSpaceName + * @property {pg_query.INode|null} [viewQuery] IntoClause viewQuery + * @property {boolean|null} [skipData] IntoClause skipData + */ + + /** + * Constructs a new IntoClause. + * @memberof pg_query + * @classdesc Represents an IntoClause. + * @implements IIntoClause + * @constructor + * @param {pg_query.IIntoClause=} [properties] Properties to set + */ + function IntoClause(properties) { + this.colNames = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntoClause rel. + * @member {pg_query.IRangeVar|null|undefined} rel + * @memberof pg_query.IntoClause + * @instance + */ + IntoClause.prototype.rel = null; + + /** + * IntoClause colNames. + * @member {Array.} colNames + * @memberof pg_query.IntoClause + * @instance + */ + IntoClause.prototype.colNames = $util.emptyArray; + + /** + * IntoClause accessMethod. + * @member {string} accessMethod + * @memberof pg_query.IntoClause + * @instance + */ + IntoClause.prototype.accessMethod = ""; + + /** + * IntoClause options. + * @member {Array.} options + * @memberof pg_query.IntoClause + * @instance + */ + IntoClause.prototype.options = $util.emptyArray; + + /** + * IntoClause onCommit. + * @member {pg_query.OnCommitAction} onCommit + * @memberof pg_query.IntoClause + * @instance + */ + IntoClause.prototype.onCommit = 0; + + /** + * IntoClause tableSpaceName. + * @member {string} tableSpaceName + * @memberof pg_query.IntoClause + * @instance + */ + IntoClause.prototype.tableSpaceName = ""; + + /** + * IntoClause viewQuery. + * @member {pg_query.INode|null|undefined} viewQuery + * @memberof pg_query.IntoClause + * @instance + */ + IntoClause.prototype.viewQuery = null; + + /** + * IntoClause skipData. + * @member {boolean} skipData + * @memberof pg_query.IntoClause + * @instance + */ + IntoClause.prototype.skipData = false; + + /** + * Creates a new IntoClause instance using the specified properties. + * @function create + * @memberof pg_query.IntoClause + * @static + * @param {pg_query.IIntoClause=} [properties] Properties to set + * @returns {pg_query.IntoClause} IntoClause instance + */ + IntoClause.create = function create(properties) { + return new IntoClause(properties); + }; + + /** + * Encodes the specified IntoClause message. Does not implicitly {@link pg_query.IntoClause.verify|verify} messages. + * @function encode + * @memberof pg_query.IntoClause + * @static + * @param {pg_query.IIntoClause} message IntoClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntoClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rel != null && Object.hasOwnProperty.call(message, "rel")) + $root.pg_query.RangeVar.encode(message.rel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.colNames != null && message.colNames.length) + for (var i = 0; i < message.colNames.length; ++i) + $root.pg_query.Node.encode(message.colNames[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.accessMethod != null && Object.hasOwnProperty.call(message, "accessMethod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.accessMethod); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.onCommit != null && Object.hasOwnProperty.call(message, "onCommit")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.onCommit); + if (message.tableSpaceName != null && Object.hasOwnProperty.call(message, "tableSpaceName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.tableSpaceName); + if (message.viewQuery != null && Object.hasOwnProperty.call(message, "viewQuery")) + $root.pg_query.Node.encode(message.viewQuery, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.skipData != null && Object.hasOwnProperty.call(message, "skipData")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.skipData); + return writer; + }; + + /** + * Encodes the specified IntoClause message, length delimited. Does not implicitly {@link pg_query.IntoClause.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.IntoClause + * @static + * @param {pg_query.IIntoClause} message IntoClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntoClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntoClause message from the specified reader or buffer. + * @function decode + * @memberof pg_query.IntoClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.IntoClause} IntoClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntoClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.IntoClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rel = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.colNames && message.colNames.length)) + message.colNames = []; + message.colNames.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.accessMethod = reader.string(); + break; + } + case 4: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.onCommit = reader.int32(); + break; + } + case 6: { + message.tableSpaceName = reader.string(); + break; + } + case 7: { + message.viewQuery = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 8: { + message.skipData = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IntoClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.IntoClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.IntoClause} IntoClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntoClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntoClause message. + * @function verify + * @memberof pg_query.IntoClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntoClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rel != null && message.hasOwnProperty("rel")) { + var error = $root.pg_query.RangeVar.verify(message.rel); + if (error) + return "rel." + error; + } + if (message.colNames != null && message.hasOwnProperty("colNames")) { + if (!Array.isArray(message.colNames)) + return "colNames: array expected"; + for (var i = 0; i < message.colNames.length; ++i) { + var error = $root.pg_query.Node.verify(message.colNames[i]); + if (error) + return "colNames." + error; + } + } + if (message.accessMethod != null && message.hasOwnProperty("accessMethod")) + if (!$util.isString(message.accessMethod)) + return "accessMethod: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.onCommit != null && message.hasOwnProperty("onCommit")) + switch (message.onCommit) { + default: + return "onCommit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.tableSpaceName != null && message.hasOwnProperty("tableSpaceName")) + if (!$util.isString(message.tableSpaceName)) + return "tableSpaceName: string expected"; + if (message.viewQuery != null && message.hasOwnProperty("viewQuery")) { + var error = $root.pg_query.Node.verify(message.viewQuery); + if (error) + return "viewQuery." + error; + } + if (message.skipData != null && message.hasOwnProperty("skipData")) + if (typeof message.skipData !== "boolean") + return "skipData: boolean expected"; + return null; + }; + + /** + * Creates an IntoClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.IntoClause + * @static + * @param {Object.} object Plain object + * @returns {pg_query.IntoClause} IntoClause + */ + IntoClause.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.IntoClause) + return object; + var message = new $root.pg_query.IntoClause(); + if (object.rel != null) { + if (typeof object.rel !== "object") + throw TypeError(".pg_query.IntoClause.rel: object expected"); + message.rel = $root.pg_query.RangeVar.fromObject(object.rel); + } + if (object.colNames) { + if (!Array.isArray(object.colNames)) + throw TypeError(".pg_query.IntoClause.colNames: array expected"); + message.colNames = []; + for (var i = 0; i < object.colNames.length; ++i) { + if (typeof object.colNames[i] !== "object") + throw TypeError(".pg_query.IntoClause.colNames: object expected"); + message.colNames[i] = $root.pg_query.Node.fromObject(object.colNames[i]); + } + } + if (object.accessMethod != null) + message.accessMethod = String(object.accessMethod); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.IntoClause.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.IntoClause.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + switch (object.onCommit) { + default: + if (typeof object.onCommit === "number") { + message.onCommit = object.onCommit; + break; + } + break; + case "ON_COMMIT_ACTION_UNDEFINED": + case 0: + message.onCommit = 0; + break; + case "ONCOMMIT_NOOP": + case 1: + message.onCommit = 1; + break; + case "ONCOMMIT_PRESERVE_ROWS": + case 2: + message.onCommit = 2; + break; + case "ONCOMMIT_DELETE_ROWS": + case 3: + message.onCommit = 3; + break; + case "ONCOMMIT_DROP": + case 4: + message.onCommit = 4; + break; + } + if (object.tableSpaceName != null) + message.tableSpaceName = String(object.tableSpaceName); + if (object.viewQuery != null) { + if (typeof object.viewQuery !== "object") + throw TypeError(".pg_query.IntoClause.viewQuery: object expected"); + message.viewQuery = $root.pg_query.Node.fromObject(object.viewQuery); + } + if (object.skipData != null) + message.skipData = Boolean(object.skipData); + return message; + }; + + /** + * Creates a plain object from an IntoClause message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.IntoClause + * @static + * @param {pg_query.IntoClause} message IntoClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntoClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.colNames = []; + object.options = []; + } + if (options.defaults) { + object.rel = null; + object.accessMethod = ""; + object.onCommit = options.enums === String ? "ON_COMMIT_ACTION_UNDEFINED" : 0; + object.tableSpaceName = ""; + object.viewQuery = null; + object.skipData = false; + } + if (message.rel != null && message.hasOwnProperty("rel")) + object.rel = $root.pg_query.RangeVar.toObject(message.rel, options); + if (message.colNames && message.colNames.length) { + object.colNames = []; + for (var j = 0; j < message.colNames.length; ++j) + object.colNames[j] = $root.pg_query.Node.toObject(message.colNames[j], options); + } + if (message.accessMethod != null && message.hasOwnProperty("accessMethod")) + object.accessMethod = message.accessMethod; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.onCommit != null && message.hasOwnProperty("onCommit")) + object.onCommit = options.enums === String ? $root.pg_query.OnCommitAction[message.onCommit] === undefined ? message.onCommit : $root.pg_query.OnCommitAction[message.onCommit] : message.onCommit; + if (message.tableSpaceName != null && message.hasOwnProperty("tableSpaceName")) + object.tableSpaceName = message.tableSpaceName; + if (message.viewQuery != null && message.hasOwnProperty("viewQuery")) + object.viewQuery = $root.pg_query.Node.toObject(message.viewQuery, options); + if (message.skipData != null && message.hasOwnProperty("skipData")) + object.skipData = message.skipData; + return object; + }; + + /** + * Converts this IntoClause to JSON. + * @function toJSON + * @memberof pg_query.IntoClause + * @instance + * @returns {Object.} JSON object + */ + IntoClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IntoClause + * @function getTypeUrl + * @memberof pg_query.IntoClause + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IntoClause.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.IntoClause"; + }; + + return IntoClause; + })(); + + pg_query.RawStmt = (function() { + + /** + * Properties of a RawStmt. + * @memberof pg_query + * @interface IRawStmt + * @property {pg_query.INode|null} [stmt] RawStmt stmt + * @property {number|null} [stmt_location] RawStmt stmt_location + * @property {number|null} [stmt_len] RawStmt stmt_len + */ + + /** + * Constructs a new RawStmt. + * @memberof pg_query + * @classdesc Represents a RawStmt. + * @implements IRawStmt + * @constructor + * @param {pg_query.IRawStmt=} [properties] Properties to set + */ + function RawStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RawStmt stmt. + * @member {pg_query.INode|null|undefined} stmt + * @memberof pg_query.RawStmt + * @instance + */ + RawStmt.prototype.stmt = null; + + /** + * RawStmt stmt_location. + * @member {number} stmt_location + * @memberof pg_query.RawStmt + * @instance + */ + RawStmt.prototype.stmt_location = 0; + + /** + * RawStmt stmt_len. + * @member {number} stmt_len + * @memberof pg_query.RawStmt + * @instance + */ + RawStmt.prototype.stmt_len = 0; + + /** + * Creates a new RawStmt instance using the specified properties. + * @function create + * @memberof pg_query.RawStmt + * @static + * @param {pg_query.IRawStmt=} [properties] Properties to set + * @returns {pg_query.RawStmt} RawStmt instance + */ + RawStmt.create = function create(properties) { + return new RawStmt(properties); + }; + + /** + * Encodes the specified RawStmt message. Does not implicitly {@link pg_query.RawStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.RawStmt + * @static + * @param {pg_query.IRawStmt} message RawStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stmt != null && Object.hasOwnProperty.call(message, "stmt")) + $root.pg_query.Node.encode(message.stmt, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stmt_location != null && Object.hasOwnProperty.call(message, "stmt_location")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stmt_location); + if (message.stmt_len != null && Object.hasOwnProperty.call(message, "stmt_len")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.stmt_len); + return writer; + }; + + /** + * Encodes the specified RawStmt message, length delimited. Does not implicitly {@link pg_query.RawStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RawStmt + * @static + * @param {pg_query.IRawStmt} message RawStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RawStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RawStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RawStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RawStmt} RawStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RawStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.stmt = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.stmt_location = reader.int32(); + break; + } + case 3: { + message.stmt_len = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RawStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RawStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RawStmt} RawStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RawStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RawStmt message. + * @function verify + * @memberof pg_query.RawStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RawStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stmt != null && message.hasOwnProperty("stmt")) { + var error = $root.pg_query.Node.verify(message.stmt); + if (error) + return "stmt." + error; + } + if (message.stmt_location != null && message.hasOwnProperty("stmt_location")) + if (!$util.isInteger(message.stmt_location)) + return "stmt_location: integer expected"; + if (message.stmt_len != null && message.hasOwnProperty("stmt_len")) + if (!$util.isInteger(message.stmt_len)) + return "stmt_len: integer expected"; + return null; + }; + + /** + * Creates a RawStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RawStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RawStmt} RawStmt + */ + RawStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RawStmt) + return object; + var message = new $root.pg_query.RawStmt(); + if (object.stmt != null) { + if (typeof object.stmt !== "object") + throw TypeError(".pg_query.RawStmt.stmt: object expected"); + message.stmt = $root.pg_query.Node.fromObject(object.stmt); + } + if (object.stmt_location != null) + message.stmt_location = object.stmt_location | 0; + if (object.stmt_len != null) + message.stmt_len = object.stmt_len | 0; + return message; + }; + + /** + * Creates a plain object from a RawStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RawStmt + * @static + * @param {pg_query.RawStmt} message RawStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RawStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stmt = null; + object.stmt_location = 0; + object.stmt_len = 0; + } + if (message.stmt != null && message.hasOwnProperty("stmt")) + object.stmt = $root.pg_query.Node.toObject(message.stmt, options); + if (message.stmt_location != null && message.hasOwnProperty("stmt_location")) + object.stmt_location = message.stmt_location; + if (message.stmt_len != null && message.hasOwnProperty("stmt_len")) + object.stmt_len = message.stmt_len; + return object; + }; + + /** + * Converts this RawStmt to JSON. + * @function toJSON + * @memberof pg_query.RawStmt + * @instance + * @returns {Object.} JSON object + */ + RawStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RawStmt + * @function getTypeUrl + * @memberof pg_query.RawStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RawStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RawStmt"; + }; + + return RawStmt; + })(); + + pg_query.Query = (function() { + + /** + * Properties of a Query. + * @memberof pg_query + * @interface IQuery + * @property {pg_query.CmdType|null} [commandType] Query commandType + * @property {pg_query.QuerySource|null} [querySource] Query querySource + * @property {boolean|null} [canSetTag] Query canSetTag + * @property {pg_query.INode|null} [utilityStmt] Query utilityStmt + * @property {number|null} [resultRelation] Query resultRelation + * @property {boolean|null} [hasAggs] Query hasAggs + * @property {boolean|null} [hasWindowFuncs] Query hasWindowFuncs + * @property {boolean|null} [hasTargetSRFs] Query hasTargetSRFs + * @property {boolean|null} [hasSubLinks] Query hasSubLinks + * @property {boolean|null} [hasDistinctOn] Query hasDistinctOn + * @property {boolean|null} [hasRecursive] Query hasRecursive + * @property {boolean|null} [hasModifyingCTE] Query hasModifyingCTE + * @property {boolean|null} [hasForUpdate] Query hasForUpdate + * @property {boolean|null} [hasRowSecurity] Query hasRowSecurity + * @property {Array.|null} [cteList] Query cteList + * @property {Array.|null} [rtable] Query rtable + * @property {pg_query.IFromExpr|null} [jointree] Query jointree + * @property {Array.|null} [targetList] Query targetList + * @property {pg_query.OverridingKind|null} [override] Query override + * @property {pg_query.IOnConflictExpr|null} [onConflict] Query onConflict + * @property {Array.|null} [returningList] Query returningList + * @property {Array.|null} [groupClause] Query groupClause + * @property {Array.|null} [groupingSets] Query groupingSets + * @property {pg_query.INode|null} [havingQual] Query havingQual + * @property {Array.|null} [windowClause] Query windowClause + * @property {Array.|null} [distinctClause] Query distinctClause + * @property {Array.|null} [sortClause] Query sortClause + * @property {pg_query.INode|null} [limitOffset] Query limitOffset + * @property {pg_query.INode|null} [limitCount] Query limitCount + * @property {pg_query.LimitOption|null} [limitOption] Query limitOption + * @property {Array.|null} [rowMarks] Query rowMarks + * @property {pg_query.INode|null} [setOperations] Query setOperations + * @property {Array.|null} [constraintDeps] Query constraintDeps + * @property {Array.|null} [withCheckOptions] Query withCheckOptions + * @property {number|null} [stmt_location] Query stmt_location + * @property {number|null} [stmt_len] Query stmt_len + */ + + /** + * Constructs a new Query. + * @memberof pg_query + * @classdesc Represents a Query. + * @implements IQuery + * @constructor + * @param {pg_query.IQuery=} [properties] Properties to set + */ + function Query(properties) { + this.cteList = []; + this.rtable = []; + this.targetList = []; + this.returningList = []; + this.groupClause = []; + this.groupingSets = []; + this.windowClause = []; + this.distinctClause = []; + this.sortClause = []; + this.rowMarks = []; + this.constraintDeps = []; + this.withCheckOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Query commandType. + * @member {pg_query.CmdType} commandType + * @memberof pg_query.Query + * @instance + */ + Query.prototype.commandType = 0; + + /** + * Query querySource. + * @member {pg_query.QuerySource} querySource + * @memberof pg_query.Query + * @instance + */ + Query.prototype.querySource = 0; + + /** + * Query canSetTag. + * @member {boolean} canSetTag + * @memberof pg_query.Query + * @instance + */ + Query.prototype.canSetTag = false; + + /** + * Query utilityStmt. + * @member {pg_query.INode|null|undefined} utilityStmt + * @memberof pg_query.Query + * @instance + */ + Query.prototype.utilityStmt = null; + + /** + * Query resultRelation. + * @member {number} resultRelation + * @memberof pg_query.Query + * @instance + */ + Query.prototype.resultRelation = 0; + + /** + * Query hasAggs. + * @member {boolean} hasAggs + * @memberof pg_query.Query + * @instance + */ + Query.prototype.hasAggs = false; + + /** + * Query hasWindowFuncs. + * @member {boolean} hasWindowFuncs + * @memberof pg_query.Query + * @instance + */ + Query.prototype.hasWindowFuncs = false; + + /** + * Query hasTargetSRFs. + * @member {boolean} hasTargetSRFs + * @memberof pg_query.Query + * @instance + */ + Query.prototype.hasTargetSRFs = false; + + /** + * Query hasSubLinks. + * @member {boolean} hasSubLinks + * @memberof pg_query.Query + * @instance + */ + Query.prototype.hasSubLinks = false; + + /** + * Query hasDistinctOn. + * @member {boolean} hasDistinctOn + * @memberof pg_query.Query + * @instance + */ + Query.prototype.hasDistinctOn = false; + + /** + * Query hasRecursive. + * @member {boolean} hasRecursive + * @memberof pg_query.Query + * @instance + */ + Query.prototype.hasRecursive = false; + + /** + * Query hasModifyingCTE. + * @member {boolean} hasModifyingCTE + * @memberof pg_query.Query + * @instance + */ + Query.prototype.hasModifyingCTE = false; + + /** + * Query hasForUpdate. + * @member {boolean} hasForUpdate + * @memberof pg_query.Query + * @instance + */ + Query.prototype.hasForUpdate = false; + + /** + * Query hasRowSecurity. + * @member {boolean} hasRowSecurity + * @memberof pg_query.Query + * @instance + */ + Query.prototype.hasRowSecurity = false; + + /** + * Query cteList. + * @member {Array.} cteList + * @memberof pg_query.Query + * @instance + */ + Query.prototype.cteList = $util.emptyArray; + + /** + * Query rtable. + * @member {Array.} rtable + * @memberof pg_query.Query + * @instance + */ + Query.prototype.rtable = $util.emptyArray; + + /** + * Query jointree. + * @member {pg_query.IFromExpr|null|undefined} jointree + * @memberof pg_query.Query + * @instance + */ + Query.prototype.jointree = null; + + /** + * Query targetList. + * @member {Array.} targetList + * @memberof pg_query.Query + * @instance + */ + Query.prototype.targetList = $util.emptyArray; + + /** + * Query override. + * @member {pg_query.OverridingKind} override + * @memberof pg_query.Query + * @instance + */ + Query.prototype.override = 0; + + /** + * Query onConflict. + * @member {pg_query.IOnConflictExpr|null|undefined} onConflict + * @memberof pg_query.Query + * @instance + */ + Query.prototype.onConflict = null; + + /** + * Query returningList. + * @member {Array.} returningList + * @memberof pg_query.Query + * @instance + */ + Query.prototype.returningList = $util.emptyArray; + + /** + * Query groupClause. + * @member {Array.} groupClause + * @memberof pg_query.Query + * @instance + */ + Query.prototype.groupClause = $util.emptyArray; + + /** + * Query groupingSets. + * @member {Array.} groupingSets + * @memberof pg_query.Query + * @instance + */ + Query.prototype.groupingSets = $util.emptyArray; + + /** + * Query havingQual. + * @member {pg_query.INode|null|undefined} havingQual + * @memberof pg_query.Query + * @instance + */ + Query.prototype.havingQual = null; + + /** + * Query windowClause. + * @member {Array.} windowClause + * @memberof pg_query.Query + * @instance + */ + Query.prototype.windowClause = $util.emptyArray; + + /** + * Query distinctClause. + * @member {Array.} distinctClause + * @memberof pg_query.Query + * @instance + */ + Query.prototype.distinctClause = $util.emptyArray; + + /** + * Query sortClause. + * @member {Array.} sortClause + * @memberof pg_query.Query + * @instance + */ + Query.prototype.sortClause = $util.emptyArray; + + /** + * Query limitOffset. + * @member {pg_query.INode|null|undefined} limitOffset + * @memberof pg_query.Query + * @instance + */ + Query.prototype.limitOffset = null; + + /** + * Query limitCount. + * @member {pg_query.INode|null|undefined} limitCount + * @memberof pg_query.Query + * @instance + */ + Query.prototype.limitCount = null; + + /** + * Query limitOption. + * @member {pg_query.LimitOption} limitOption + * @memberof pg_query.Query + * @instance + */ + Query.prototype.limitOption = 0; + + /** + * Query rowMarks. + * @member {Array.} rowMarks + * @memberof pg_query.Query + * @instance + */ + Query.prototype.rowMarks = $util.emptyArray; + + /** + * Query setOperations. + * @member {pg_query.INode|null|undefined} setOperations + * @memberof pg_query.Query + * @instance + */ + Query.prototype.setOperations = null; + + /** + * Query constraintDeps. + * @member {Array.} constraintDeps + * @memberof pg_query.Query + * @instance + */ + Query.prototype.constraintDeps = $util.emptyArray; + + /** + * Query withCheckOptions. + * @member {Array.} withCheckOptions + * @memberof pg_query.Query + * @instance + */ + Query.prototype.withCheckOptions = $util.emptyArray; + + /** + * Query stmt_location. + * @member {number} stmt_location + * @memberof pg_query.Query + * @instance + */ + Query.prototype.stmt_location = 0; + + /** + * Query stmt_len. + * @member {number} stmt_len + * @memberof pg_query.Query + * @instance + */ + Query.prototype.stmt_len = 0; + + /** + * Creates a new Query instance using the specified properties. + * @function create + * @memberof pg_query.Query + * @static + * @param {pg_query.IQuery=} [properties] Properties to set + * @returns {pg_query.Query} Query instance + */ + Query.create = function create(properties) { + return new Query(properties); + }; + + /** + * Encodes the specified Query message. Does not implicitly {@link pg_query.Query.verify|verify} messages. + * @function encode + * @memberof pg_query.Query + * @static + * @param {pg_query.IQuery} message Query message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Query.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.commandType != null && Object.hasOwnProperty.call(message, "commandType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.commandType); + if (message.querySource != null && Object.hasOwnProperty.call(message, "querySource")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.querySource); + if (message.canSetTag != null && Object.hasOwnProperty.call(message, "canSetTag")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.canSetTag); + if (message.utilityStmt != null && Object.hasOwnProperty.call(message, "utilityStmt")) + $root.pg_query.Node.encode(message.utilityStmt, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.resultRelation != null && Object.hasOwnProperty.call(message, "resultRelation")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.resultRelation); + if (message.hasAggs != null && Object.hasOwnProperty.call(message, "hasAggs")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.hasAggs); + if (message.hasWindowFuncs != null && Object.hasOwnProperty.call(message, "hasWindowFuncs")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.hasWindowFuncs); + if (message.hasTargetSRFs != null && Object.hasOwnProperty.call(message, "hasTargetSRFs")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.hasTargetSRFs); + if (message.hasSubLinks != null && Object.hasOwnProperty.call(message, "hasSubLinks")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.hasSubLinks); + if (message.hasDistinctOn != null && Object.hasOwnProperty.call(message, "hasDistinctOn")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.hasDistinctOn); + if (message.hasRecursive != null && Object.hasOwnProperty.call(message, "hasRecursive")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.hasRecursive); + if (message.hasModifyingCTE != null && Object.hasOwnProperty.call(message, "hasModifyingCTE")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.hasModifyingCTE); + if (message.hasForUpdate != null && Object.hasOwnProperty.call(message, "hasForUpdate")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.hasForUpdate); + if (message.hasRowSecurity != null && Object.hasOwnProperty.call(message, "hasRowSecurity")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.hasRowSecurity); + if (message.cteList != null && message.cteList.length) + for (var i = 0; i < message.cteList.length; ++i) + $root.pg_query.Node.encode(message.cteList[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.rtable != null && message.rtable.length) + for (var i = 0; i < message.rtable.length; ++i) + $root.pg_query.Node.encode(message.rtable[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.jointree != null && Object.hasOwnProperty.call(message, "jointree")) + $root.pg_query.FromExpr.encode(message.jointree, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.targetList != null && message.targetList.length) + for (var i = 0; i < message.targetList.length; ++i) + $root.pg_query.Node.encode(message.targetList[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.override != null && Object.hasOwnProperty.call(message, "override")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.override); + if (message.onConflict != null && Object.hasOwnProperty.call(message, "onConflict")) + $root.pg_query.OnConflictExpr.encode(message.onConflict, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.returningList != null && message.returningList.length) + for (var i = 0; i < message.returningList.length; ++i) + $root.pg_query.Node.encode(message.returningList[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.groupClause != null && message.groupClause.length) + for (var i = 0; i < message.groupClause.length; ++i) + $root.pg_query.Node.encode(message.groupClause[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.groupingSets != null && message.groupingSets.length) + for (var i = 0; i < message.groupingSets.length; ++i) + $root.pg_query.Node.encode(message.groupingSets[i], writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.havingQual != null && Object.hasOwnProperty.call(message, "havingQual")) + $root.pg_query.Node.encode(message.havingQual, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.windowClause != null && message.windowClause.length) + for (var i = 0; i < message.windowClause.length; ++i) + $root.pg_query.Node.encode(message.windowClause[i], writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.distinctClause != null && message.distinctClause.length) + for (var i = 0; i < message.distinctClause.length; ++i) + $root.pg_query.Node.encode(message.distinctClause[i], writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.sortClause != null && message.sortClause.length) + for (var i = 0; i < message.sortClause.length; ++i) + $root.pg_query.Node.encode(message.sortClause[i], writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.limitOffset != null && Object.hasOwnProperty.call(message, "limitOffset")) + $root.pg_query.Node.encode(message.limitOffset, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.limitCount != null && Object.hasOwnProperty.call(message, "limitCount")) + $root.pg_query.Node.encode(message.limitCount, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.limitOption != null && Object.hasOwnProperty.call(message, "limitOption")) + writer.uint32(/* id 30, wireType 0 =*/240).int32(message.limitOption); + if (message.rowMarks != null && message.rowMarks.length) + for (var i = 0; i < message.rowMarks.length; ++i) + $root.pg_query.Node.encode(message.rowMarks[i], writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.setOperations != null && Object.hasOwnProperty.call(message, "setOperations")) + $root.pg_query.Node.encode(message.setOperations, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.constraintDeps != null && message.constraintDeps.length) + for (var i = 0; i < message.constraintDeps.length; ++i) + $root.pg_query.Node.encode(message.constraintDeps[i], writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.withCheckOptions != null && message.withCheckOptions.length) + for (var i = 0; i < message.withCheckOptions.length; ++i) + $root.pg_query.Node.encode(message.withCheckOptions[i], writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.stmt_location != null && Object.hasOwnProperty.call(message, "stmt_location")) + writer.uint32(/* id 35, wireType 0 =*/280).int32(message.stmt_location); + if (message.stmt_len != null && Object.hasOwnProperty.call(message, "stmt_len")) + writer.uint32(/* id 36, wireType 0 =*/288).int32(message.stmt_len); + return writer; + }; + + /** + * Encodes the specified Query message, length delimited. Does not implicitly {@link pg_query.Query.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.Query + * @static + * @param {pg_query.IQuery} message Query message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Query.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Query message from the specified reader or buffer. + * @function decode + * @memberof pg_query.Query + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.Query} Query + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Query.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.Query(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.commandType = reader.int32(); + break; + } + case 2: { + message.querySource = reader.int32(); + break; + } + case 3: { + message.canSetTag = reader.bool(); + break; + } + case 4: { + message.utilityStmt = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + message.resultRelation = reader.int32(); + break; + } + case 6: { + message.hasAggs = reader.bool(); + break; + } + case 7: { + message.hasWindowFuncs = reader.bool(); + break; + } + case 8: { + message.hasTargetSRFs = reader.bool(); + break; + } + case 9: { + message.hasSubLinks = reader.bool(); + break; + } + case 10: { + message.hasDistinctOn = reader.bool(); + break; + } + case 11: { + message.hasRecursive = reader.bool(); + break; + } + case 12: { + message.hasModifyingCTE = reader.bool(); + break; + } + case 13: { + message.hasForUpdate = reader.bool(); + break; + } + case 14: { + message.hasRowSecurity = reader.bool(); + break; + } + case 15: { + if (!(message.cteList && message.cteList.length)) + message.cteList = []; + message.cteList.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 16: { + if (!(message.rtable && message.rtable.length)) + message.rtable = []; + message.rtable.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 17: { + message.jointree = $root.pg_query.FromExpr.decode(reader, reader.uint32()); + break; + } + case 18: { + if (!(message.targetList && message.targetList.length)) + message.targetList = []; + message.targetList.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 19: { + message.override = reader.int32(); + break; + } + case 20: { + message.onConflict = $root.pg_query.OnConflictExpr.decode(reader, reader.uint32()); + break; + } + case 21: { + if (!(message.returningList && message.returningList.length)) + message.returningList = []; + message.returningList.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 22: { + if (!(message.groupClause && message.groupClause.length)) + message.groupClause = []; + message.groupClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 23: { + if (!(message.groupingSets && message.groupingSets.length)) + message.groupingSets = []; + message.groupingSets.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 24: { + message.havingQual = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 25: { + if (!(message.windowClause && message.windowClause.length)) + message.windowClause = []; + message.windowClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 26: { + if (!(message.distinctClause && message.distinctClause.length)) + message.distinctClause = []; + message.distinctClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 27: { + if (!(message.sortClause && message.sortClause.length)) + message.sortClause = []; + message.sortClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 28: { + message.limitOffset = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 29: { + message.limitCount = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 30: { + message.limitOption = reader.int32(); + break; + } + case 31: { + if (!(message.rowMarks && message.rowMarks.length)) + message.rowMarks = []; + message.rowMarks.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 32: { + message.setOperations = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 33: { + if (!(message.constraintDeps && message.constraintDeps.length)) + message.constraintDeps = []; + message.constraintDeps.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 34: { + if (!(message.withCheckOptions && message.withCheckOptions.length)) + message.withCheckOptions = []; + message.withCheckOptions.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 35: { + message.stmt_location = reader.int32(); + break; + } + case 36: { + message.stmt_len = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Query message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.Query + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.Query} Query + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Query.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Query message. + * @function verify + * @memberof pg_query.Query + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Query.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.commandType != null && message.hasOwnProperty("commandType")) + switch (message.commandType) { + default: + return "commandType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.querySource != null && message.hasOwnProperty("querySource")) + switch (message.querySource) { + default: + return "querySource: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.canSetTag != null && message.hasOwnProperty("canSetTag")) + if (typeof message.canSetTag !== "boolean") + return "canSetTag: boolean expected"; + if (message.utilityStmt != null && message.hasOwnProperty("utilityStmt")) { + var error = $root.pg_query.Node.verify(message.utilityStmt); + if (error) + return "utilityStmt." + error; + } + if (message.resultRelation != null && message.hasOwnProperty("resultRelation")) + if (!$util.isInteger(message.resultRelation)) + return "resultRelation: integer expected"; + if (message.hasAggs != null && message.hasOwnProperty("hasAggs")) + if (typeof message.hasAggs !== "boolean") + return "hasAggs: boolean expected"; + if (message.hasWindowFuncs != null && message.hasOwnProperty("hasWindowFuncs")) + if (typeof message.hasWindowFuncs !== "boolean") + return "hasWindowFuncs: boolean expected"; + if (message.hasTargetSRFs != null && message.hasOwnProperty("hasTargetSRFs")) + if (typeof message.hasTargetSRFs !== "boolean") + return "hasTargetSRFs: boolean expected"; + if (message.hasSubLinks != null && message.hasOwnProperty("hasSubLinks")) + if (typeof message.hasSubLinks !== "boolean") + return "hasSubLinks: boolean expected"; + if (message.hasDistinctOn != null && message.hasOwnProperty("hasDistinctOn")) + if (typeof message.hasDistinctOn !== "boolean") + return "hasDistinctOn: boolean expected"; + if (message.hasRecursive != null && message.hasOwnProperty("hasRecursive")) + if (typeof message.hasRecursive !== "boolean") + return "hasRecursive: boolean expected"; + if (message.hasModifyingCTE != null && message.hasOwnProperty("hasModifyingCTE")) + if (typeof message.hasModifyingCTE !== "boolean") + return "hasModifyingCTE: boolean expected"; + if (message.hasForUpdate != null && message.hasOwnProperty("hasForUpdate")) + if (typeof message.hasForUpdate !== "boolean") + return "hasForUpdate: boolean expected"; + if (message.hasRowSecurity != null && message.hasOwnProperty("hasRowSecurity")) + if (typeof message.hasRowSecurity !== "boolean") + return "hasRowSecurity: boolean expected"; + if (message.cteList != null && message.hasOwnProperty("cteList")) { + if (!Array.isArray(message.cteList)) + return "cteList: array expected"; + for (var i = 0; i < message.cteList.length; ++i) { + var error = $root.pg_query.Node.verify(message.cteList[i]); + if (error) + return "cteList." + error; + } + } + if (message.rtable != null && message.hasOwnProperty("rtable")) { + if (!Array.isArray(message.rtable)) + return "rtable: array expected"; + for (var i = 0; i < message.rtable.length; ++i) { + var error = $root.pg_query.Node.verify(message.rtable[i]); + if (error) + return "rtable." + error; + } + } + if (message.jointree != null && message.hasOwnProperty("jointree")) { + var error = $root.pg_query.FromExpr.verify(message.jointree); + if (error) + return "jointree." + error; + } + if (message.targetList != null && message.hasOwnProperty("targetList")) { + if (!Array.isArray(message.targetList)) + return "targetList: array expected"; + for (var i = 0; i < message.targetList.length; ++i) { + var error = $root.pg_query.Node.verify(message.targetList[i]); + if (error) + return "targetList." + error; + } + } + if (message.override != null && message.hasOwnProperty("override")) + switch (message.override) { + default: + return "override: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.onConflict != null && message.hasOwnProperty("onConflict")) { + var error = $root.pg_query.OnConflictExpr.verify(message.onConflict); + if (error) + return "onConflict." + error; + } + if (message.returningList != null && message.hasOwnProperty("returningList")) { + if (!Array.isArray(message.returningList)) + return "returningList: array expected"; + for (var i = 0; i < message.returningList.length; ++i) { + var error = $root.pg_query.Node.verify(message.returningList[i]); + if (error) + return "returningList." + error; + } + } + if (message.groupClause != null && message.hasOwnProperty("groupClause")) { + if (!Array.isArray(message.groupClause)) + return "groupClause: array expected"; + for (var i = 0; i < message.groupClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.groupClause[i]); + if (error) + return "groupClause." + error; + } + } + if (message.groupingSets != null && message.hasOwnProperty("groupingSets")) { + if (!Array.isArray(message.groupingSets)) + return "groupingSets: array expected"; + for (var i = 0; i < message.groupingSets.length; ++i) { + var error = $root.pg_query.Node.verify(message.groupingSets[i]); + if (error) + return "groupingSets." + error; + } + } + if (message.havingQual != null && message.hasOwnProperty("havingQual")) { + var error = $root.pg_query.Node.verify(message.havingQual); + if (error) + return "havingQual." + error; + } + if (message.windowClause != null && message.hasOwnProperty("windowClause")) { + if (!Array.isArray(message.windowClause)) + return "windowClause: array expected"; + for (var i = 0; i < message.windowClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.windowClause[i]); + if (error) + return "windowClause." + error; + } + } + if (message.distinctClause != null && message.hasOwnProperty("distinctClause")) { + if (!Array.isArray(message.distinctClause)) + return "distinctClause: array expected"; + for (var i = 0; i < message.distinctClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.distinctClause[i]); + if (error) + return "distinctClause." + error; + } + } + if (message.sortClause != null && message.hasOwnProperty("sortClause")) { + if (!Array.isArray(message.sortClause)) + return "sortClause: array expected"; + for (var i = 0; i < message.sortClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.sortClause[i]); + if (error) + return "sortClause." + error; + } + } + if (message.limitOffset != null && message.hasOwnProperty("limitOffset")) { + var error = $root.pg_query.Node.verify(message.limitOffset); + if (error) + return "limitOffset." + error; + } + if (message.limitCount != null && message.hasOwnProperty("limitCount")) { + var error = $root.pg_query.Node.verify(message.limitCount); + if (error) + return "limitCount." + error; + } + if (message.limitOption != null && message.hasOwnProperty("limitOption")) + switch (message.limitOption) { + default: + return "limitOption: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.rowMarks != null && message.hasOwnProperty("rowMarks")) { + if (!Array.isArray(message.rowMarks)) + return "rowMarks: array expected"; + for (var i = 0; i < message.rowMarks.length; ++i) { + var error = $root.pg_query.Node.verify(message.rowMarks[i]); + if (error) + return "rowMarks." + error; + } + } + if (message.setOperations != null && message.hasOwnProperty("setOperations")) { + var error = $root.pg_query.Node.verify(message.setOperations); + if (error) + return "setOperations." + error; + } + if (message.constraintDeps != null && message.hasOwnProperty("constraintDeps")) { + if (!Array.isArray(message.constraintDeps)) + return "constraintDeps: array expected"; + for (var i = 0; i < message.constraintDeps.length; ++i) { + var error = $root.pg_query.Node.verify(message.constraintDeps[i]); + if (error) + return "constraintDeps." + error; + } + } + if (message.withCheckOptions != null && message.hasOwnProperty("withCheckOptions")) { + if (!Array.isArray(message.withCheckOptions)) + return "withCheckOptions: array expected"; + for (var i = 0; i < message.withCheckOptions.length; ++i) { + var error = $root.pg_query.Node.verify(message.withCheckOptions[i]); + if (error) + return "withCheckOptions." + error; + } + } + if (message.stmt_location != null && message.hasOwnProperty("stmt_location")) + if (!$util.isInteger(message.stmt_location)) + return "stmt_location: integer expected"; + if (message.stmt_len != null && message.hasOwnProperty("stmt_len")) + if (!$util.isInteger(message.stmt_len)) + return "stmt_len: integer expected"; + return null; + }; + + /** + * Creates a Query message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.Query + * @static + * @param {Object.} object Plain object + * @returns {pg_query.Query} Query + */ + Query.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.Query) + return object; + var message = new $root.pg_query.Query(); + switch (object.commandType) { + default: + if (typeof object.commandType === "number") { + message.commandType = object.commandType; + break; + } + break; + case "CMD_TYPE_UNDEFINED": + case 0: + message.commandType = 0; + break; + case "CMD_UNKNOWN": + case 1: + message.commandType = 1; + break; + case "CMD_SELECT": + case 2: + message.commandType = 2; + break; + case "CMD_UPDATE": + case 3: + message.commandType = 3; + break; + case "CMD_INSERT": + case 4: + message.commandType = 4; + break; + case "CMD_DELETE": + case 5: + message.commandType = 5; + break; + case "CMD_UTILITY": + case 6: + message.commandType = 6; + break; + case "CMD_NOTHING": + case 7: + message.commandType = 7; + break; + } + switch (object.querySource) { + default: + if (typeof object.querySource === "number") { + message.querySource = object.querySource; + break; + } + break; + case "QUERY_SOURCE_UNDEFINED": + case 0: + message.querySource = 0; + break; + case "QSRC_ORIGINAL": + case 1: + message.querySource = 1; + break; + case "QSRC_PARSER": + case 2: + message.querySource = 2; + break; + case "QSRC_INSTEAD_RULE": + case 3: + message.querySource = 3; + break; + case "QSRC_QUAL_INSTEAD_RULE": + case 4: + message.querySource = 4; + break; + case "QSRC_NON_INSTEAD_RULE": + case 5: + message.querySource = 5; + break; + } + if (object.canSetTag != null) + message.canSetTag = Boolean(object.canSetTag); + if (object.utilityStmt != null) { + if (typeof object.utilityStmt !== "object") + throw TypeError(".pg_query.Query.utilityStmt: object expected"); + message.utilityStmt = $root.pg_query.Node.fromObject(object.utilityStmt); + } + if (object.resultRelation != null) + message.resultRelation = object.resultRelation | 0; + if (object.hasAggs != null) + message.hasAggs = Boolean(object.hasAggs); + if (object.hasWindowFuncs != null) + message.hasWindowFuncs = Boolean(object.hasWindowFuncs); + if (object.hasTargetSRFs != null) + message.hasTargetSRFs = Boolean(object.hasTargetSRFs); + if (object.hasSubLinks != null) + message.hasSubLinks = Boolean(object.hasSubLinks); + if (object.hasDistinctOn != null) + message.hasDistinctOn = Boolean(object.hasDistinctOn); + if (object.hasRecursive != null) + message.hasRecursive = Boolean(object.hasRecursive); + if (object.hasModifyingCTE != null) + message.hasModifyingCTE = Boolean(object.hasModifyingCTE); + if (object.hasForUpdate != null) + message.hasForUpdate = Boolean(object.hasForUpdate); + if (object.hasRowSecurity != null) + message.hasRowSecurity = Boolean(object.hasRowSecurity); + if (object.cteList) { + if (!Array.isArray(object.cteList)) + throw TypeError(".pg_query.Query.cteList: array expected"); + message.cteList = []; + for (var i = 0; i < object.cteList.length; ++i) { + if (typeof object.cteList[i] !== "object") + throw TypeError(".pg_query.Query.cteList: object expected"); + message.cteList[i] = $root.pg_query.Node.fromObject(object.cteList[i]); + } + } + if (object.rtable) { + if (!Array.isArray(object.rtable)) + throw TypeError(".pg_query.Query.rtable: array expected"); + message.rtable = []; + for (var i = 0; i < object.rtable.length; ++i) { + if (typeof object.rtable[i] !== "object") + throw TypeError(".pg_query.Query.rtable: object expected"); + message.rtable[i] = $root.pg_query.Node.fromObject(object.rtable[i]); + } + } + if (object.jointree != null) { + if (typeof object.jointree !== "object") + throw TypeError(".pg_query.Query.jointree: object expected"); + message.jointree = $root.pg_query.FromExpr.fromObject(object.jointree); + } + if (object.targetList) { + if (!Array.isArray(object.targetList)) + throw TypeError(".pg_query.Query.targetList: array expected"); + message.targetList = []; + for (var i = 0; i < object.targetList.length; ++i) { + if (typeof object.targetList[i] !== "object") + throw TypeError(".pg_query.Query.targetList: object expected"); + message.targetList[i] = $root.pg_query.Node.fromObject(object.targetList[i]); + } + } + switch (object.override) { + default: + if (typeof object.override === "number") { + message.override = object.override; + break; + } + break; + case "OVERRIDING_KIND_UNDEFINED": + case 0: + message.override = 0; + break; + case "OVERRIDING_NOT_SET": + case 1: + message.override = 1; + break; + case "OVERRIDING_USER_VALUE": + case 2: + message.override = 2; + break; + case "OVERRIDING_SYSTEM_VALUE": + case 3: + message.override = 3; + break; + } + if (object.onConflict != null) { + if (typeof object.onConflict !== "object") + throw TypeError(".pg_query.Query.onConflict: object expected"); + message.onConflict = $root.pg_query.OnConflictExpr.fromObject(object.onConflict); + } + if (object.returningList) { + if (!Array.isArray(object.returningList)) + throw TypeError(".pg_query.Query.returningList: array expected"); + message.returningList = []; + for (var i = 0; i < object.returningList.length; ++i) { + if (typeof object.returningList[i] !== "object") + throw TypeError(".pg_query.Query.returningList: object expected"); + message.returningList[i] = $root.pg_query.Node.fromObject(object.returningList[i]); + } + } + if (object.groupClause) { + if (!Array.isArray(object.groupClause)) + throw TypeError(".pg_query.Query.groupClause: array expected"); + message.groupClause = []; + for (var i = 0; i < object.groupClause.length; ++i) { + if (typeof object.groupClause[i] !== "object") + throw TypeError(".pg_query.Query.groupClause: object expected"); + message.groupClause[i] = $root.pg_query.Node.fromObject(object.groupClause[i]); + } + } + if (object.groupingSets) { + if (!Array.isArray(object.groupingSets)) + throw TypeError(".pg_query.Query.groupingSets: array expected"); + message.groupingSets = []; + for (var i = 0; i < object.groupingSets.length; ++i) { + if (typeof object.groupingSets[i] !== "object") + throw TypeError(".pg_query.Query.groupingSets: object expected"); + message.groupingSets[i] = $root.pg_query.Node.fromObject(object.groupingSets[i]); + } + } + if (object.havingQual != null) { + if (typeof object.havingQual !== "object") + throw TypeError(".pg_query.Query.havingQual: object expected"); + message.havingQual = $root.pg_query.Node.fromObject(object.havingQual); + } + if (object.windowClause) { + if (!Array.isArray(object.windowClause)) + throw TypeError(".pg_query.Query.windowClause: array expected"); + message.windowClause = []; + for (var i = 0; i < object.windowClause.length; ++i) { + if (typeof object.windowClause[i] !== "object") + throw TypeError(".pg_query.Query.windowClause: object expected"); + message.windowClause[i] = $root.pg_query.Node.fromObject(object.windowClause[i]); + } + } + if (object.distinctClause) { + if (!Array.isArray(object.distinctClause)) + throw TypeError(".pg_query.Query.distinctClause: array expected"); + message.distinctClause = []; + for (var i = 0; i < object.distinctClause.length; ++i) { + if (typeof object.distinctClause[i] !== "object") + throw TypeError(".pg_query.Query.distinctClause: object expected"); + message.distinctClause[i] = $root.pg_query.Node.fromObject(object.distinctClause[i]); + } + } + if (object.sortClause) { + if (!Array.isArray(object.sortClause)) + throw TypeError(".pg_query.Query.sortClause: array expected"); + message.sortClause = []; + for (var i = 0; i < object.sortClause.length; ++i) { + if (typeof object.sortClause[i] !== "object") + throw TypeError(".pg_query.Query.sortClause: object expected"); + message.sortClause[i] = $root.pg_query.Node.fromObject(object.sortClause[i]); + } + } + if (object.limitOffset != null) { + if (typeof object.limitOffset !== "object") + throw TypeError(".pg_query.Query.limitOffset: object expected"); + message.limitOffset = $root.pg_query.Node.fromObject(object.limitOffset); + } + if (object.limitCount != null) { + if (typeof object.limitCount !== "object") + throw TypeError(".pg_query.Query.limitCount: object expected"); + message.limitCount = $root.pg_query.Node.fromObject(object.limitCount); + } + switch (object.limitOption) { + default: + if (typeof object.limitOption === "number") { + message.limitOption = object.limitOption; + break; + } + break; + case "LIMIT_OPTION_UNDEFINED": + case 0: + message.limitOption = 0; + break; + case "LIMIT_OPTION_DEFAULT": + case 1: + message.limitOption = 1; + break; + case "LIMIT_OPTION_COUNT": + case 2: + message.limitOption = 2; + break; + case "LIMIT_OPTION_WITH_TIES": + case 3: + message.limitOption = 3; + break; + } + if (object.rowMarks) { + if (!Array.isArray(object.rowMarks)) + throw TypeError(".pg_query.Query.rowMarks: array expected"); + message.rowMarks = []; + for (var i = 0; i < object.rowMarks.length; ++i) { + if (typeof object.rowMarks[i] !== "object") + throw TypeError(".pg_query.Query.rowMarks: object expected"); + message.rowMarks[i] = $root.pg_query.Node.fromObject(object.rowMarks[i]); + } + } + if (object.setOperations != null) { + if (typeof object.setOperations !== "object") + throw TypeError(".pg_query.Query.setOperations: object expected"); + message.setOperations = $root.pg_query.Node.fromObject(object.setOperations); + } + if (object.constraintDeps) { + if (!Array.isArray(object.constraintDeps)) + throw TypeError(".pg_query.Query.constraintDeps: array expected"); + message.constraintDeps = []; + for (var i = 0; i < object.constraintDeps.length; ++i) { + if (typeof object.constraintDeps[i] !== "object") + throw TypeError(".pg_query.Query.constraintDeps: object expected"); + message.constraintDeps[i] = $root.pg_query.Node.fromObject(object.constraintDeps[i]); + } + } + if (object.withCheckOptions) { + if (!Array.isArray(object.withCheckOptions)) + throw TypeError(".pg_query.Query.withCheckOptions: array expected"); + message.withCheckOptions = []; + for (var i = 0; i < object.withCheckOptions.length; ++i) { + if (typeof object.withCheckOptions[i] !== "object") + throw TypeError(".pg_query.Query.withCheckOptions: object expected"); + message.withCheckOptions[i] = $root.pg_query.Node.fromObject(object.withCheckOptions[i]); + } + } + if (object.stmt_location != null) + message.stmt_location = object.stmt_location | 0; + if (object.stmt_len != null) + message.stmt_len = object.stmt_len | 0; + return message; + }; + + /** + * Creates a plain object from a Query message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.Query + * @static + * @param {pg_query.Query} message Query + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Query.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.cteList = []; + object.rtable = []; + object.targetList = []; + object.returningList = []; + object.groupClause = []; + object.groupingSets = []; + object.windowClause = []; + object.distinctClause = []; + object.sortClause = []; + object.rowMarks = []; + object.constraintDeps = []; + object.withCheckOptions = []; + } + if (options.defaults) { + object.commandType = options.enums === String ? "CMD_TYPE_UNDEFINED" : 0; + object.querySource = options.enums === String ? "QUERY_SOURCE_UNDEFINED" : 0; + object.canSetTag = false; + object.utilityStmt = null; + object.resultRelation = 0; + object.hasAggs = false; + object.hasWindowFuncs = false; + object.hasTargetSRFs = false; + object.hasSubLinks = false; + object.hasDistinctOn = false; + object.hasRecursive = false; + object.hasModifyingCTE = false; + object.hasForUpdate = false; + object.hasRowSecurity = false; + object.jointree = null; + object.override = options.enums === String ? "OVERRIDING_KIND_UNDEFINED" : 0; + object.onConflict = null; + object.havingQual = null; + object.limitOffset = null; + object.limitCount = null; + object.limitOption = options.enums === String ? "LIMIT_OPTION_UNDEFINED" : 0; + object.setOperations = null; + object.stmt_location = 0; + object.stmt_len = 0; + } + if (message.commandType != null && message.hasOwnProperty("commandType")) + object.commandType = options.enums === String ? $root.pg_query.CmdType[message.commandType] === undefined ? message.commandType : $root.pg_query.CmdType[message.commandType] : message.commandType; + if (message.querySource != null && message.hasOwnProperty("querySource")) + object.querySource = options.enums === String ? $root.pg_query.QuerySource[message.querySource] === undefined ? message.querySource : $root.pg_query.QuerySource[message.querySource] : message.querySource; + if (message.canSetTag != null && message.hasOwnProperty("canSetTag")) + object.canSetTag = message.canSetTag; + if (message.utilityStmt != null && message.hasOwnProperty("utilityStmt")) + object.utilityStmt = $root.pg_query.Node.toObject(message.utilityStmt, options); + if (message.resultRelation != null && message.hasOwnProperty("resultRelation")) + object.resultRelation = message.resultRelation; + if (message.hasAggs != null && message.hasOwnProperty("hasAggs")) + object.hasAggs = message.hasAggs; + if (message.hasWindowFuncs != null && message.hasOwnProperty("hasWindowFuncs")) + object.hasWindowFuncs = message.hasWindowFuncs; + if (message.hasTargetSRFs != null && message.hasOwnProperty("hasTargetSRFs")) + object.hasTargetSRFs = message.hasTargetSRFs; + if (message.hasSubLinks != null && message.hasOwnProperty("hasSubLinks")) + object.hasSubLinks = message.hasSubLinks; + if (message.hasDistinctOn != null && message.hasOwnProperty("hasDistinctOn")) + object.hasDistinctOn = message.hasDistinctOn; + if (message.hasRecursive != null && message.hasOwnProperty("hasRecursive")) + object.hasRecursive = message.hasRecursive; + if (message.hasModifyingCTE != null && message.hasOwnProperty("hasModifyingCTE")) + object.hasModifyingCTE = message.hasModifyingCTE; + if (message.hasForUpdate != null && message.hasOwnProperty("hasForUpdate")) + object.hasForUpdate = message.hasForUpdate; + if (message.hasRowSecurity != null && message.hasOwnProperty("hasRowSecurity")) + object.hasRowSecurity = message.hasRowSecurity; + if (message.cteList && message.cteList.length) { + object.cteList = []; + for (var j = 0; j < message.cteList.length; ++j) + object.cteList[j] = $root.pg_query.Node.toObject(message.cteList[j], options); + } + if (message.rtable && message.rtable.length) { + object.rtable = []; + for (var j = 0; j < message.rtable.length; ++j) + object.rtable[j] = $root.pg_query.Node.toObject(message.rtable[j], options); + } + if (message.jointree != null && message.hasOwnProperty("jointree")) + object.jointree = $root.pg_query.FromExpr.toObject(message.jointree, options); + if (message.targetList && message.targetList.length) { + object.targetList = []; + for (var j = 0; j < message.targetList.length; ++j) + object.targetList[j] = $root.pg_query.Node.toObject(message.targetList[j], options); + } + if (message.override != null && message.hasOwnProperty("override")) + object.override = options.enums === String ? $root.pg_query.OverridingKind[message.override] === undefined ? message.override : $root.pg_query.OverridingKind[message.override] : message.override; + if (message.onConflict != null && message.hasOwnProperty("onConflict")) + object.onConflict = $root.pg_query.OnConflictExpr.toObject(message.onConflict, options); + if (message.returningList && message.returningList.length) { + object.returningList = []; + for (var j = 0; j < message.returningList.length; ++j) + object.returningList[j] = $root.pg_query.Node.toObject(message.returningList[j], options); + } + if (message.groupClause && message.groupClause.length) { + object.groupClause = []; + for (var j = 0; j < message.groupClause.length; ++j) + object.groupClause[j] = $root.pg_query.Node.toObject(message.groupClause[j], options); + } + if (message.groupingSets && message.groupingSets.length) { + object.groupingSets = []; + for (var j = 0; j < message.groupingSets.length; ++j) + object.groupingSets[j] = $root.pg_query.Node.toObject(message.groupingSets[j], options); + } + if (message.havingQual != null && message.hasOwnProperty("havingQual")) + object.havingQual = $root.pg_query.Node.toObject(message.havingQual, options); + if (message.windowClause && message.windowClause.length) { + object.windowClause = []; + for (var j = 0; j < message.windowClause.length; ++j) + object.windowClause[j] = $root.pg_query.Node.toObject(message.windowClause[j], options); + } + if (message.distinctClause && message.distinctClause.length) { + object.distinctClause = []; + for (var j = 0; j < message.distinctClause.length; ++j) + object.distinctClause[j] = $root.pg_query.Node.toObject(message.distinctClause[j], options); + } + if (message.sortClause && message.sortClause.length) { + object.sortClause = []; + for (var j = 0; j < message.sortClause.length; ++j) + object.sortClause[j] = $root.pg_query.Node.toObject(message.sortClause[j], options); + } + if (message.limitOffset != null && message.hasOwnProperty("limitOffset")) + object.limitOffset = $root.pg_query.Node.toObject(message.limitOffset, options); + if (message.limitCount != null && message.hasOwnProperty("limitCount")) + object.limitCount = $root.pg_query.Node.toObject(message.limitCount, options); + if (message.limitOption != null && message.hasOwnProperty("limitOption")) + object.limitOption = options.enums === String ? $root.pg_query.LimitOption[message.limitOption] === undefined ? message.limitOption : $root.pg_query.LimitOption[message.limitOption] : message.limitOption; + if (message.rowMarks && message.rowMarks.length) { + object.rowMarks = []; + for (var j = 0; j < message.rowMarks.length; ++j) + object.rowMarks[j] = $root.pg_query.Node.toObject(message.rowMarks[j], options); + } + if (message.setOperations != null && message.hasOwnProperty("setOperations")) + object.setOperations = $root.pg_query.Node.toObject(message.setOperations, options); + if (message.constraintDeps && message.constraintDeps.length) { + object.constraintDeps = []; + for (var j = 0; j < message.constraintDeps.length; ++j) + object.constraintDeps[j] = $root.pg_query.Node.toObject(message.constraintDeps[j], options); + } + if (message.withCheckOptions && message.withCheckOptions.length) { + object.withCheckOptions = []; + for (var j = 0; j < message.withCheckOptions.length; ++j) + object.withCheckOptions[j] = $root.pg_query.Node.toObject(message.withCheckOptions[j], options); + } + if (message.stmt_location != null && message.hasOwnProperty("stmt_location")) + object.stmt_location = message.stmt_location; + if (message.stmt_len != null && message.hasOwnProperty("stmt_len")) + object.stmt_len = message.stmt_len; + return object; + }; + + /** + * Converts this Query to JSON. + * @function toJSON + * @memberof pg_query.Query + * @instance + * @returns {Object.} JSON object + */ + Query.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Query + * @function getTypeUrl + * @memberof pg_query.Query + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Query.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.Query"; + }; + + return Query; + })(); + + pg_query.InsertStmt = (function() { + + /** + * Properties of an InsertStmt. + * @memberof pg_query + * @interface IInsertStmt + * @property {pg_query.IRangeVar|null} [relation] InsertStmt relation + * @property {Array.|null} [cols] InsertStmt cols + * @property {pg_query.INode|null} [selectStmt] InsertStmt selectStmt + * @property {pg_query.IOnConflictClause|null} [onConflictClause] InsertStmt onConflictClause + * @property {Array.|null} [returningList] InsertStmt returningList + * @property {pg_query.IWithClause|null} [withClause] InsertStmt withClause + * @property {pg_query.OverridingKind|null} [override] InsertStmt override + */ + + /** + * Constructs a new InsertStmt. + * @memberof pg_query + * @classdesc Represents an InsertStmt. + * @implements IInsertStmt + * @constructor + * @param {pg_query.IInsertStmt=} [properties] Properties to set + */ + function InsertStmt(properties) { + this.cols = []; + this.returningList = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InsertStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.InsertStmt + * @instance + */ + InsertStmt.prototype.relation = null; + + /** + * InsertStmt cols. + * @member {Array.} cols + * @memberof pg_query.InsertStmt + * @instance + */ + InsertStmt.prototype.cols = $util.emptyArray; + + /** + * InsertStmt selectStmt. + * @member {pg_query.INode|null|undefined} selectStmt + * @memberof pg_query.InsertStmt + * @instance + */ + InsertStmt.prototype.selectStmt = null; + + /** + * InsertStmt onConflictClause. + * @member {pg_query.IOnConflictClause|null|undefined} onConflictClause + * @memberof pg_query.InsertStmt + * @instance + */ + InsertStmt.prototype.onConflictClause = null; + + /** + * InsertStmt returningList. + * @member {Array.} returningList + * @memberof pg_query.InsertStmt + * @instance + */ + InsertStmt.prototype.returningList = $util.emptyArray; + + /** + * InsertStmt withClause. + * @member {pg_query.IWithClause|null|undefined} withClause + * @memberof pg_query.InsertStmt + * @instance + */ + InsertStmt.prototype.withClause = null; + + /** + * InsertStmt override. + * @member {pg_query.OverridingKind} override + * @memberof pg_query.InsertStmt + * @instance + */ + InsertStmt.prototype.override = 0; + + /** + * Creates a new InsertStmt instance using the specified properties. + * @function create + * @memberof pg_query.InsertStmt + * @static + * @param {pg_query.IInsertStmt=} [properties] Properties to set + * @returns {pg_query.InsertStmt} InsertStmt instance + */ + InsertStmt.create = function create(properties) { + return new InsertStmt(properties); + }; + + /** + * Encodes the specified InsertStmt message. Does not implicitly {@link pg_query.InsertStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.InsertStmt + * @static + * @param {pg_query.IInsertStmt} message InsertStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cols != null && message.cols.length) + for (var i = 0; i < message.cols.length; ++i) + $root.pg_query.Node.encode(message.cols[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.selectStmt != null && Object.hasOwnProperty.call(message, "selectStmt")) + $root.pg_query.Node.encode(message.selectStmt, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.onConflictClause != null && Object.hasOwnProperty.call(message, "onConflictClause")) + $root.pg_query.OnConflictClause.encode(message.onConflictClause, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.returningList != null && message.returningList.length) + for (var i = 0; i < message.returningList.length; ++i) + $root.pg_query.Node.encode(message.returningList[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.withClause != null && Object.hasOwnProperty.call(message, "withClause")) + $root.pg_query.WithClause.encode(message.withClause, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.override != null && Object.hasOwnProperty.call(message, "override")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.override); + return writer; + }; + + /** + * Encodes the specified InsertStmt message, length delimited. Does not implicitly {@link pg_query.InsertStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.InsertStmt + * @static + * @param {pg_query.IInsertStmt} message InsertStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InsertStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InsertStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.InsertStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.InsertStmt} InsertStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.InsertStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.cols && message.cols.length)) + message.cols = []; + message.cols.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.selectStmt = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.onConflictClause = $root.pg_query.OnConflictClause.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.returningList && message.returningList.length)) + message.returningList = []; + message.returningList.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.withClause = $root.pg_query.WithClause.decode(reader, reader.uint32()); + break; + } + case 7: { + message.override = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InsertStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.InsertStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.InsertStmt} InsertStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InsertStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InsertStmt message. + * @function verify + * @memberof pg_query.InsertStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InsertStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.cols != null && message.hasOwnProperty("cols")) { + if (!Array.isArray(message.cols)) + return "cols: array expected"; + for (var i = 0; i < message.cols.length; ++i) { + var error = $root.pg_query.Node.verify(message.cols[i]); + if (error) + return "cols." + error; + } + } + if (message.selectStmt != null && message.hasOwnProperty("selectStmt")) { + var error = $root.pg_query.Node.verify(message.selectStmt); + if (error) + return "selectStmt." + error; + } + if (message.onConflictClause != null && message.hasOwnProperty("onConflictClause")) { + var error = $root.pg_query.OnConflictClause.verify(message.onConflictClause); + if (error) + return "onConflictClause." + error; + } + if (message.returningList != null && message.hasOwnProperty("returningList")) { + if (!Array.isArray(message.returningList)) + return "returningList: array expected"; + for (var i = 0; i < message.returningList.length; ++i) { + var error = $root.pg_query.Node.verify(message.returningList[i]); + if (error) + return "returningList." + error; + } + } + if (message.withClause != null && message.hasOwnProperty("withClause")) { + var error = $root.pg_query.WithClause.verify(message.withClause); + if (error) + return "withClause." + error; + } + if (message.override != null && message.hasOwnProperty("override")) + switch (message.override) { + default: + return "override: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an InsertStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.InsertStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.InsertStmt} InsertStmt + */ + InsertStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.InsertStmt) + return object; + var message = new $root.pg_query.InsertStmt(); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.InsertStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.cols) { + if (!Array.isArray(object.cols)) + throw TypeError(".pg_query.InsertStmt.cols: array expected"); + message.cols = []; + for (var i = 0; i < object.cols.length; ++i) { + if (typeof object.cols[i] !== "object") + throw TypeError(".pg_query.InsertStmt.cols: object expected"); + message.cols[i] = $root.pg_query.Node.fromObject(object.cols[i]); + } + } + if (object.selectStmt != null) { + if (typeof object.selectStmt !== "object") + throw TypeError(".pg_query.InsertStmt.selectStmt: object expected"); + message.selectStmt = $root.pg_query.Node.fromObject(object.selectStmt); + } + if (object.onConflictClause != null) { + if (typeof object.onConflictClause !== "object") + throw TypeError(".pg_query.InsertStmt.onConflictClause: object expected"); + message.onConflictClause = $root.pg_query.OnConflictClause.fromObject(object.onConflictClause); + } + if (object.returningList) { + if (!Array.isArray(object.returningList)) + throw TypeError(".pg_query.InsertStmt.returningList: array expected"); + message.returningList = []; + for (var i = 0; i < object.returningList.length; ++i) { + if (typeof object.returningList[i] !== "object") + throw TypeError(".pg_query.InsertStmt.returningList: object expected"); + message.returningList[i] = $root.pg_query.Node.fromObject(object.returningList[i]); + } + } + if (object.withClause != null) { + if (typeof object.withClause !== "object") + throw TypeError(".pg_query.InsertStmt.withClause: object expected"); + message.withClause = $root.pg_query.WithClause.fromObject(object.withClause); + } + switch (object.override) { + default: + if (typeof object.override === "number") { + message.override = object.override; + break; + } + break; + case "OVERRIDING_KIND_UNDEFINED": + case 0: + message.override = 0; + break; + case "OVERRIDING_NOT_SET": + case 1: + message.override = 1; + break; + case "OVERRIDING_USER_VALUE": + case 2: + message.override = 2; + break; + case "OVERRIDING_SYSTEM_VALUE": + case 3: + message.override = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an InsertStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.InsertStmt + * @static + * @param {pg_query.InsertStmt} message InsertStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InsertStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.cols = []; + object.returningList = []; + } + if (options.defaults) { + object.relation = null; + object.selectStmt = null; + object.onConflictClause = null; + object.withClause = null; + object.override = options.enums === String ? "OVERRIDING_KIND_UNDEFINED" : 0; + } + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.cols && message.cols.length) { + object.cols = []; + for (var j = 0; j < message.cols.length; ++j) + object.cols[j] = $root.pg_query.Node.toObject(message.cols[j], options); + } + if (message.selectStmt != null && message.hasOwnProperty("selectStmt")) + object.selectStmt = $root.pg_query.Node.toObject(message.selectStmt, options); + if (message.onConflictClause != null && message.hasOwnProperty("onConflictClause")) + object.onConflictClause = $root.pg_query.OnConflictClause.toObject(message.onConflictClause, options); + if (message.returningList && message.returningList.length) { + object.returningList = []; + for (var j = 0; j < message.returningList.length; ++j) + object.returningList[j] = $root.pg_query.Node.toObject(message.returningList[j], options); + } + if (message.withClause != null && message.hasOwnProperty("withClause")) + object.withClause = $root.pg_query.WithClause.toObject(message.withClause, options); + if (message.override != null && message.hasOwnProperty("override")) + object.override = options.enums === String ? $root.pg_query.OverridingKind[message.override] === undefined ? message.override : $root.pg_query.OverridingKind[message.override] : message.override; + return object; + }; + + /** + * Converts this InsertStmt to JSON. + * @function toJSON + * @memberof pg_query.InsertStmt + * @instance + * @returns {Object.} JSON object + */ + InsertStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InsertStmt + * @function getTypeUrl + * @memberof pg_query.InsertStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InsertStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.InsertStmt"; + }; + + return InsertStmt; + })(); + + pg_query.DeleteStmt = (function() { + + /** + * Properties of a DeleteStmt. + * @memberof pg_query + * @interface IDeleteStmt + * @property {pg_query.IRangeVar|null} [relation] DeleteStmt relation + * @property {Array.|null} [usingClause] DeleteStmt usingClause + * @property {pg_query.INode|null} [whereClause] DeleteStmt whereClause + * @property {Array.|null} [returningList] DeleteStmt returningList + * @property {pg_query.IWithClause|null} [withClause] DeleteStmt withClause + */ + + /** + * Constructs a new DeleteStmt. + * @memberof pg_query + * @classdesc Represents a DeleteStmt. + * @implements IDeleteStmt + * @constructor + * @param {pg_query.IDeleteStmt=} [properties] Properties to set + */ + function DeleteStmt(properties) { + this.usingClause = []; + this.returningList = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.DeleteStmt + * @instance + */ + DeleteStmt.prototype.relation = null; + + /** + * DeleteStmt usingClause. + * @member {Array.} usingClause + * @memberof pg_query.DeleteStmt + * @instance + */ + DeleteStmt.prototype.usingClause = $util.emptyArray; + + /** + * DeleteStmt whereClause. + * @member {pg_query.INode|null|undefined} whereClause + * @memberof pg_query.DeleteStmt + * @instance + */ + DeleteStmt.prototype.whereClause = null; + + /** + * DeleteStmt returningList. + * @member {Array.} returningList + * @memberof pg_query.DeleteStmt + * @instance + */ + DeleteStmt.prototype.returningList = $util.emptyArray; + + /** + * DeleteStmt withClause. + * @member {pg_query.IWithClause|null|undefined} withClause + * @memberof pg_query.DeleteStmt + * @instance + */ + DeleteStmt.prototype.withClause = null; + + /** + * Creates a new DeleteStmt instance using the specified properties. + * @function create + * @memberof pg_query.DeleteStmt + * @static + * @param {pg_query.IDeleteStmt=} [properties] Properties to set + * @returns {pg_query.DeleteStmt} DeleteStmt instance + */ + DeleteStmt.create = function create(properties) { + return new DeleteStmt(properties); + }; + + /** + * Encodes the specified DeleteStmt message. Does not implicitly {@link pg_query.DeleteStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DeleteStmt + * @static + * @param {pg_query.IDeleteStmt} message DeleteStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.usingClause != null && message.usingClause.length) + for (var i = 0; i < message.usingClause.length; ++i) + $root.pg_query.Node.encode(message.usingClause[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.whereClause != null && Object.hasOwnProperty.call(message, "whereClause")) + $root.pg_query.Node.encode(message.whereClause, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.returningList != null && message.returningList.length) + for (var i = 0; i < message.returningList.length; ++i) + $root.pg_query.Node.encode(message.returningList[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.withClause != null && Object.hasOwnProperty.call(message, "withClause")) + $root.pg_query.WithClause.encode(message.withClause, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeleteStmt message, length delimited. Does not implicitly {@link pg_query.DeleteStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DeleteStmt + * @static + * @param {pg_query.IDeleteStmt} message DeleteStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DeleteStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DeleteStmt} DeleteStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DeleteStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.usingClause && message.usingClause.length)) + message.usingClause = []; + message.usingClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.whereClause = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.returningList && message.returningList.length)) + message.returningList = []; + message.returningList.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.withClause = $root.pg_query.WithClause.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DeleteStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DeleteStmt} DeleteStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteStmt message. + * @function verify + * @memberof pg_query.DeleteStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.usingClause != null && message.hasOwnProperty("usingClause")) { + if (!Array.isArray(message.usingClause)) + return "usingClause: array expected"; + for (var i = 0; i < message.usingClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.usingClause[i]); + if (error) + return "usingClause." + error; + } + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) { + var error = $root.pg_query.Node.verify(message.whereClause); + if (error) + return "whereClause." + error; + } + if (message.returningList != null && message.hasOwnProperty("returningList")) { + if (!Array.isArray(message.returningList)) + return "returningList: array expected"; + for (var i = 0; i < message.returningList.length; ++i) { + var error = $root.pg_query.Node.verify(message.returningList[i]); + if (error) + return "returningList." + error; + } + } + if (message.withClause != null && message.hasOwnProperty("withClause")) { + var error = $root.pg_query.WithClause.verify(message.withClause); + if (error) + return "withClause." + error; + } + return null; + }; + + /** + * Creates a DeleteStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DeleteStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DeleteStmt} DeleteStmt + */ + DeleteStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DeleteStmt) + return object; + var message = new $root.pg_query.DeleteStmt(); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.DeleteStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.usingClause) { + if (!Array.isArray(object.usingClause)) + throw TypeError(".pg_query.DeleteStmt.usingClause: array expected"); + message.usingClause = []; + for (var i = 0; i < object.usingClause.length; ++i) { + if (typeof object.usingClause[i] !== "object") + throw TypeError(".pg_query.DeleteStmt.usingClause: object expected"); + message.usingClause[i] = $root.pg_query.Node.fromObject(object.usingClause[i]); + } + } + if (object.whereClause != null) { + if (typeof object.whereClause !== "object") + throw TypeError(".pg_query.DeleteStmt.whereClause: object expected"); + message.whereClause = $root.pg_query.Node.fromObject(object.whereClause); + } + if (object.returningList) { + if (!Array.isArray(object.returningList)) + throw TypeError(".pg_query.DeleteStmt.returningList: array expected"); + message.returningList = []; + for (var i = 0; i < object.returningList.length; ++i) { + if (typeof object.returningList[i] !== "object") + throw TypeError(".pg_query.DeleteStmt.returningList: object expected"); + message.returningList[i] = $root.pg_query.Node.fromObject(object.returningList[i]); + } + } + if (object.withClause != null) { + if (typeof object.withClause !== "object") + throw TypeError(".pg_query.DeleteStmt.withClause: object expected"); + message.withClause = $root.pg_query.WithClause.fromObject(object.withClause); + } + return message; + }; + + /** + * Creates a plain object from a DeleteStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DeleteStmt + * @static + * @param {pg_query.DeleteStmt} message DeleteStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.usingClause = []; + object.returningList = []; + } + if (options.defaults) { + object.relation = null; + object.whereClause = null; + object.withClause = null; + } + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.usingClause && message.usingClause.length) { + object.usingClause = []; + for (var j = 0; j < message.usingClause.length; ++j) + object.usingClause[j] = $root.pg_query.Node.toObject(message.usingClause[j], options); + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) + object.whereClause = $root.pg_query.Node.toObject(message.whereClause, options); + if (message.returningList && message.returningList.length) { + object.returningList = []; + for (var j = 0; j < message.returningList.length; ++j) + object.returningList[j] = $root.pg_query.Node.toObject(message.returningList[j], options); + } + if (message.withClause != null && message.hasOwnProperty("withClause")) + object.withClause = $root.pg_query.WithClause.toObject(message.withClause, options); + return object; + }; + + /** + * Converts this DeleteStmt to JSON. + * @function toJSON + * @memberof pg_query.DeleteStmt + * @instance + * @returns {Object.} JSON object + */ + DeleteStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteStmt + * @function getTypeUrl + * @memberof pg_query.DeleteStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DeleteStmt"; + }; + + return DeleteStmt; + })(); + + pg_query.UpdateStmt = (function() { + + /** + * Properties of an UpdateStmt. + * @memberof pg_query + * @interface IUpdateStmt + * @property {pg_query.IRangeVar|null} [relation] UpdateStmt relation + * @property {Array.|null} [targetList] UpdateStmt targetList + * @property {pg_query.INode|null} [whereClause] UpdateStmt whereClause + * @property {Array.|null} [fromClause] UpdateStmt fromClause + * @property {Array.|null} [returningList] UpdateStmt returningList + * @property {pg_query.IWithClause|null} [withClause] UpdateStmt withClause + */ + + /** + * Constructs a new UpdateStmt. + * @memberof pg_query + * @classdesc Represents an UpdateStmt. + * @implements IUpdateStmt + * @constructor + * @param {pg_query.IUpdateStmt=} [properties] Properties to set + */ + function UpdateStmt(properties) { + this.targetList = []; + this.fromClause = []; + this.returningList = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.UpdateStmt + * @instance + */ + UpdateStmt.prototype.relation = null; + + /** + * UpdateStmt targetList. + * @member {Array.} targetList + * @memberof pg_query.UpdateStmt + * @instance + */ + UpdateStmt.prototype.targetList = $util.emptyArray; + + /** + * UpdateStmt whereClause. + * @member {pg_query.INode|null|undefined} whereClause + * @memberof pg_query.UpdateStmt + * @instance + */ + UpdateStmt.prototype.whereClause = null; + + /** + * UpdateStmt fromClause. + * @member {Array.} fromClause + * @memberof pg_query.UpdateStmt + * @instance + */ + UpdateStmt.prototype.fromClause = $util.emptyArray; + + /** + * UpdateStmt returningList. + * @member {Array.} returningList + * @memberof pg_query.UpdateStmt + * @instance + */ + UpdateStmt.prototype.returningList = $util.emptyArray; + + /** + * UpdateStmt withClause. + * @member {pg_query.IWithClause|null|undefined} withClause + * @memberof pg_query.UpdateStmt + * @instance + */ + UpdateStmt.prototype.withClause = null; + + /** + * Creates a new UpdateStmt instance using the specified properties. + * @function create + * @memberof pg_query.UpdateStmt + * @static + * @param {pg_query.IUpdateStmt=} [properties] Properties to set + * @returns {pg_query.UpdateStmt} UpdateStmt instance + */ + UpdateStmt.create = function create(properties) { + return new UpdateStmt(properties); + }; + + /** + * Encodes the specified UpdateStmt message. Does not implicitly {@link pg_query.UpdateStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.UpdateStmt + * @static + * @param {pg_query.IUpdateStmt} message UpdateStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.targetList != null && message.targetList.length) + for (var i = 0; i < message.targetList.length; ++i) + $root.pg_query.Node.encode(message.targetList[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.whereClause != null && Object.hasOwnProperty.call(message, "whereClause")) + $root.pg_query.Node.encode(message.whereClause, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.fromClause != null && message.fromClause.length) + for (var i = 0; i < message.fromClause.length; ++i) + $root.pg_query.Node.encode(message.fromClause[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.returningList != null && message.returningList.length) + for (var i = 0; i < message.returningList.length; ++i) + $root.pg_query.Node.encode(message.returningList[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.withClause != null && Object.hasOwnProperty.call(message, "withClause")) + $root.pg_query.WithClause.encode(message.withClause, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateStmt message, length delimited. Does not implicitly {@link pg_query.UpdateStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.UpdateStmt + * @static + * @param {pg_query.IUpdateStmt} message UpdateStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.UpdateStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.UpdateStmt} UpdateStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.UpdateStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.targetList && message.targetList.length)) + message.targetList = []; + message.targetList.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.whereClause = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.fromClause && message.fromClause.length)) + message.fromClause = []; + message.fromClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.returningList && message.returningList.length)) + message.returningList = []; + message.returningList.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.withClause = $root.pg_query.WithClause.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.UpdateStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.UpdateStmt} UpdateStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateStmt message. + * @function verify + * @memberof pg_query.UpdateStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.targetList != null && message.hasOwnProperty("targetList")) { + if (!Array.isArray(message.targetList)) + return "targetList: array expected"; + for (var i = 0; i < message.targetList.length; ++i) { + var error = $root.pg_query.Node.verify(message.targetList[i]); + if (error) + return "targetList." + error; + } + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) { + var error = $root.pg_query.Node.verify(message.whereClause); + if (error) + return "whereClause." + error; + } + if (message.fromClause != null && message.hasOwnProperty("fromClause")) { + if (!Array.isArray(message.fromClause)) + return "fromClause: array expected"; + for (var i = 0; i < message.fromClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.fromClause[i]); + if (error) + return "fromClause." + error; + } + } + if (message.returningList != null && message.hasOwnProperty("returningList")) { + if (!Array.isArray(message.returningList)) + return "returningList: array expected"; + for (var i = 0; i < message.returningList.length; ++i) { + var error = $root.pg_query.Node.verify(message.returningList[i]); + if (error) + return "returningList." + error; + } + } + if (message.withClause != null && message.hasOwnProperty("withClause")) { + var error = $root.pg_query.WithClause.verify(message.withClause); + if (error) + return "withClause." + error; + } + return null; + }; + + /** + * Creates an UpdateStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.UpdateStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.UpdateStmt} UpdateStmt + */ + UpdateStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.UpdateStmt) + return object; + var message = new $root.pg_query.UpdateStmt(); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.UpdateStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.targetList) { + if (!Array.isArray(object.targetList)) + throw TypeError(".pg_query.UpdateStmt.targetList: array expected"); + message.targetList = []; + for (var i = 0; i < object.targetList.length; ++i) { + if (typeof object.targetList[i] !== "object") + throw TypeError(".pg_query.UpdateStmt.targetList: object expected"); + message.targetList[i] = $root.pg_query.Node.fromObject(object.targetList[i]); + } + } + if (object.whereClause != null) { + if (typeof object.whereClause !== "object") + throw TypeError(".pg_query.UpdateStmt.whereClause: object expected"); + message.whereClause = $root.pg_query.Node.fromObject(object.whereClause); + } + if (object.fromClause) { + if (!Array.isArray(object.fromClause)) + throw TypeError(".pg_query.UpdateStmt.fromClause: array expected"); + message.fromClause = []; + for (var i = 0; i < object.fromClause.length; ++i) { + if (typeof object.fromClause[i] !== "object") + throw TypeError(".pg_query.UpdateStmt.fromClause: object expected"); + message.fromClause[i] = $root.pg_query.Node.fromObject(object.fromClause[i]); + } + } + if (object.returningList) { + if (!Array.isArray(object.returningList)) + throw TypeError(".pg_query.UpdateStmt.returningList: array expected"); + message.returningList = []; + for (var i = 0; i < object.returningList.length; ++i) { + if (typeof object.returningList[i] !== "object") + throw TypeError(".pg_query.UpdateStmt.returningList: object expected"); + message.returningList[i] = $root.pg_query.Node.fromObject(object.returningList[i]); + } + } + if (object.withClause != null) { + if (typeof object.withClause !== "object") + throw TypeError(".pg_query.UpdateStmt.withClause: object expected"); + message.withClause = $root.pg_query.WithClause.fromObject(object.withClause); + } + return message; + }; + + /** + * Creates a plain object from an UpdateStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.UpdateStmt + * @static + * @param {pg_query.UpdateStmt} message UpdateStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targetList = []; + object.fromClause = []; + object.returningList = []; + } + if (options.defaults) { + object.relation = null; + object.whereClause = null; + object.withClause = null; + } + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.targetList && message.targetList.length) { + object.targetList = []; + for (var j = 0; j < message.targetList.length; ++j) + object.targetList[j] = $root.pg_query.Node.toObject(message.targetList[j], options); + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) + object.whereClause = $root.pg_query.Node.toObject(message.whereClause, options); + if (message.fromClause && message.fromClause.length) { + object.fromClause = []; + for (var j = 0; j < message.fromClause.length; ++j) + object.fromClause[j] = $root.pg_query.Node.toObject(message.fromClause[j], options); + } + if (message.returningList && message.returningList.length) { + object.returningList = []; + for (var j = 0; j < message.returningList.length; ++j) + object.returningList[j] = $root.pg_query.Node.toObject(message.returningList[j], options); + } + if (message.withClause != null && message.hasOwnProperty("withClause")) + object.withClause = $root.pg_query.WithClause.toObject(message.withClause, options); + return object; + }; + + /** + * Converts this UpdateStmt to JSON. + * @function toJSON + * @memberof pg_query.UpdateStmt + * @instance + * @returns {Object.} JSON object + */ + UpdateStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateStmt + * @function getTypeUrl + * @memberof pg_query.UpdateStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.UpdateStmt"; + }; + + return UpdateStmt; + })(); + + pg_query.SelectStmt = (function() { + + /** + * Properties of a SelectStmt. + * @memberof pg_query + * @interface ISelectStmt + * @property {Array.|null} [distinctClause] SelectStmt distinctClause + * @property {pg_query.IIntoClause|null} [intoClause] SelectStmt intoClause + * @property {Array.|null} [targetList] SelectStmt targetList + * @property {Array.|null} [fromClause] SelectStmt fromClause + * @property {pg_query.INode|null} [whereClause] SelectStmt whereClause + * @property {Array.|null} [groupClause] SelectStmt groupClause + * @property {pg_query.INode|null} [havingClause] SelectStmt havingClause + * @property {Array.|null} [windowClause] SelectStmt windowClause + * @property {Array.|null} [valuesLists] SelectStmt valuesLists + * @property {Array.|null} [sortClause] SelectStmt sortClause + * @property {pg_query.INode|null} [limitOffset] SelectStmt limitOffset + * @property {pg_query.INode|null} [limitCount] SelectStmt limitCount + * @property {pg_query.LimitOption|null} [limitOption] SelectStmt limitOption + * @property {Array.|null} [lockingClause] SelectStmt lockingClause + * @property {pg_query.IWithClause|null} [withClause] SelectStmt withClause + * @property {pg_query.SetOperation|null} [op] SelectStmt op + * @property {boolean|null} [all] SelectStmt all + * @property {pg_query.ISelectStmt|null} [larg] SelectStmt larg + * @property {pg_query.ISelectStmt|null} [rarg] SelectStmt rarg + */ + + /** + * Constructs a new SelectStmt. + * @memberof pg_query + * @classdesc Represents a SelectStmt. + * @implements ISelectStmt + * @constructor + * @param {pg_query.ISelectStmt=} [properties] Properties to set + */ + function SelectStmt(properties) { + this.distinctClause = []; + this.targetList = []; + this.fromClause = []; + this.groupClause = []; + this.windowClause = []; + this.valuesLists = []; + this.sortClause = []; + this.lockingClause = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectStmt distinctClause. + * @member {Array.} distinctClause + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.distinctClause = $util.emptyArray; + + /** + * SelectStmt intoClause. + * @member {pg_query.IIntoClause|null|undefined} intoClause + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.intoClause = null; + + /** + * SelectStmt targetList. + * @member {Array.} targetList + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.targetList = $util.emptyArray; + + /** + * SelectStmt fromClause. + * @member {Array.} fromClause + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.fromClause = $util.emptyArray; + + /** + * SelectStmt whereClause. + * @member {pg_query.INode|null|undefined} whereClause + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.whereClause = null; + + /** + * SelectStmt groupClause. + * @member {Array.} groupClause + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.groupClause = $util.emptyArray; + + /** + * SelectStmt havingClause. + * @member {pg_query.INode|null|undefined} havingClause + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.havingClause = null; + + /** + * SelectStmt windowClause. + * @member {Array.} windowClause + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.windowClause = $util.emptyArray; + + /** + * SelectStmt valuesLists. + * @member {Array.} valuesLists + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.valuesLists = $util.emptyArray; + + /** + * SelectStmt sortClause. + * @member {Array.} sortClause + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.sortClause = $util.emptyArray; + + /** + * SelectStmt limitOffset. + * @member {pg_query.INode|null|undefined} limitOffset + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.limitOffset = null; + + /** + * SelectStmt limitCount. + * @member {pg_query.INode|null|undefined} limitCount + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.limitCount = null; + + /** + * SelectStmt limitOption. + * @member {pg_query.LimitOption} limitOption + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.limitOption = 0; + + /** + * SelectStmt lockingClause. + * @member {Array.} lockingClause + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.lockingClause = $util.emptyArray; + + /** + * SelectStmt withClause. + * @member {pg_query.IWithClause|null|undefined} withClause + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.withClause = null; + + /** + * SelectStmt op. + * @member {pg_query.SetOperation} op + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.op = 0; + + /** + * SelectStmt all. + * @member {boolean} all + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.all = false; + + /** + * SelectStmt larg. + * @member {pg_query.ISelectStmt|null|undefined} larg + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.larg = null; + + /** + * SelectStmt rarg. + * @member {pg_query.ISelectStmt|null|undefined} rarg + * @memberof pg_query.SelectStmt + * @instance + */ + SelectStmt.prototype.rarg = null; + + /** + * Creates a new SelectStmt instance using the specified properties. + * @function create + * @memberof pg_query.SelectStmt + * @static + * @param {pg_query.ISelectStmt=} [properties] Properties to set + * @returns {pg_query.SelectStmt} SelectStmt instance + */ + SelectStmt.create = function create(properties) { + return new SelectStmt(properties); + }; + + /** + * Encodes the specified SelectStmt message. Does not implicitly {@link pg_query.SelectStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.SelectStmt + * @static + * @param {pg_query.ISelectStmt} message SelectStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.distinctClause != null && message.distinctClause.length) + for (var i = 0; i < message.distinctClause.length; ++i) + $root.pg_query.Node.encode(message.distinctClause[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.intoClause != null && Object.hasOwnProperty.call(message, "intoClause")) + $root.pg_query.IntoClause.encode(message.intoClause, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.targetList != null && message.targetList.length) + for (var i = 0; i < message.targetList.length; ++i) + $root.pg_query.Node.encode(message.targetList[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.fromClause != null && message.fromClause.length) + for (var i = 0; i < message.fromClause.length; ++i) + $root.pg_query.Node.encode(message.fromClause[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.whereClause != null && Object.hasOwnProperty.call(message, "whereClause")) + $root.pg_query.Node.encode(message.whereClause, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.groupClause != null && message.groupClause.length) + for (var i = 0; i < message.groupClause.length; ++i) + $root.pg_query.Node.encode(message.groupClause[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.havingClause != null && Object.hasOwnProperty.call(message, "havingClause")) + $root.pg_query.Node.encode(message.havingClause, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.windowClause != null && message.windowClause.length) + for (var i = 0; i < message.windowClause.length; ++i) + $root.pg_query.Node.encode(message.windowClause[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.valuesLists != null && message.valuesLists.length) + for (var i = 0; i < message.valuesLists.length; ++i) + $root.pg_query.Node.encode(message.valuesLists[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.sortClause != null && message.sortClause.length) + for (var i = 0; i < message.sortClause.length; ++i) + $root.pg_query.Node.encode(message.sortClause[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.limitOffset != null && Object.hasOwnProperty.call(message, "limitOffset")) + $root.pg_query.Node.encode(message.limitOffset, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.limitCount != null && Object.hasOwnProperty.call(message, "limitCount")) + $root.pg_query.Node.encode(message.limitCount, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.limitOption != null && Object.hasOwnProperty.call(message, "limitOption")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.limitOption); + if (message.lockingClause != null && message.lockingClause.length) + for (var i = 0; i < message.lockingClause.length; ++i) + $root.pg_query.Node.encode(message.lockingClause[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.withClause != null && Object.hasOwnProperty.call(message, "withClause")) + $root.pg_query.WithClause.encode(message.withClause, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.op != null && Object.hasOwnProperty.call(message, "op")) + writer.uint32(/* id 16, wireType 0 =*/128).int32(message.op); + if (message.all != null && Object.hasOwnProperty.call(message, "all")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.all); + if (message.larg != null && Object.hasOwnProperty.call(message, "larg")) + $root.pg_query.SelectStmt.encode(message.larg, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.rarg != null && Object.hasOwnProperty.call(message, "rarg")) + $root.pg_query.SelectStmt.encode(message.rarg, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SelectStmt message, length delimited. Does not implicitly {@link pg_query.SelectStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.SelectStmt + * @static + * @param {pg_query.ISelectStmt} message SelectStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.SelectStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.SelectStmt} SelectStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.SelectStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.distinctClause && message.distinctClause.length)) + message.distinctClause = []; + message.distinctClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.intoClause = $root.pg_query.IntoClause.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.targetList && message.targetList.length)) + message.targetList = []; + message.targetList.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.fromClause && message.fromClause.length)) + message.fromClause = []; + message.fromClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.whereClause = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.groupClause && message.groupClause.length)) + message.groupClause = []; + message.groupClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + message.havingClause = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.windowClause && message.windowClause.length)) + message.windowClause = []; + message.windowClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.valuesLists && message.valuesLists.length)) + message.valuesLists = []; + message.valuesLists.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.sortClause && message.sortClause.length)) + message.sortClause = []; + message.sortClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 11: { + message.limitOffset = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 12: { + message.limitCount = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 13: { + message.limitOption = reader.int32(); + break; + } + case 14: { + if (!(message.lockingClause && message.lockingClause.length)) + message.lockingClause = []; + message.lockingClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 15: { + message.withClause = $root.pg_query.WithClause.decode(reader, reader.uint32()); + break; + } + case 16: { + message.op = reader.int32(); + break; + } + case 17: { + message.all = reader.bool(); + break; + } + case 18: { + message.larg = $root.pg_query.SelectStmt.decode(reader, reader.uint32()); + break; + } + case 19: { + message.rarg = $root.pg_query.SelectStmt.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.SelectStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.SelectStmt} SelectStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectStmt message. + * @function verify + * @memberof pg_query.SelectStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.distinctClause != null && message.hasOwnProperty("distinctClause")) { + if (!Array.isArray(message.distinctClause)) + return "distinctClause: array expected"; + for (var i = 0; i < message.distinctClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.distinctClause[i]); + if (error) + return "distinctClause." + error; + } + } + if (message.intoClause != null && message.hasOwnProperty("intoClause")) { + var error = $root.pg_query.IntoClause.verify(message.intoClause); + if (error) + return "intoClause." + error; + } + if (message.targetList != null && message.hasOwnProperty("targetList")) { + if (!Array.isArray(message.targetList)) + return "targetList: array expected"; + for (var i = 0; i < message.targetList.length; ++i) { + var error = $root.pg_query.Node.verify(message.targetList[i]); + if (error) + return "targetList." + error; + } + } + if (message.fromClause != null && message.hasOwnProperty("fromClause")) { + if (!Array.isArray(message.fromClause)) + return "fromClause: array expected"; + for (var i = 0; i < message.fromClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.fromClause[i]); + if (error) + return "fromClause." + error; + } + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) { + var error = $root.pg_query.Node.verify(message.whereClause); + if (error) + return "whereClause." + error; + } + if (message.groupClause != null && message.hasOwnProperty("groupClause")) { + if (!Array.isArray(message.groupClause)) + return "groupClause: array expected"; + for (var i = 0; i < message.groupClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.groupClause[i]); + if (error) + return "groupClause." + error; + } + } + if (message.havingClause != null && message.hasOwnProperty("havingClause")) { + var error = $root.pg_query.Node.verify(message.havingClause); + if (error) + return "havingClause." + error; + } + if (message.windowClause != null && message.hasOwnProperty("windowClause")) { + if (!Array.isArray(message.windowClause)) + return "windowClause: array expected"; + for (var i = 0; i < message.windowClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.windowClause[i]); + if (error) + return "windowClause." + error; + } + } + if (message.valuesLists != null && message.hasOwnProperty("valuesLists")) { + if (!Array.isArray(message.valuesLists)) + return "valuesLists: array expected"; + for (var i = 0; i < message.valuesLists.length; ++i) { + var error = $root.pg_query.Node.verify(message.valuesLists[i]); + if (error) + return "valuesLists." + error; + } + } + if (message.sortClause != null && message.hasOwnProperty("sortClause")) { + if (!Array.isArray(message.sortClause)) + return "sortClause: array expected"; + for (var i = 0; i < message.sortClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.sortClause[i]); + if (error) + return "sortClause." + error; + } + } + if (message.limitOffset != null && message.hasOwnProperty("limitOffset")) { + var error = $root.pg_query.Node.verify(message.limitOffset); + if (error) + return "limitOffset." + error; + } + if (message.limitCount != null && message.hasOwnProperty("limitCount")) { + var error = $root.pg_query.Node.verify(message.limitCount); + if (error) + return "limitCount." + error; + } + if (message.limitOption != null && message.hasOwnProperty("limitOption")) + switch (message.limitOption) { + default: + return "limitOption: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.lockingClause != null && message.hasOwnProperty("lockingClause")) { + if (!Array.isArray(message.lockingClause)) + return "lockingClause: array expected"; + for (var i = 0; i < message.lockingClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.lockingClause[i]); + if (error) + return "lockingClause." + error; + } + } + if (message.withClause != null && message.hasOwnProperty("withClause")) { + var error = $root.pg_query.WithClause.verify(message.withClause); + if (error) + return "withClause." + error; + } + if (message.op != null && message.hasOwnProperty("op")) + switch (message.op) { + default: + return "op: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.all != null && message.hasOwnProperty("all")) + if (typeof message.all !== "boolean") + return "all: boolean expected"; + if (message.larg != null && message.hasOwnProperty("larg")) { + var error = $root.pg_query.SelectStmt.verify(message.larg); + if (error) + return "larg." + error; + } + if (message.rarg != null && message.hasOwnProperty("rarg")) { + var error = $root.pg_query.SelectStmt.verify(message.rarg); + if (error) + return "rarg." + error; + } + return null; + }; + + /** + * Creates a SelectStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.SelectStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.SelectStmt} SelectStmt + */ + SelectStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.SelectStmt) + return object; + var message = new $root.pg_query.SelectStmt(); + if (object.distinctClause) { + if (!Array.isArray(object.distinctClause)) + throw TypeError(".pg_query.SelectStmt.distinctClause: array expected"); + message.distinctClause = []; + for (var i = 0; i < object.distinctClause.length; ++i) { + if (typeof object.distinctClause[i] !== "object") + throw TypeError(".pg_query.SelectStmt.distinctClause: object expected"); + message.distinctClause[i] = $root.pg_query.Node.fromObject(object.distinctClause[i]); + } + } + if (object.intoClause != null) { + if (typeof object.intoClause !== "object") + throw TypeError(".pg_query.SelectStmt.intoClause: object expected"); + message.intoClause = $root.pg_query.IntoClause.fromObject(object.intoClause); + } + if (object.targetList) { + if (!Array.isArray(object.targetList)) + throw TypeError(".pg_query.SelectStmt.targetList: array expected"); + message.targetList = []; + for (var i = 0; i < object.targetList.length; ++i) { + if (typeof object.targetList[i] !== "object") + throw TypeError(".pg_query.SelectStmt.targetList: object expected"); + message.targetList[i] = $root.pg_query.Node.fromObject(object.targetList[i]); + } + } + if (object.fromClause) { + if (!Array.isArray(object.fromClause)) + throw TypeError(".pg_query.SelectStmt.fromClause: array expected"); + message.fromClause = []; + for (var i = 0; i < object.fromClause.length; ++i) { + if (typeof object.fromClause[i] !== "object") + throw TypeError(".pg_query.SelectStmt.fromClause: object expected"); + message.fromClause[i] = $root.pg_query.Node.fromObject(object.fromClause[i]); + } + } + if (object.whereClause != null) { + if (typeof object.whereClause !== "object") + throw TypeError(".pg_query.SelectStmt.whereClause: object expected"); + message.whereClause = $root.pg_query.Node.fromObject(object.whereClause); + } + if (object.groupClause) { + if (!Array.isArray(object.groupClause)) + throw TypeError(".pg_query.SelectStmt.groupClause: array expected"); + message.groupClause = []; + for (var i = 0; i < object.groupClause.length; ++i) { + if (typeof object.groupClause[i] !== "object") + throw TypeError(".pg_query.SelectStmt.groupClause: object expected"); + message.groupClause[i] = $root.pg_query.Node.fromObject(object.groupClause[i]); + } + } + if (object.havingClause != null) { + if (typeof object.havingClause !== "object") + throw TypeError(".pg_query.SelectStmt.havingClause: object expected"); + message.havingClause = $root.pg_query.Node.fromObject(object.havingClause); + } + if (object.windowClause) { + if (!Array.isArray(object.windowClause)) + throw TypeError(".pg_query.SelectStmt.windowClause: array expected"); + message.windowClause = []; + for (var i = 0; i < object.windowClause.length; ++i) { + if (typeof object.windowClause[i] !== "object") + throw TypeError(".pg_query.SelectStmt.windowClause: object expected"); + message.windowClause[i] = $root.pg_query.Node.fromObject(object.windowClause[i]); + } + } + if (object.valuesLists) { + if (!Array.isArray(object.valuesLists)) + throw TypeError(".pg_query.SelectStmt.valuesLists: array expected"); + message.valuesLists = []; + for (var i = 0; i < object.valuesLists.length; ++i) { + if (typeof object.valuesLists[i] !== "object") + throw TypeError(".pg_query.SelectStmt.valuesLists: object expected"); + message.valuesLists[i] = $root.pg_query.Node.fromObject(object.valuesLists[i]); + } + } + if (object.sortClause) { + if (!Array.isArray(object.sortClause)) + throw TypeError(".pg_query.SelectStmt.sortClause: array expected"); + message.sortClause = []; + for (var i = 0; i < object.sortClause.length; ++i) { + if (typeof object.sortClause[i] !== "object") + throw TypeError(".pg_query.SelectStmt.sortClause: object expected"); + message.sortClause[i] = $root.pg_query.Node.fromObject(object.sortClause[i]); + } + } + if (object.limitOffset != null) { + if (typeof object.limitOffset !== "object") + throw TypeError(".pg_query.SelectStmt.limitOffset: object expected"); + message.limitOffset = $root.pg_query.Node.fromObject(object.limitOffset); + } + if (object.limitCount != null) { + if (typeof object.limitCount !== "object") + throw TypeError(".pg_query.SelectStmt.limitCount: object expected"); + message.limitCount = $root.pg_query.Node.fromObject(object.limitCount); + } + switch (object.limitOption) { + default: + if (typeof object.limitOption === "number") { + message.limitOption = object.limitOption; + break; + } + break; + case "LIMIT_OPTION_UNDEFINED": + case 0: + message.limitOption = 0; + break; + case "LIMIT_OPTION_DEFAULT": + case 1: + message.limitOption = 1; + break; + case "LIMIT_OPTION_COUNT": + case 2: + message.limitOption = 2; + break; + case "LIMIT_OPTION_WITH_TIES": + case 3: + message.limitOption = 3; + break; + } + if (object.lockingClause) { + if (!Array.isArray(object.lockingClause)) + throw TypeError(".pg_query.SelectStmt.lockingClause: array expected"); + message.lockingClause = []; + for (var i = 0; i < object.lockingClause.length; ++i) { + if (typeof object.lockingClause[i] !== "object") + throw TypeError(".pg_query.SelectStmt.lockingClause: object expected"); + message.lockingClause[i] = $root.pg_query.Node.fromObject(object.lockingClause[i]); + } + } + if (object.withClause != null) { + if (typeof object.withClause !== "object") + throw TypeError(".pg_query.SelectStmt.withClause: object expected"); + message.withClause = $root.pg_query.WithClause.fromObject(object.withClause); + } + switch (object.op) { + default: + if (typeof object.op === "number") { + message.op = object.op; + break; + } + break; + case "SET_OPERATION_UNDEFINED": + case 0: + message.op = 0; + break; + case "SETOP_NONE": + case 1: + message.op = 1; + break; + case "SETOP_UNION": + case 2: + message.op = 2; + break; + case "SETOP_INTERSECT": + case 3: + message.op = 3; + break; + case "SETOP_EXCEPT": + case 4: + message.op = 4; + break; + } + if (object.all != null) + message.all = Boolean(object.all); + if (object.larg != null) { + if (typeof object.larg !== "object") + throw TypeError(".pg_query.SelectStmt.larg: object expected"); + message.larg = $root.pg_query.SelectStmt.fromObject(object.larg); + } + if (object.rarg != null) { + if (typeof object.rarg !== "object") + throw TypeError(".pg_query.SelectStmt.rarg: object expected"); + message.rarg = $root.pg_query.SelectStmt.fromObject(object.rarg); + } + return message; + }; + + /** + * Creates a plain object from a SelectStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.SelectStmt + * @static + * @param {pg_query.SelectStmt} message SelectStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.distinctClause = []; + object.targetList = []; + object.fromClause = []; + object.groupClause = []; + object.windowClause = []; + object.valuesLists = []; + object.sortClause = []; + object.lockingClause = []; + } + if (options.defaults) { + object.intoClause = null; + object.whereClause = null; + object.havingClause = null; + object.limitOffset = null; + object.limitCount = null; + object.limitOption = options.enums === String ? "LIMIT_OPTION_UNDEFINED" : 0; + object.withClause = null; + object.op = options.enums === String ? "SET_OPERATION_UNDEFINED" : 0; + object.all = false; + object.larg = null; + object.rarg = null; + } + if (message.distinctClause && message.distinctClause.length) { + object.distinctClause = []; + for (var j = 0; j < message.distinctClause.length; ++j) + object.distinctClause[j] = $root.pg_query.Node.toObject(message.distinctClause[j], options); + } + if (message.intoClause != null && message.hasOwnProperty("intoClause")) + object.intoClause = $root.pg_query.IntoClause.toObject(message.intoClause, options); + if (message.targetList && message.targetList.length) { + object.targetList = []; + for (var j = 0; j < message.targetList.length; ++j) + object.targetList[j] = $root.pg_query.Node.toObject(message.targetList[j], options); + } + if (message.fromClause && message.fromClause.length) { + object.fromClause = []; + for (var j = 0; j < message.fromClause.length; ++j) + object.fromClause[j] = $root.pg_query.Node.toObject(message.fromClause[j], options); + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) + object.whereClause = $root.pg_query.Node.toObject(message.whereClause, options); + if (message.groupClause && message.groupClause.length) { + object.groupClause = []; + for (var j = 0; j < message.groupClause.length; ++j) + object.groupClause[j] = $root.pg_query.Node.toObject(message.groupClause[j], options); + } + if (message.havingClause != null && message.hasOwnProperty("havingClause")) + object.havingClause = $root.pg_query.Node.toObject(message.havingClause, options); + if (message.windowClause && message.windowClause.length) { + object.windowClause = []; + for (var j = 0; j < message.windowClause.length; ++j) + object.windowClause[j] = $root.pg_query.Node.toObject(message.windowClause[j], options); + } + if (message.valuesLists && message.valuesLists.length) { + object.valuesLists = []; + for (var j = 0; j < message.valuesLists.length; ++j) + object.valuesLists[j] = $root.pg_query.Node.toObject(message.valuesLists[j], options); + } + if (message.sortClause && message.sortClause.length) { + object.sortClause = []; + for (var j = 0; j < message.sortClause.length; ++j) + object.sortClause[j] = $root.pg_query.Node.toObject(message.sortClause[j], options); + } + if (message.limitOffset != null && message.hasOwnProperty("limitOffset")) + object.limitOffset = $root.pg_query.Node.toObject(message.limitOffset, options); + if (message.limitCount != null && message.hasOwnProperty("limitCount")) + object.limitCount = $root.pg_query.Node.toObject(message.limitCount, options); + if (message.limitOption != null && message.hasOwnProperty("limitOption")) + object.limitOption = options.enums === String ? $root.pg_query.LimitOption[message.limitOption] === undefined ? message.limitOption : $root.pg_query.LimitOption[message.limitOption] : message.limitOption; + if (message.lockingClause && message.lockingClause.length) { + object.lockingClause = []; + for (var j = 0; j < message.lockingClause.length; ++j) + object.lockingClause[j] = $root.pg_query.Node.toObject(message.lockingClause[j], options); + } + if (message.withClause != null && message.hasOwnProperty("withClause")) + object.withClause = $root.pg_query.WithClause.toObject(message.withClause, options); + if (message.op != null && message.hasOwnProperty("op")) + object.op = options.enums === String ? $root.pg_query.SetOperation[message.op] === undefined ? message.op : $root.pg_query.SetOperation[message.op] : message.op; + if (message.all != null && message.hasOwnProperty("all")) + object.all = message.all; + if (message.larg != null && message.hasOwnProperty("larg")) + object.larg = $root.pg_query.SelectStmt.toObject(message.larg, options); + if (message.rarg != null && message.hasOwnProperty("rarg")) + object.rarg = $root.pg_query.SelectStmt.toObject(message.rarg, options); + return object; + }; + + /** + * Converts this SelectStmt to JSON. + * @function toJSON + * @memberof pg_query.SelectStmt + * @instance + * @returns {Object.} JSON object + */ + SelectStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SelectStmt + * @function getTypeUrl + * @memberof pg_query.SelectStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SelectStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.SelectStmt"; + }; + + return SelectStmt; + })(); + + pg_query.AlterTableStmt = (function() { + + /** + * Properties of an AlterTableStmt. + * @memberof pg_query + * @interface IAlterTableStmt + * @property {pg_query.IRangeVar|null} [relation] AlterTableStmt relation + * @property {Array.|null} [cmds] AlterTableStmt cmds + * @property {pg_query.ObjectType|null} [relkind] AlterTableStmt relkind + * @property {boolean|null} [missing_ok] AlterTableStmt missing_ok + */ + + /** + * Constructs a new AlterTableStmt. + * @memberof pg_query + * @classdesc Represents an AlterTableStmt. + * @implements IAlterTableStmt + * @constructor + * @param {pg_query.IAlterTableStmt=} [properties] Properties to set + */ + function AlterTableStmt(properties) { + this.cmds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterTableStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.AlterTableStmt + * @instance + */ + AlterTableStmt.prototype.relation = null; + + /** + * AlterTableStmt cmds. + * @member {Array.} cmds + * @memberof pg_query.AlterTableStmt + * @instance + */ + AlterTableStmt.prototype.cmds = $util.emptyArray; + + /** + * AlterTableStmt relkind. + * @member {pg_query.ObjectType} relkind + * @memberof pg_query.AlterTableStmt + * @instance + */ + AlterTableStmt.prototype.relkind = 0; + + /** + * AlterTableStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.AlterTableStmt + * @instance + */ + AlterTableStmt.prototype.missing_ok = false; + + /** + * Creates a new AlterTableStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterTableStmt + * @static + * @param {pg_query.IAlterTableStmt=} [properties] Properties to set + * @returns {pg_query.AlterTableStmt} AlterTableStmt instance + */ + AlterTableStmt.create = function create(properties) { + return new AlterTableStmt(properties); + }; + + /** + * Encodes the specified AlterTableStmt message. Does not implicitly {@link pg_query.AlterTableStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterTableStmt + * @static + * @param {pg_query.IAlterTableStmt} message AlterTableStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTableStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cmds != null && message.cmds.length) + for (var i = 0; i < message.cmds.length; ++i) + $root.pg_query.Node.encode(message.cmds[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.relkind != null && Object.hasOwnProperty.call(message, "relkind")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.relkind); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.missing_ok); + return writer; + }; + + /** + * Encodes the specified AlterTableStmt message, length delimited. Does not implicitly {@link pg_query.AlterTableStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterTableStmt + * @static + * @param {pg_query.IAlterTableStmt} message AlterTableStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTableStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterTableStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterTableStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterTableStmt} AlterTableStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTableStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterTableStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.cmds && message.cmds.length)) + message.cmds = []; + message.cmds.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.relkind = reader.int32(); + break; + } + case 4: { + message.missing_ok = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterTableStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterTableStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterTableStmt} AlterTableStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTableStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterTableStmt message. + * @function verify + * @memberof pg_query.AlterTableStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterTableStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.cmds != null && message.hasOwnProperty("cmds")) { + if (!Array.isArray(message.cmds)) + return "cmds: array expected"; + for (var i = 0; i < message.cmds.length; ++i) { + var error = $root.pg_query.Node.verify(message.cmds[i]); + if (error) + return "cmds." + error; + } + } + if (message.relkind != null && message.hasOwnProperty("relkind")) + switch (message.relkind) { + default: + return "relkind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + return null; + }; + + /** + * Creates an AlterTableStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterTableStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterTableStmt} AlterTableStmt + */ + AlterTableStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterTableStmt) + return object; + var message = new $root.pg_query.AlterTableStmt(); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.AlterTableStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.cmds) { + if (!Array.isArray(object.cmds)) + throw TypeError(".pg_query.AlterTableStmt.cmds: array expected"); + message.cmds = []; + for (var i = 0; i < object.cmds.length; ++i) { + if (typeof object.cmds[i] !== "object") + throw TypeError(".pg_query.AlterTableStmt.cmds: object expected"); + message.cmds[i] = $root.pg_query.Node.fromObject(object.cmds[i]); + } + } + switch (object.relkind) { + default: + if (typeof object.relkind === "number") { + message.relkind = object.relkind; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.relkind = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.relkind = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.relkind = 2; + break; + case "OBJECT_AMOP": + case 3: + message.relkind = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.relkind = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.relkind = 5; + break; + case "OBJECT_CAST": + case 6: + message.relkind = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.relkind = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.relkind = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.relkind = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.relkind = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.relkind = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.relkind = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.relkind = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.relkind = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.relkind = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.relkind = 16; + break; + case "OBJECT_FDW": + case 17: + message.relkind = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.relkind = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.relkind = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.relkind = 20; + break; + case "OBJECT_INDEX": + case 21: + message.relkind = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.relkind = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.relkind = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.relkind = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.relkind = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.relkind = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.relkind = 27; + break; + case "OBJECT_POLICY": + case 28: + message.relkind = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.relkind = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.relkind = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.relkind = 31; + break; + case "OBJECT_ROLE": + case 32: + message.relkind = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.relkind = 33; + break; + case "OBJECT_RULE": + case 34: + message.relkind = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.relkind = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.relkind = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.relkind = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.relkind = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.relkind = 39; + break; + case "OBJECT_TABLE": + case 40: + message.relkind = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.relkind = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.relkind = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.relkind = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.relkind = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.relkind = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.relkind = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.relkind = 47; + break; + case "OBJECT_TYPE": + case 48: + message.relkind = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.relkind = 49; + break; + case "OBJECT_VIEW": + case 50: + message.relkind = 50; + break; + } + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + return message; + }; + + /** + * Creates a plain object from an AlterTableStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterTableStmt + * @static + * @param {pg_query.AlterTableStmt} message AlterTableStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterTableStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cmds = []; + if (options.defaults) { + object.relation = null; + object.relkind = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.missing_ok = false; + } + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.cmds && message.cmds.length) { + object.cmds = []; + for (var j = 0; j < message.cmds.length; ++j) + object.cmds[j] = $root.pg_query.Node.toObject(message.cmds[j], options); + } + if (message.relkind != null && message.hasOwnProperty("relkind")) + object.relkind = options.enums === String ? $root.pg_query.ObjectType[message.relkind] === undefined ? message.relkind : $root.pg_query.ObjectType[message.relkind] : message.relkind; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + return object; + }; + + /** + * Converts this AlterTableStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterTableStmt + * @instance + * @returns {Object.} JSON object + */ + AlterTableStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterTableStmt + * @function getTypeUrl + * @memberof pg_query.AlterTableStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterTableStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterTableStmt"; + }; + + return AlterTableStmt; + })(); + + pg_query.AlterTableCmd = (function() { + + /** + * Properties of an AlterTableCmd. + * @memberof pg_query + * @interface IAlterTableCmd + * @property {pg_query.AlterTableType|null} [subtype] AlterTableCmd subtype + * @property {string|null} [name] AlterTableCmd name + * @property {number|null} [num] AlterTableCmd num + * @property {pg_query.IRoleSpec|null} [newowner] AlterTableCmd newowner + * @property {pg_query.INode|null} [def] AlterTableCmd def + * @property {pg_query.DropBehavior|null} [behavior] AlterTableCmd behavior + * @property {boolean|null} [missing_ok] AlterTableCmd missing_ok + * @property {boolean|null} [recurse] AlterTableCmd recurse + */ + + /** + * Constructs a new AlterTableCmd. + * @memberof pg_query + * @classdesc Represents an AlterTableCmd. + * @implements IAlterTableCmd + * @constructor + * @param {pg_query.IAlterTableCmd=} [properties] Properties to set + */ + function AlterTableCmd(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterTableCmd subtype. + * @member {pg_query.AlterTableType} subtype + * @memberof pg_query.AlterTableCmd + * @instance + */ + AlterTableCmd.prototype.subtype = 0; + + /** + * AlterTableCmd name. + * @member {string} name + * @memberof pg_query.AlterTableCmd + * @instance + */ + AlterTableCmd.prototype.name = ""; + + /** + * AlterTableCmd num. + * @member {number} num + * @memberof pg_query.AlterTableCmd + * @instance + */ + AlterTableCmd.prototype.num = 0; + + /** + * AlterTableCmd newowner. + * @member {pg_query.IRoleSpec|null|undefined} newowner + * @memberof pg_query.AlterTableCmd + * @instance + */ + AlterTableCmd.prototype.newowner = null; + + /** + * AlterTableCmd def. + * @member {pg_query.INode|null|undefined} def + * @memberof pg_query.AlterTableCmd + * @instance + */ + AlterTableCmd.prototype.def = null; + + /** + * AlterTableCmd behavior. + * @member {pg_query.DropBehavior} behavior + * @memberof pg_query.AlterTableCmd + * @instance + */ + AlterTableCmd.prototype.behavior = 0; + + /** + * AlterTableCmd missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.AlterTableCmd + * @instance + */ + AlterTableCmd.prototype.missing_ok = false; + + /** + * AlterTableCmd recurse. + * @member {boolean} recurse + * @memberof pg_query.AlterTableCmd + * @instance + */ + AlterTableCmd.prototype.recurse = false; + + /** + * Creates a new AlterTableCmd instance using the specified properties. + * @function create + * @memberof pg_query.AlterTableCmd + * @static + * @param {pg_query.IAlterTableCmd=} [properties] Properties to set + * @returns {pg_query.AlterTableCmd} AlterTableCmd instance + */ + AlterTableCmd.create = function create(properties) { + return new AlterTableCmd(properties); + }; + + /** + * Encodes the specified AlterTableCmd message. Does not implicitly {@link pg_query.AlterTableCmd.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterTableCmd + * @static + * @param {pg_query.IAlterTableCmd} message AlterTableCmd message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTableCmd.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subtype != null && Object.hasOwnProperty.call(message, "subtype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.subtype); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.num != null && Object.hasOwnProperty.call(message, "num")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.num); + if (message.newowner != null && Object.hasOwnProperty.call(message, "newowner")) + $root.pg_query.RoleSpec.encode(message.newowner, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.def != null && Object.hasOwnProperty.call(message, "def")) + $root.pg_query.Node.encode(message.def, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.behavior != null && Object.hasOwnProperty.call(message, "behavior")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.behavior); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.missing_ok); + if (message.recurse != null && Object.hasOwnProperty.call(message, "recurse")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.recurse); + return writer; + }; + + /** + * Encodes the specified AlterTableCmd message, length delimited. Does not implicitly {@link pg_query.AlterTableCmd.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterTableCmd + * @static + * @param {pg_query.IAlterTableCmd} message AlterTableCmd message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTableCmd.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterTableCmd message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterTableCmd + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterTableCmd} AlterTableCmd + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTableCmd.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterTableCmd(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subtype = reader.int32(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.num = reader.int32(); + break; + } + case 4: { + message.newowner = $root.pg_query.RoleSpec.decode(reader, reader.uint32()); + break; + } + case 5: { + message.def = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 6: { + message.behavior = reader.int32(); + break; + } + case 7: { + message.missing_ok = reader.bool(); + break; + } + case 8: { + message.recurse = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterTableCmd message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterTableCmd + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterTableCmd} AlterTableCmd + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTableCmd.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterTableCmd message. + * @function verify + * @memberof pg_query.AlterTableCmd + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterTableCmd.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subtype != null && message.hasOwnProperty("subtype")) + switch (message.subtype) { + default: + return "subtype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + break; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.num != null && message.hasOwnProperty("num")) + if (!$util.isInteger(message.num)) + return "num: integer expected"; + if (message.newowner != null && message.hasOwnProperty("newowner")) { + var error = $root.pg_query.RoleSpec.verify(message.newowner); + if (error) + return "newowner." + error; + } + if (message.def != null && message.hasOwnProperty("def")) { + var error = $root.pg_query.Node.verify(message.def); + if (error) + return "def." + error; + } + if (message.behavior != null && message.hasOwnProperty("behavior")) + switch (message.behavior) { + default: + return "behavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + if (message.recurse != null && message.hasOwnProperty("recurse")) + if (typeof message.recurse !== "boolean") + return "recurse: boolean expected"; + return null; + }; + + /** + * Creates an AlterTableCmd message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterTableCmd + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterTableCmd} AlterTableCmd + */ + AlterTableCmd.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterTableCmd) + return object; + var message = new $root.pg_query.AlterTableCmd(); + switch (object.subtype) { + default: + if (typeof object.subtype === "number") { + message.subtype = object.subtype; + break; + } + break; + case "ALTER_TABLE_TYPE_UNDEFINED": + case 0: + message.subtype = 0; + break; + case "AT_AddColumn": + case 1: + message.subtype = 1; + break; + case "AT_AddColumnRecurse": + case 2: + message.subtype = 2; + break; + case "AT_AddColumnToView": + case 3: + message.subtype = 3; + break; + case "AT_ColumnDefault": + case 4: + message.subtype = 4; + break; + case "AT_CookedColumnDefault": + case 5: + message.subtype = 5; + break; + case "AT_DropNotNull": + case 6: + message.subtype = 6; + break; + case "AT_SetNotNull": + case 7: + message.subtype = 7; + break; + case "AT_DropExpression": + case 8: + message.subtype = 8; + break; + case "AT_CheckNotNull": + case 9: + message.subtype = 9; + break; + case "AT_SetStatistics": + case 10: + message.subtype = 10; + break; + case "AT_SetOptions": + case 11: + message.subtype = 11; + break; + case "AT_ResetOptions": + case 12: + message.subtype = 12; + break; + case "AT_SetStorage": + case 13: + message.subtype = 13; + break; + case "AT_DropColumn": + case 14: + message.subtype = 14; + break; + case "AT_DropColumnRecurse": + case 15: + message.subtype = 15; + break; + case "AT_AddIndex": + case 16: + message.subtype = 16; + break; + case "AT_ReAddIndex": + case 17: + message.subtype = 17; + break; + case "AT_AddConstraint": + case 18: + message.subtype = 18; + break; + case "AT_AddConstraintRecurse": + case 19: + message.subtype = 19; + break; + case "AT_ReAddConstraint": + case 20: + message.subtype = 20; + break; + case "AT_ReAddDomainConstraint": + case 21: + message.subtype = 21; + break; + case "AT_AlterConstraint": + case 22: + message.subtype = 22; + break; + case "AT_ValidateConstraint": + case 23: + message.subtype = 23; + break; + case "AT_ValidateConstraintRecurse": + case 24: + message.subtype = 24; + break; + case "AT_AddIndexConstraint": + case 25: + message.subtype = 25; + break; + case "AT_DropConstraint": + case 26: + message.subtype = 26; + break; + case "AT_DropConstraintRecurse": + case 27: + message.subtype = 27; + break; + case "AT_ReAddComment": + case 28: + message.subtype = 28; + break; + case "AT_AlterColumnType": + case 29: + message.subtype = 29; + break; + case "AT_AlterColumnGenericOptions": + case 30: + message.subtype = 30; + break; + case "AT_ChangeOwner": + case 31: + message.subtype = 31; + break; + case "AT_ClusterOn": + case 32: + message.subtype = 32; + break; + case "AT_DropCluster": + case 33: + message.subtype = 33; + break; + case "AT_SetLogged": + case 34: + message.subtype = 34; + break; + case "AT_SetUnLogged": + case 35: + message.subtype = 35; + break; + case "AT_DropOids": + case 36: + message.subtype = 36; + break; + case "AT_SetTableSpace": + case 37: + message.subtype = 37; + break; + case "AT_SetRelOptions": + case 38: + message.subtype = 38; + break; + case "AT_ResetRelOptions": + case 39: + message.subtype = 39; + break; + case "AT_ReplaceRelOptions": + case 40: + message.subtype = 40; + break; + case "AT_EnableTrig": + case 41: + message.subtype = 41; + break; + case "AT_EnableAlwaysTrig": + case 42: + message.subtype = 42; + break; + case "AT_EnableReplicaTrig": + case 43: + message.subtype = 43; + break; + case "AT_DisableTrig": + case 44: + message.subtype = 44; + break; + case "AT_EnableTrigAll": + case 45: + message.subtype = 45; + break; + case "AT_DisableTrigAll": + case 46: + message.subtype = 46; + break; + case "AT_EnableTrigUser": + case 47: + message.subtype = 47; + break; + case "AT_DisableTrigUser": + case 48: + message.subtype = 48; + break; + case "AT_EnableRule": + case 49: + message.subtype = 49; + break; + case "AT_EnableAlwaysRule": + case 50: + message.subtype = 50; + break; + case "AT_EnableReplicaRule": + case 51: + message.subtype = 51; + break; + case "AT_DisableRule": + case 52: + message.subtype = 52; + break; + case "AT_AddInherit": + case 53: + message.subtype = 53; + break; + case "AT_DropInherit": + case 54: + message.subtype = 54; + break; + case "AT_AddOf": + case 55: + message.subtype = 55; + break; + case "AT_DropOf": + case 56: + message.subtype = 56; + break; + case "AT_ReplicaIdentity": + case 57: + message.subtype = 57; + break; + case "AT_EnableRowSecurity": + case 58: + message.subtype = 58; + break; + case "AT_DisableRowSecurity": + case 59: + message.subtype = 59; + break; + case "AT_ForceRowSecurity": + case 60: + message.subtype = 60; + break; + case "AT_NoForceRowSecurity": + case 61: + message.subtype = 61; + break; + case "AT_GenericOptions": + case 62: + message.subtype = 62; + break; + case "AT_AttachPartition": + case 63: + message.subtype = 63; + break; + case "AT_DetachPartition": + case 64: + message.subtype = 64; + break; + case "AT_AddIdentity": + case 65: + message.subtype = 65; + break; + case "AT_SetIdentity": + case 66: + message.subtype = 66; + break; + case "AT_DropIdentity": + case 67: + message.subtype = 67; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.num != null) + message.num = object.num | 0; + if (object.newowner != null) { + if (typeof object.newowner !== "object") + throw TypeError(".pg_query.AlterTableCmd.newowner: object expected"); + message.newowner = $root.pg_query.RoleSpec.fromObject(object.newowner); + } + if (object.def != null) { + if (typeof object.def !== "object") + throw TypeError(".pg_query.AlterTableCmd.def: object expected"); + message.def = $root.pg_query.Node.fromObject(object.def); + } + switch (object.behavior) { + default: + if (typeof object.behavior === "number") { + message.behavior = object.behavior; + break; + } + break; + case "DROP_BEHAVIOR_UNDEFINED": + case 0: + message.behavior = 0; + break; + case "DROP_RESTRICT": + case 1: + message.behavior = 1; + break; + case "DROP_CASCADE": + case 2: + message.behavior = 2; + break; + } + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + if (object.recurse != null) + message.recurse = Boolean(object.recurse); + return message; + }; + + /** + * Creates a plain object from an AlterTableCmd message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterTableCmd + * @static + * @param {pg_query.AlterTableCmd} message AlterTableCmd + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterTableCmd.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subtype = options.enums === String ? "ALTER_TABLE_TYPE_UNDEFINED" : 0; + object.name = ""; + object.num = 0; + object.newowner = null; + object.def = null; + object.behavior = options.enums === String ? "DROP_BEHAVIOR_UNDEFINED" : 0; + object.missing_ok = false; + object.recurse = false; + } + if (message.subtype != null && message.hasOwnProperty("subtype")) + object.subtype = options.enums === String ? $root.pg_query.AlterTableType[message.subtype] === undefined ? message.subtype : $root.pg_query.AlterTableType[message.subtype] : message.subtype; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.num != null && message.hasOwnProperty("num")) + object.num = message.num; + if (message.newowner != null && message.hasOwnProperty("newowner")) + object.newowner = $root.pg_query.RoleSpec.toObject(message.newowner, options); + if (message.def != null && message.hasOwnProperty("def")) + object.def = $root.pg_query.Node.toObject(message.def, options); + if (message.behavior != null && message.hasOwnProperty("behavior")) + object.behavior = options.enums === String ? $root.pg_query.DropBehavior[message.behavior] === undefined ? message.behavior : $root.pg_query.DropBehavior[message.behavior] : message.behavior; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + if (message.recurse != null && message.hasOwnProperty("recurse")) + object.recurse = message.recurse; + return object; + }; + + /** + * Converts this AlterTableCmd to JSON. + * @function toJSON + * @memberof pg_query.AlterTableCmd + * @instance + * @returns {Object.} JSON object + */ + AlterTableCmd.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterTableCmd + * @function getTypeUrl + * @memberof pg_query.AlterTableCmd + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterTableCmd.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterTableCmd"; + }; + + return AlterTableCmd; + })(); + + pg_query.AlterDomainStmt = (function() { + + /** + * Properties of an AlterDomainStmt. + * @memberof pg_query + * @interface IAlterDomainStmt + * @property {string|null} [subtype] AlterDomainStmt subtype + * @property {Array.|null} [typeName] AlterDomainStmt typeName + * @property {string|null} [name] AlterDomainStmt name + * @property {pg_query.INode|null} [def] AlterDomainStmt def + * @property {pg_query.DropBehavior|null} [behavior] AlterDomainStmt behavior + * @property {boolean|null} [missing_ok] AlterDomainStmt missing_ok + */ + + /** + * Constructs a new AlterDomainStmt. + * @memberof pg_query + * @classdesc Represents an AlterDomainStmt. + * @implements IAlterDomainStmt + * @constructor + * @param {pg_query.IAlterDomainStmt=} [properties] Properties to set + */ + function AlterDomainStmt(properties) { + this.typeName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterDomainStmt subtype. + * @member {string} subtype + * @memberof pg_query.AlterDomainStmt + * @instance + */ + AlterDomainStmt.prototype.subtype = ""; + + /** + * AlterDomainStmt typeName. + * @member {Array.} typeName + * @memberof pg_query.AlterDomainStmt + * @instance + */ + AlterDomainStmt.prototype.typeName = $util.emptyArray; + + /** + * AlterDomainStmt name. + * @member {string} name + * @memberof pg_query.AlterDomainStmt + * @instance + */ + AlterDomainStmt.prototype.name = ""; + + /** + * AlterDomainStmt def. + * @member {pg_query.INode|null|undefined} def + * @memberof pg_query.AlterDomainStmt + * @instance + */ + AlterDomainStmt.prototype.def = null; + + /** + * AlterDomainStmt behavior. + * @member {pg_query.DropBehavior} behavior + * @memberof pg_query.AlterDomainStmt + * @instance + */ + AlterDomainStmt.prototype.behavior = 0; + + /** + * AlterDomainStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.AlterDomainStmt + * @instance + */ + AlterDomainStmt.prototype.missing_ok = false; + + /** + * Creates a new AlterDomainStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterDomainStmt + * @static + * @param {pg_query.IAlterDomainStmt=} [properties] Properties to set + * @returns {pg_query.AlterDomainStmt} AlterDomainStmt instance + */ + AlterDomainStmt.create = function create(properties) { + return new AlterDomainStmt(properties); + }; + + /** + * Encodes the specified AlterDomainStmt message. Does not implicitly {@link pg_query.AlterDomainStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterDomainStmt + * @static + * @param {pg_query.IAlterDomainStmt} message AlterDomainStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterDomainStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subtype != null && Object.hasOwnProperty.call(message, "subtype")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subtype); + if (message.typeName != null && message.typeName.length) + for (var i = 0; i < message.typeName.length; ++i) + $root.pg_query.Node.encode(message.typeName[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.def != null && Object.hasOwnProperty.call(message, "def")) + $root.pg_query.Node.encode(message.def, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.behavior != null && Object.hasOwnProperty.call(message, "behavior")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.behavior); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.missing_ok); + return writer; + }; + + /** + * Encodes the specified AlterDomainStmt message, length delimited. Does not implicitly {@link pg_query.AlterDomainStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterDomainStmt + * @static + * @param {pg_query.IAlterDomainStmt} message AlterDomainStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterDomainStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterDomainStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterDomainStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterDomainStmt} AlterDomainStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterDomainStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterDomainStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subtype = reader.string(); + break; + } + case 2: { + if (!(message.typeName && message.typeName.length)) + message.typeName = []; + message.typeName.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 4: { + message.def = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + message.behavior = reader.int32(); + break; + } + case 6: { + message.missing_ok = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterDomainStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterDomainStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterDomainStmt} AlterDomainStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterDomainStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterDomainStmt message. + * @function verify + * @memberof pg_query.AlterDomainStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterDomainStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subtype != null && message.hasOwnProperty("subtype")) + if (!$util.isString(message.subtype)) + return "subtype: string expected"; + if (message.typeName != null && message.hasOwnProperty("typeName")) { + if (!Array.isArray(message.typeName)) + return "typeName: array expected"; + for (var i = 0; i < message.typeName.length; ++i) { + var error = $root.pg_query.Node.verify(message.typeName[i]); + if (error) + return "typeName." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.def != null && message.hasOwnProperty("def")) { + var error = $root.pg_query.Node.verify(message.def); + if (error) + return "def." + error; + } + if (message.behavior != null && message.hasOwnProperty("behavior")) + switch (message.behavior) { + default: + return "behavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + return null; + }; + + /** + * Creates an AlterDomainStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterDomainStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterDomainStmt} AlterDomainStmt + */ + AlterDomainStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterDomainStmt) + return object; + var message = new $root.pg_query.AlterDomainStmt(); + if (object.subtype != null) + message.subtype = String(object.subtype); + if (object.typeName) { + if (!Array.isArray(object.typeName)) + throw TypeError(".pg_query.AlterDomainStmt.typeName: array expected"); + message.typeName = []; + for (var i = 0; i < object.typeName.length; ++i) { + if (typeof object.typeName[i] !== "object") + throw TypeError(".pg_query.AlterDomainStmt.typeName: object expected"); + message.typeName[i] = $root.pg_query.Node.fromObject(object.typeName[i]); + } + } + if (object.name != null) + message.name = String(object.name); + if (object.def != null) { + if (typeof object.def !== "object") + throw TypeError(".pg_query.AlterDomainStmt.def: object expected"); + message.def = $root.pg_query.Node.fromObject(object.def); + } + switch (object.behavior) { + default: + if (typeof object.behavior === "number") { + message.behavior = object.behavior; + break; + } + break; + case "DROP_BEHAVIOR_UNDEFINED": + case 0: + message.behavior = 0; + break; + case "DROP_RESTRICT": + case 1: + message.behavior = 1; + break; + case "DROP_CASCADE": + case 2: + message.behavior = 2; + break; + } + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + return message; + }; + + /** + * Creates a plain object from an AlterDomainStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterDomainStmt + * @static + * @param {pg_query.AlterDomainStmt} message AlterDomainStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterDomainStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.typeName = []; + if (options.defaults) { + object.subtype = ""; + object.name = ""; + object.def = null; + object.behavior = options.enums === String ? "DROP_BEHAVIOR_UNDEFINED" : 0; + object.missing_ok = false; + } + if (message.subtype != null && message.hasOwnProperty("subtype")) + object.subtype = message.subtype; + if (message.typeName && message.typeName.length) { + object.typeName = []; + for (var j = 0; j < message.typeName.length; ++j) + object.typeName[j] = $root.pg_query.Node.toObject(message.typeName[j], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.def != null && message.hasOwnProperty("def")) + object.def = $root.pg_query.Node.toObject(message.def, options); + if (message.behavior != null && message.hasOwnProperty("behavior")) + object.behavior = options.enums === String ? $root.pg_query.DropBehavior[message.behavior] === undefined ? message.behavior : $root.pg_query.DropBehavior[message.behavior] : message.behavior; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + return object; + }; + + /** + * Converts this AlterDomainStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterDomainStmt + * @instance + * @returns {Object.} JSON object + */ + AlterDomainStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterDomainStmt + * @function getTypeUrl + * @memberof pg_query.AlterDomainStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterDomainStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterDomainStmt"; + }; + + return AlterDomainStmt; + })(); + + pg_query.SetOperationStmt = (function() { + + /** + * Properties of a SetOperationStmt. + * @memberof pg_query + * @interface ISetOperationStmt + * @property {pg_query.SetOperation|null} [op] SetOperationStmt op + * @property {boolean|null} [all] SetOperationStmt all + * @property {pg_query.INode|null} [larg] SetOperationStmt larg + * @property {pg_query.INode|null} [rarg] SetOperationStmt rarg + * @property {Array.|null} [colTypes] SetOperationStmt colTypes + * @property {Array.|null} [colTypmods] SetOperationStmt colTypmods + * @property {Array.|null} [colCollations] SetOperationStmt colCollations + * @property {Array.|null} [groupClauses] SetOperationStmt groupClauses + */ + + /** + * Constructs a new SetOperationStmt. + * @memberof pg_query + * @classdesc Represents a SetOperationStmt. + * @implements ISetOperationStmt + * @constructor + * @param {pg_query.ISetOperationStmt=} [properties] Properties to set + */ + function SetOperationStmt(properties) { + this.colTypes = []; + this.colTypmods = []; + this.colCollations = []; + this.groupClauses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetOperationStmt op. + * @member {pg_query.SetOperation} op + * @memberof pg_query.SetOperationStmt + * @instance + */ + SetOperationStmt.prototype.op = 0; + + /** + * SetOperationStmt all. + * @member {boolean} all + * @memberof pg_query.SetOperationStmt + * @instance + */ + SetOperationStmt.prototype.all = false; + + /** + * SetOperationStmt larg. + * @member {pg_query.INode|null|undefined} larg + * @memberof pg_query.SetOperationStmt + * @instance + */ + SetOperationStmt.prototype.larg = null; + + /** + * SetOperationStmt rarg. + * @member {pg_query.INode|null|undefined} rarg + * @memberof pg_query.SetOperationStmt + * @instance + */ + SetOperationStmt.prototype.rarg = null; + + /** + * SetOperationStmt colTypes. + * @member {Array.} colTypes + * @memberof pg_query.SetOperationStmt + * @instance + */ + SetOperationStmt.prototype.colTypes = $util.emptyArray; + + /** + * SetOperationStmt colTypmods. + * @member {Array.} colTypmods + * @memberof pg_query.SetOperationStmt + * @instance + */ + SetOperationStmt.prototype.colTypmods = $util.emptyArray; + + /** + * SetOperationStmt colCollations. + * @member {Array.} colCollations + * @memberof pg_query.SetOperationStmt + * @instance + */ + SetOperationStmt.prototype.colCollations = $util.emptyArray; + + /** + * SetOperationStmt groupClauses. + * @member {Array.} groupClauses + * @memberof pg_query.SetOperationStmt + * @instance + */ + SetOperationStmt.prototype.groupClauses = $util.emptyArray; + + /** + * Creates a new SetOperationStmt instance using the specified properties. + * @function create + * @memberof pg_query.SetOperationStmt + * @static + * @param {pg_query.ISetOperationStmt=} [properties] Properties to set + * @returns {pg_query.SetOperationStmt} SetOperationStmt instance + */ + SetOperationStmt.create = function create(properties) { + return new SetOperationStmt(properties); + }; + + /** + * Encodes the specified SetOperationStmt message. Does not implicitly {@link pg_query.SetOperationStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.SetOperationStmt + * @static + * @param {pg_query.ISetOperationStmt} message SetOperationStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetOperationStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.op != null && Object.hasOwnProperty.call(message, "op")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.op); + if (message.all != null && Object.hasOwnProperty.call(message, "all")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.all); + if (message.larg != null && Object.hasOwnProperty.call(message, "larg")) + $root.pg_query.Node.encode(message.larg, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rarg != null && Object.hasOwnProperty.call(message, "rarg")) + $root.pg_query.Node.encode(message.rarg, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.colTypes != null && message.colTypes.length) + for (var i = 0; i < message.colTypes.length; ++i) + $root.pg_query.Node.encode(message.colTypes[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.colTypmods != null && message.colTypmods.length) + for (var i = 0; i < message.colTypmods.length; ++i) + $root.pg_query.Node.encode(message.colTypmods[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.colCollations != null && message.colCollations.length) + for (var i = 0; i < message.colCollations.length; ++i) + $root.pg_query.Node.encode(message.colCollations[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.groupClauses != null && message.groupClauses.length) + for (var i = 0; i < message.groupClauses.length; ++i) + $root.pg_query.Node.encode(message.groupClauses[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetOperationStmt message, length delimited. Does not implicitly {@link pg_query.SetOperationStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.SetOperationStmt + * @static + * @param {pg_query.ISetOperationStmt} message SetOperationStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetOperationStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetOperationStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.SetOperationStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.SetOperationStmt} SetOperationStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetOperationStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.SetOperationStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.op = reader.int32(); + break; + } + case 2: { + message.all = reader.bool(); + break; + } + case 3: { + message.larg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.rarg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.colTypes && message.colTypes.length)) + message.colTypes = []; + message.colTypes.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.colTypmods && message.colTypmods.length)) + message.colTypmods = []; + message.colTypmods.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.colCollations && message.colCollations.length)) + message.colCollations = []; + message.colCollations.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.groupClauses && message.groupClauses.length)) + message.groupClauses = []; + message.groupClauses.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetOperationStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.SetOperationStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.SetOperationStmt} SetOperationStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetOperationStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetOperationStmt message. + * @function verify + * @memberof pg_query.SetOperationStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetOperationStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.op != null && message.hasOwnProperty("op")) + switch (message.op) { + default: + return "op: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.all != null && message.hasOwnProperty("all")) + if (typeof message.all !== "boolean") + return "all: boolean expected"; + if (message.larg != null && message.hasOwnProperty("larg")) { + var error = $root.pg_query.Node.verify(message.larg); + if (error) + return "larg." + error; + } + if (message.rarg != null && message.hasOwnProperty("rarg")) { + var error = $root.pg_query.Node.verify(message.rarg); + if (error) + return "rarg." + error; + } + if (message.colTypes != null && message.hasOwnProperty("colTypes")) { + if (!Array.isArray(message.colTypes)) + return "colTypes: array expected"; + for (var i = 0; i < message.colTypes.length; ++i) { + var error = $root.pg_query.Node.verify(message.colTypes[i]); + if (error) + return "colTypes." + error; + } + } + if (message.colTypmods != null && message.hasOwnProperty("colTypmods")) { + if (!Array.isArray(message.colTypmods)) + return "colTypmods: array expected"; + for (var i = 0; i < message.colTypmods.length; ++i) { + var error = $root.pg_query.Node.verify(message.colTypmods[i]); + if (error) + return "colTypmods." + error; + } + } + if (message.colCollations != null && message.hasOwnProperty("colCollations")) { + if (!Array.isArray(message.colCollations)) + return "colCollations: array expected"; + for (var i = 0; i < message.colCollations.length; ++i) { + var error = $root.pg_query.Node.verify(message.colCollations[i]); + if (error) + return "colCollations." + error; + } + } + if (message.groupClauses != null && message.hasOwnProperty("groupClauses")) { + if (!Array.isArray(message.groupClauses)) + return "groupClauses: array expected"; + for (var i = 0; i < message.groupClauses.length; ++i) { + var error = $root.pg_query.Node.verify(message.groupClauses[i]); + if (error) + return "groupClauses." + error; + } + } + return null; + }; + + /** + * Creates a SetOperationStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.SetOperationStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.SetOperationStmt} SetOperationStmt + */ + SetOperationStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.SetOperationStmt) + return object; + var message = new $root.pg_query.SetOperationStmt(); + switch (object.op) { + default: + if (typeof object.op === "number") { + message.op = object.op; + break; + } + break; + case "SET_OPERATION_UNDEFINED": + case 0: + message.op = 0; + break; + case "SETOP_NONE": + case 1: + message.op = 1; + break; + case "SETOP_UNION": + case 2: + message.op = 2; + break; + case "SETOP_INTERSECT": + case 3: + message.op = 3; + break; + case "SETOP_EXCEPT": + case 4: + message.op = 4; + break; + } + if (object.all != null) + message.all = Boolean(object.all); + if (object.larg != null) { + if (typeof object.larg !== "object") + throw TypeError(".pg_query.SetOperationStmt.larg: object expected"); + message.larg = $root.pg_query.Node.fromObject(object.larg); + } + if (object.rarg != null) { + if (typeof object.rarg !== "object") + throw TypeError(".pg_query.SetOperationStmt.rarg: object expected"); + message.rarg = $root.pg_query.Node.fromObject(object.rarg); + } + if (object.colTypes) { + if (!Array.isArray(object.colTypes)) + throw TypeError(".pg_query.SetOperationStmt.colTypes: array expected"); + message.colTypes = []; + for (var i = 0; i < object.colTypes.length; ++i) { + if (typeof object.colTypes[i] !== "object") + throw TypeError(".pg_query.SetOperationStmt.colTypes: object expected"); + message.colTypes[i] = $root.pg_query.Node.fromObject(object.colTypes[i]); + } + } + if (object.colTypmods) { + if (!Array.isArray(object.colTypmods)) + throw TypeError(".pg_query.SetOperationStmt.colTypmods: array expected"); + message.colTypmods = []; + for (var i = 0; i < object.colTypmods.length; ++i) { + if (typeof object.colTypmods[i] !== "object") + throw TypeError(".pg_query.SetOperationStmt.colTypmods: object expected"); + message.colTypmods[i] = $root.pg_query.Node.fromObject(object.colTypmods[i]); + } + } + if (object.colCollations) { + if (!Array.isArray(object.colCollations)) + throw TypeError(".pg_query.SetOperationStmt.colCollations: array expected"); + message.colCollations = []; + for (var i = 0; i < object.colCollations.length; ++i) { + if (typeof object.colCollations[i] !== "object") + throw TypeError(".pg_query.SetOperationStmt.colCollations: object expected"); + message.colCollations[i] = $root.pg_query.Node.fromObject(object.colCollations[i]); + } + } + if (object.groupClauses) { + if (!Array.isArray(object.groupClauses)) + throw TypeError(".pg_query.SetOperationStmt.groupClauses: array expected"); + message.groupClauses = []; + for (var i = 0; i < object.groupClauses.length; ++i) { + if (typeof object.groupClauses[i] !== "object") + throw TypeError(".pg_query.SetOperationStmt.groupClauses: object expected"); + message.groupClauses[i] = $root.pg_query.Node.fromObject(object.groupClauses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SetOperationStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.SetOperationStmt + * @static + * @param {pg_query.SetOperationStmt} message SetOperationStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetOperationStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.colTypes = []; + object.colTypmods = []; + object.colCollations = []; + object.groupClauses = []; + } + if (options.defaults) { + object.op = options.enums === String ? "SET_OPERATION_UNDEFINED" : 0; + object.all = false; + object.larg = null; + object.rarg = null; + } + if (message.op != null && message.hasOwnProperty("op")) + object.op = options.enums === String ? $root.pg_query.SetOperation[message.op] === undefined ? message.op : $root.pg_query.SetOperation[message.op] : message.op; + if (message.all != null && message.hasOwnProperty("all")) + object.all = message.all; + if (message.larg != null && message.hasOwnProperty("larg")) + object.larg = $root.pg_query.Node.toObject(message.larg, options); + if (message.rarg != null && message.hasOwnProperty("rarg")) + object.rarg = $root.pg_query.Node.toObject(message.rarg, options); + if (message.colTypes && message.colTypes.length) { + object.colTypes = []; + for (var j = 0; j < message.colTypes.length; ++j) + object.colTypes[j] = $root.pg_query.Node.toObject(message.colTypes[j], options); + } + if (message.colTypmods && message.colTypmods.length) { + object.colTypmods = []; + for (var j = 0; j < message.colTypmods.length; ++j) + object.colTypmods[j] = $root.pg_query.Node.toObject(message.colTypmods[j], options); + } + if (message.colCollations && message.colCollations.length) { + object.colCollations = []; + for (var j = 0; j < message.colCollations.length; ++j) + object.colCollations[j] = $root.pg_query.Node.toObject(message.colCollations[j], options); + } + if (message.groupClauses && message.groupClauses.length) { + object.groupClauses = []; + for (var j = 0; j < message.groupClauses.length; ++j) + object.groupClauses[j] = $root.pg_query.Node.toObject(message.groupClauses[j], options); + } + return object; + }; + + /** + * Converts this SetOperationStmt to JSON. + * @function toJSON + * @memberof pg_query.SetOperationStmt + * @instance + * @returns {Object.} JSON object + */ + SetOperationStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SetOperationStmt + * @function getTypeUrl + * @memberof pg_query.SetOperationStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SetOperationStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.SetOperationStmt"; + }; + + return SetOperationStmt; + })(); + + pg_query.GrantStmt = (function() { + + /** + * Properties of a GrantStmt. + * @memberof pg_query + * @interface IGrantStmt + * @property {boolean|null} [is_grant] GrantStmt is_grant + * @property {pg_query.GrantTargetType|null} [targtype] GrantStmt targtype + * @property {pg_query.ObjectType|null} [objtype] GrantStmt objtype + * @property {Array.|null} [objects] GrantStmt objects + * @property {Array.|null} [privileges] GrantStmt privileges + * @property {Array.|null} [grantees] GrantStmt grantees + * @property {boolean|null} [grant_option] GrantStmt grant_option + * @property {pg_query.DropBehavior|null} [behavior] GrantStmt behavior + */ + + /** + * Constructs a new GrantStmt. + * @memberof pg_query + * @classdesc Represents a GrantStmt. + * @implements IGrantStmt + * @constructor + * @param {pg_query.IGrantStmt=} [properties] Properties to set + */ + function GrantStmt(properties) { + this.objects = []; + this.privileges = []; + this.grantees = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GrantStmt is_grant. + * @member {boolean} is_grant + * @memberof pg_query.GrantStmt + * @instance + */ + GrantStmt.prototype.is_grant = false; + + /** + * GrantStmt targtype. + * @member {pg_query.GrantTargetType} targtype + * @memberof pg_query.GrantStmt + * @instance + */ + GrantStmt.prototype.targtype = 0; + + /** + * GrantStmt objtype. + * @member {pg_query.ObjectType} objtype + * @memberof pg_query.GrantStmt + * @instance + */ + GrantStmt.prototype.objtype = 0; + + /** + * GrantStmt objects. + * @member {Array.} objects + * @memberof pg_query.GrantStmt + * @instance + */ + GrantStmt.prototype.objects = $util.emptyArray; + + /** + * GrantStmt privileges. + * @member {Array.} privileges + * @memberof pg_query.GrantStmt + * @instance + */ + GrantStmt.prototype.privileges = $util.emptyArray; + + /** + * GrantStmt grantees. + * @member {Array.} grantees + * @memberof pg_query.GrantStmt + * @instance + */ + GrantStmt.prototype.grantees = $util.emptyArray; + + /** + * GrantStmt grant_option. + * @member {boolean} grant_option + * @memberof pg_query.GrantStmt + * @instance + */ + GrantStmt.prototype.grant_option = false; + + /** + * GrantStmt behavior. + * @member {pg_query.DropBehavior} behavior + * @memberof pg_query.GrantStmt + * @instance + */ + GrantStmt.prototype.behavior = 0; + + /** + * Creates a new GrantStmt instance using the specified properties. + * @function create + * @memberof pg_query.GrantStmt + * @static + * @param {pg_query.IGrantStmt=} [properties] Properties to set + * @returns {pg_query.GrantStmt} GrantStmt instance + */ + GrantStmt.create = function create(properties) { + return new GrantStmt(properties); + }; + + /** + * Encodes the specified GrantStmt message. Does not implicitly {@link pg_query.GrantStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.GrantStmt + * @static + * @param {pg_query.IGrantStmt} message GrantStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GrantStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.is_grant != null && Object.hasOwnProperty.call(message, "is_grant")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.is_grant); + if (message.targtype != null && Object.hasOwnProperty.call(message, "targtype")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.targtype); + if (message.objtype != null && Object.hasOwnProperty.call(message, "objtype")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.objtype); + if (message.objects != null && message.objects.length) + for (var i = 0; i < message.objects.length; ++i) + $root.pg_query.Node.encode(message.objects[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.privileges != null && message.privileges.length) + for (var i = 0; i < message.privileges.length; ++i) + $root.pg_query.Node.encode(message.privileges[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.grantees != null && message.grantees.length) + for (var i = 0; i < message.grantees.length; ++i) + $root.pg_query.Node.encode(message.grantees[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.grant_option != null && Object.hasOwnProperty.call(message, "grant_option")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.grant_option); + if (message.behavior != null && Object.hasOwnProperty.call(message, "behavior")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.behavior); + return writer; + }; + + /** + * Encodes the specified GrantStmt message, length delimited. Does not implicitly {@link pg_query.GrantStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.GrantStmt + * @static + * @param {pg_query.IGrantStmt} message GrantStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GrantStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GrantStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.GrantStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.GrantStmt} GrantStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GrantStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.GrantStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.is_grant = reader.bool(); + break; + } + case 2: { + message.targtype = reader.int32(); + break; + } + case 3: { + message.objtype = reader.int32(); + break; + } + case 4: { + if (!(message.objects && message.objects.length)) + message.objects = []; + message.objects.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.privileges && message.privileges.length)) + message.privileges = []; + message.privileges.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.grantees && message.grantees.length)) + message.grantees = []; + message.grantees.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + message.grant_option = reader.bool(); + break; + } + case 8: { + message.behavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GrantStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.GrantStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.GrantStmt} GrantStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GrantStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GrantStmt message. + * @function verify + * @memberof pg_query.GrantStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GrantStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.is_grant != null && message.hasOwnProperty("is_grant")) + if (typeof message.is_grant !== "boolean") + return "is_grant: boolean expected"; + if (message.targtype != null && message.hasOwnProperty("targtype")) + switch (message.targtype) { + default: + return "targtype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.objtype != null && message.hasOwnProperty("objtype")) + switch (message.objtype) { + default: + return "objtype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.objects != null && message.hasOwnProperty("objects")) { + if (!Array.isArray(message.objects)) + return "objects: array expected"; + for (var i = 0; i < message.objects.length; ++i) { + var error = $root.pg_query.Node.verify(message.objects[i]); + if (error) + return "objects." + error; + } + } + if (message.privileges != null && message.hasOwnProperty("privileges")) { + if (!Array.isArray(message.privileges)) + return "privileges: array expected"; + for (var i = 0; i < message.privileges.length; ++i) { + var error = $root.pg_query.Node.verify(message.privileges[i]); + if (error) + return "privileges." + error; + } + } + if (message.grantees != null && message.hasOwnProperty("grantees")) { + if (!Array.isArray(message.grantees)) + return "grantees: array expected"; + for (var i = 0; i < message.grantees.length; ++i) { + var error = $root.pg_query.Node.verify(message.grantees[i]); + if (error) + return "grantees." + error; + } + } + if (message.grant_option != null && message.hasOwnProperty("grant_option")) + if (typeof message.grant_option !== "boolean") + return "grant_option: boolean expected"; + if (message.behavior != null && message.hasOwnProperty("behavior")) + switch (message.behavior) { + default: + return "behavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GrantStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.GrantStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.GrantStmt} GrantStmt + */ + GrantStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.GrantStmt) + return object; + var message = new $root.pg_query.GrantStmt(); + if (object.is_grant != null) + message.is_grant = Boolean(object.is_grant); + switch (object.targtype) { + default: + if (typeof object.targtype === "number") { + message.targtype = object.targtype; + break; + } + break; + case "GRANT_TARGET_TYPE_UNDEFINED": + case 0: + message.targtype = 0; + break; + case "ACL_TARGET_OBJECT": + case 1: + message.targtype = 1; + break; + case "ACL_TARGET_ALL_IN_SCHEMA": + case 2: + message.targtype = 2; + break; + case "ACL_TARGET_DEFAULTS": + case 3: + message.targtype = 3; + break; + } + switch (object.objtype) { + default: + if (typeof object.objtype === "number") { + message.objtype = object.objtype; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.objtype = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.objtype = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.objtype = 2; + break; + case "OBJECT_AMOP": + case 3: + message.objtype = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.objtype = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.objtype = 5; + break; + case "OBJECT_CAST": + case 6: + message.objtype = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.objtype = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.objtype = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.objtype = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.objtype = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.objtype = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.objtype = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.objtype = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.objtype = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.objtype = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.objtype = 16; + break; + case "OBJECT_FDW": + case 17: + message.objtype = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.objtype = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.objtype = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.objtype = 20; + break; + case "OBJECT_INDEX": + case 21: + message.objtype = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.objtype = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.objtype = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.objtype = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.objtype = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.objtype = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.objtype = 27; + break; + case "OBJECT_POLICY": + case 28: + message.objtype = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.objtype = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.objtype = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.objtype = 31; + break; + case "OBJECT_ROLE": + case 32: + message.objtype = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.objtype = 33; + break; + case "OBJECT_RULE": + case 34: + message.objtype = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.objtype = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.objtype = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.objtype = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.objtype = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.objtype = 39; + break; + case "OBJECT_TABLE": + case 40: + message.objtype = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.objtype = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.objtype = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.objtype = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.objtype = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.objtype = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.objtype = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.objtype = 47; + break; + case "OBJECT_TYPE": + case 48: + message.objtype = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.objtype = 49; + break; + case "OBJECT_VIEW": + case 50: + message.objtype = 50; + break; + } + if (object.objects) { + if (!Array.isArray(object.objects)) + throw TypeError(".pg_query.GrantStmt.objects: array expected"); + message.objects = []; + for (var i = 0; i < object.objects.length; ++i) { + if (typeof object.objects[i] !== "object") + throw TypeError(".pg_query.GrantStmt.objects: object expected"); + message.objects[i] = $root.pg_query.Node.fromObject(object.objects[i]); + } + } + if (object.privileges) { + if (!Array.isArray(object.privileges)) + throw TypeError(".pg_query.GrantStmt.privileges: array expected"); + message.privileges = []; + for (var i = 0; i < object.privileges.length; ++i) { + if (typeof object.privileges[i] !== "object") + throw TypeError(".pg_query.GrantStmt.privileges: object expected"); + message.privileges[i] = $root.pg_query.Node.fromObject(object.privileges[i]); + } + } + if (object.grantees) { + if (!Array.isArray(object.grantees)) + throw TypeError(".pg_query.GrantStmt.grantees: array expected"); + message.grantees = []; + for (var i = 0; i < object.grantees.length; ++i) { + if (typeof object.grantees[i] !== "object") + throw TypeError(".pg_query.GrantStmt.grantees: object expected"); + message.grantees[i] = $root.pg_query.Node.fromObject(object.grantees[i]); + } + } + if (object.grant_option != null) + message.grant_option = Boolean(object.grant_option); + switch (object.behavior) { + default: + if (typeof object.behavior === "number") { + message.behavior = object.behavior; + break; + } + break; + case "DROP_BEHAVIOR_UNDEFINED": + case 0: + message.behavior = 0; + break; + case "DROP_RESTRICT": + case 1: + message.behavior = 1; + break; + case "DROP_CASCADE": + case 2: + message.behavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GrantStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.GrantStmt + * @static + * @param {pg_query.GrantStmt} message GrantStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GrantStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.objects = []; + object.privileges = []; + object.grantees = []; + } + if (options.defaults) { + object.is_grant = false; + object.targtype = options.enums === String ? "GRANT_TARGET_TYPE_UNDEFINED" : 0; + object.objtype = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.grant_option = false; + object.behavior = options.enums === String ? "DROP_BEHAVIOR_UNDEFINED" : 0; + } + if (message.is_grant != null && message.hasOwnProperty("is_grant")) + object.is_grant = message.is_grant; + if (message.targtype != null && message.hasOwnProperty("targtype")) + object.targtype = options.enums === String ? $root.pg_query.GrantTargetType[message.targtype] === undefined ? message.targtype : $root.pg_query.GrantTargetType[message.targtype] : message.targtype; + if (message.objtype != null && message.hasOwnProperty("objtype")) + object.objtype = options.enums === String ? $root.pg_query.ObjectType[message.objtype] === undefined ? message.objtype : $root.pg_query.ObjectType[message.objtype] : message.objtype; + if (message.objects && message.objects.length) { + object.objects = []; + for (var j = 0; j < message.objects.length; ++j) + object.objects[j] = $root.pg_query.Node.toObject(message.objects[j], options); + } + if (message.privileges && message.privileges.length) { + object.privileges = []; + for (var j = 0; j < message.privileges.length; ++j) + object.privileges[j] = $root.pg_query.Node.toObject(message.privileges[j], options); + } + if (message.grantees && message.grantees.length) { + object.grantees = []; + for (var j = 0; j < message.grantees.length; ++j) + object.grantees[j] = $root.pg_query.Node.toObject(message.grantees[j], options); + } + if (message.grant_option != null && message.hasOwnProperty("grant_option")) + object.grant_option = message.grant_option; + if (message.behavior != null && message.hasOwnProperty("behavior")) + object.behavior = options.enums === String ? $root.pg_query.DropBehavior[message.behavior] === undefined ? message.behavior : $root.pg_query.DropBehavior[message.behavior] : message.behavior; + return object; + }; + + /** + * Converts this GrantStmt to JSON. + * @function toJSON + * @memberof pg_query.GrantStmt + * @instance + * @returns {Object.} JSON object + */ + GrantStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GrantStmt + * @function getTypeUrl + * @memberof pg_query.GrantStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GrantStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.GrantStmt"; + }; + + return GrantStmt; + })(); + + pg_query.GrantRoleStmt = (function() { + + /** + * Properties of a GrantRoleStmt. + * @memberof pg_query + * @interface IGrantRoleStmt + * @property {Array.|null} [granted_roles] GrantRoleStmt granted_roles + * @property {Array.|null} [grantee_roles] GrantRoleStmt grantee_roles + * @property {boolean|null} [is_grant] GrantRoleStmt is_grant + * @property {boolean|null} [admin_opt] GrantRoleStmt admin_opt + * @property {pg_query.IRoleSpec|null} [grantor] GrantRoleStmt grantor + * @property {pg_query.DropBehavior|null} [behavior] GrantRoleStmt behavior + */ + + /** + * Constructs a new GrantRoleStmt. + * @memberof pg_query + * @classdesc Represents a GrantRoleStmt. + * @implements IGrantRoleStmt + * @constructor + * @param {pg_query.IGrantRoleStmt=} [properties] Properties to set + */ + function GrantRoleStmt(properties) { + this.granted_roles = []; + this.grantee_roles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GrantRoleStmt granted_roles. + * @member {Array.} granted_roles + * @memberof pg_query.GrantRoleStmt + * @instance + */ + GrantRoleStmt.prototype.granted_roles = $util.emptyArray; + + /** + * GrantRoleStmt grantee_roles. + * @member {Array.} grantee_roles + * @memberof pg_query.GrantRoleStmt + * @instance + */ + GrantRoleStmt.prototype.grantee_roles = $util.emptyArray; + + /** + * GrantRoleStmt is_grant. + * @member {boolean} is_grant + * @memberof pg_query.GrantRoleStmt + * @instance + */ + GrantRoleStmt.prototype.is_grant = false; + + /** + * GrantRoleStmt admin_opt. + * @member {boolean} admin_opt + * @memberof pg_query.GrantRoleStmt + * @instance + */ + GrantRoleStmt.prototype.admin_opt = false; + + /** + * GrantRoleStmt grantor. + * @member {pg_query.IRoleSpec|null|undefined} grantor + * @memberof pg_query.GrantRoleStmt + * @instance + */ + GrantRoleStmt.prototype.grantor = null; + + /** + * GrantRoleStmt behavior. + * @member {pg_query.DropBehavior} behavior + * @memberof pg_query.GrantRoleStmt + * @instance + */ + GrantRoleStmt.prototype.behavior = 0; + + /** + * Creates a new GrantRoleStmt instance using the specified properties. + * @function create + * @memberof pg_query.GrantRoleStmt + * @static + * @param {pg_query.IGrantRoleStmt=} [properties] Properties to set + * @returns {pg_query.GrantRoleStmt} GrantRoleStmt instance + */ + GrantRoleStmt.create = function create(properties) { + return new GrantRoleStmt(properties); + }; + + /** + * Encodes the specified GrantRoleStmt message. Does not implicitly {@link pg_query.GrantRoleStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.GrantRoleStmt + * @static + * @param {pg_query.IGrantRoleStmt} message GrantRoleStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GrantRoleStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.granted_roles != null && message.granted_roles.length) + for (var i = 0; i < message.granted_roles.length; ++i) + $root.pg_query.Node.encode(message.granted_roles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.grantee_roles != null && message.grantee_roles.length) + for (var i = 0; i < message.grantee_roles.length; ++i) + $root.pg_query.Node.encode(message.grantee_roles[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.is_grant != null && Object.hasOwnProperty.call(message, "is_grant")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.is_grant); + if (message.admin_opt != null && Object.hasOwnProperty.call(message, "admin_opt")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.admin_opt); + if (message.grantor != null && Object.hasOwnProperty.call(message, "grantor")) + $root.pg_query.RoleSpec.encode(message.grantor, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.behavior != null && Object.hasOwnProperty.call(message, "behavior")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.behavior); + return writer; + }; + + /** + * Encodes the specified GrantRoleStmt message, length delimited. Does not implicitly {@link pg_query.GrantRoleStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.GrantRoleStmt + * @static + * @param {pg_query.IGrantRoleStmt} message GrantRoleStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GrantRoleStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GrantRoleStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.GrantRoleStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.GrantRoleStmt} GrantRoleStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GrantRoleStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.GrantRoleStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.granted_roles && message.granted_roles.length)) + message.granted_roles = []; + message.granted_roles.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.grantee_roles && message.grantee_roles.length)) + message.grantee_roles = []; + message.grantee_roles.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.is_grant = reader.bool(); + break; + } + case 4: { + message.admin_opt = reader.bool(); + break; + } + case 5: { + message.grantor = $root.pg_query.RoleSpec.decode(reader, reader.uint32()); + break; + } + case 6: { + message.behavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GrantRoleStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.GrantRoleStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.GrantRoleStmt} GrantRoleStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GrantRoleStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GrantRoleStmt message. + * @function verify + * @memberof pg_query.GrantRoleStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GrantRoleStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.granted_roles != null && message.hasOwnProperty("granted_roles")) { + if (!Array.isArray(message.granted_roles)) + return "granted_roles: array expected"; + for (var i = 0; i < message.granted_roles.length; ++i) { + var error = $root.pg_query.Node.verify(message.granted_roles[i]); + if (error) + return "granted_roles." + error; + } + } + if (message.grantee_roles != null && message.hasOwnProperty("grantee_roles")) { + if (!Array.isArray(message.grantee_roles)) + return "grantee_roles: array expected"; + for (var i = 0; i < message.grantee_roles.length; ++i) { + var error = $root.pg_query.Node.verify(message.grantee_roles[i]); + if (error) + return "grantee_roles." + error; + } + } + if (message.is_grant != null && message.hasOwnProperty("is_grant")) + if (typeof message.is_grant !== "boolean") + return "is_grant: boolean expected"; + if (message.admin_opt != null && message.hasOwnProperty("admin_opt")) + if (typeof message.admin_opt !== "boolean") + return "admin_opt: boolean expected"; + if (message.grantor != null && message.hasOwnProperty("grantor")) { + var error = $root.pg_query.RoleSpec.verify(message.grantor); + if (error) + return "grantor." + error; + } + if (message.behavior != null && message.hasOwnProperty("behavior")) + switch (message.behavior) { + default: + return "behavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GrantRoleStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.GrantRoleStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.GrantRoleStmt} GrantRoleStmt + */ + GrantRoleStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.GrantRoleStmt) + return object; + var message = new $root.pg_query.GrantRoleStmt(); + if (object.granted_roles) { + if (!Array.isArray(object.granted_roles)) + throw TypeError(".pg_query.GrantRoleStmt.granted_roles: array expected"); + message.granted_roles = []; + for (var i = 0; i < object.granted_roles.length; ++i) { + if (typeof object.granted_roles[i] !== "object") + throw TypeError(".pg_query.GrantRoleStmt.granted_roles: object expected"); + message.granted_roles[i] = $root.pg_query.Node.fromObject(object.granted_roles[i]); + } + } + if (object.grantee_roles) { + if (!Array.isArray(object.grantee_roles)) + throw TypeError(".pg_query.GrantRoleStmt.grantee_roles: array expected"); + message.grantee_roles = []; + for (var i = 0; i < object.grantee_roles.length; ++i) { + if (typeof object.grantee_roles[i] !== "object") + throw TypeError(".pg_query.GrantRoleStmt.grantee_roles: object expected"); + message.grantee_roles[i] = $root.pg_query.Node.fromObject(object.grantee_roles[i]); + } + } + if (object.is_grant != null) + message.is_grant = Boolean(object.is_grant); + if (object.admin_opt != null) + message.admin_opt = Boolean(object.admin_opt); + if (object.grantor != null) { + if (typeof object.grantor !== "object") + throw TypeError(".pg_query.GrantRoleStmt.grantor: object expected"); + message.grantor = $root.pg_query.RoleSpec.fromObject(object.grantor); + } + switch (object.behavior) { + default: + if (typeof object.behavior === "number") { + message.behavior = object.behavior; + break; + } + break; + case "DROP_BEHAVIOR_UNDEFINED": + case 0: + message.behavior = 0; + break; + case "DROP_RESTRICT": + case 1: + message.behavior = 1; + break; + case "DROP_CASCADE": + case 2: + message.behavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GrantRoleStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.GrantRoleStmt + * @static + * @param {pg_query.GrantRoleStmt} message GrantRoleStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GrantRoleStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.granted_roles = []; + object.grantee_roles = []; + } + if (options.defaults) { + object.is_grant = false; + object.admin_opt = false; + object.grantor = null; + object.behavior = options.enums === String ? "DROP_BEHAVIOR_UNDEFINED" : 0; + } + if (message.granted_roles && message.granted_roles.length) { + object.granted_roles = []; + for (var j = 0; j < message.granted_roles.length; ++j) + object.granted_roles[j] = $root.pg_query.Node.toObject(message.granted_roles[j], options); + } + if (message.grantee_roles && message.grantee_roles.length) { + object.grantee_roles = []; + for (var j = 0; j < message.grantee_roles.length; ++j) + object.grantee_roles[j] = $root.pg_query.Node.toObject(message.grantee_roles[j], options); + } + if (message.is_grant != null && message.hasOwnProperty("is_grant")) + object.is_grant = message.is_grant; + if (message.admin_opt != null && message.hasOwnProperty("admin_opt")) + object.admin_opt = message.admin_opt; + if (message.grantor != null && message.hasOwnProperty("grantor")) + object.grantor = $root.pg_query.RoleSpec.toObject(message.grantor, options); + if (message.behavior != null && message.hasOwnProperty("behavior")) + object.behavior = options.enums === String ? $root.pg_query.DropBehavior[message.behavior] === undefined ? message.behavior : $root.pg_query.DropBehavior[message.behavior] : message.behavior; + return object; + }; + + /** + * Converts this GrantRoleStmt to JSON. + * @function toJSON + * @memberof pg_query.GrantRoleStmt + * @instance + * @returns {Object.} JSON object + */ + GrantRoleStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GrantRoleStmt + * @function getTypeUrl + * @memberof pg_query.GrantRoleStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GrantRoleStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.GrantRoleStmt"; + }; + + return GrantRoleStmt; + })(); + + pg_query.AlterDefaultPrivilegesStmt = (function() { + + /** + * Properties of an AlterDefaultPrivilegesStmt. + * @memberof pg_query + * @interface IAlterDefaultPrivilegesStmt + * @property {Array.|null} [options] AlterDefaultPrivilegesStmt options + * @property {pg_query.IGrantStmt|null} [action] AlterDefaultPrivilegesStmt action + */ + + /** + * Constructs a new AlterDefaultPrivilegesStmt. + * @memberof pg_query + * @classdesc Represents an AlterDefaultPrivilegesStmt. + * @implements IAlterDefaultPrivilegesStmt + * @constructor + * @param {pg_query.IAlterDefaultPrivilegesStmt=} [properties] Properties to set + */ + function AlterDefaultPrivilegesStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterDefaultPrivilegesStmt options. + * @member {Array.} options + * @memberof pg_query.AlterDefaultPrivilegesStmt + * @instance + */ + AlterDefaultPrivilegesStmt.prototype.options = $util.emptyArray; + + /** + * AlterDefaultPrivilegesStmt action. + * @member {pg_query.IGrantStmt|null|undefined} action + * @memberof pg_query.AlterDefaultPrivilegesStmt + * @instance + */ + AlterDefaultPrivilegesStmt.prototype.action = null; + + /** + * Creates a new AlterDefaultPrivilegesStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterDefaultPrivilegesStmt + * @static + * @param {pg_query.IAlterDefaultPrivilegesStmt=} [properties] Properties to set + * @returns {pg_query.AlterDefaultPrivilegesStmt} AlterDefaultPrivilegesStmt instance + */ + AlterDefaultPrivilegesStmt.create = function create(properties) { + return new AlterDefaultPrivilegesStmt(properties); + }; + + /** + * Encodes the specified AlterDefaultPrivilegesStmt message. Does not implicitly {@link pg_query.AlterDefaultPrivilegesStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterDefaultPrivilegesStmt + * @static + * @param {pg_query.IAlterDefaultPrivilegesStmt} message AlterDefaultPrivilegesStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterDefaultPrivilegesStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.pg_query.GrantStmt.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterDefaultPrivilegesStmt message, length delimited. Does not implicitly {@link pg_query.AlterDefaultPrivilegesStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterDefaultPrivilegesStmt + * @static + * @param {pg_query.IAlterDefaultPrivilegesStmt} message AlterDefaultPrivilegesStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterDefaultPrivilegesStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterDefaultPrivilegesStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterDefaultPrivilegesStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterDefaultPrivilegesStmt} AlterDefaultPrivilegesStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterDefaultPrivilegesStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterDefaultPrivilegesStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.action = $root.pg_query.GrantStmt.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterDefaultPrivilegesStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterDefaultPrivilegesStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterDefaultPrivilegesStmt} AlterDefaultPrivilegesStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterDefaultPrivilegesStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterDefaultPrivilegesStmt message. + * @function verify + * @memberof pg_query.AlterDefaultPrivilegesStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterDefaultPrivilegesStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.action != null && message.hasOwnProperty("action")) { + var error = $root.pg_query.GrantStmt.verify(message.action); + if (error) + return "action." + error; + } + return null; + }; + + /** + * Creates an AlterDefaultPrivilegesStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterDefaultPrivilegesStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterDefaultPrivilegesStmt} AlterDefaultPrivilegesStmt + */ + AlterDefaultPrivilegesStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterDefaultPrivilegesStmt) + return object; + var message = new $root.pg_query.AlterDefaultPrivilegesStmt(); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterDefaultPrivilegesStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterDefaultPrivilegesStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".pg_query.AlterDefaultPrivilegesStmt.action: object expected"); + message.action = $root.pg_query.GrantStmt.fromObject(object.action); + } + return message; + }; + + /** + * Creates a plain object from an AlterDefaultPrivilegesStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterDefaultPrivilegesStmt + * @static + * @param {pg_query.AlterDefaultPrivilegesStmt} message AlterDefaultPrivilegesStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterDefaultPrivilegesStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) + object.action = null; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = $root.pg_query.GrantStmt.toObject(message.action, options); + return object; + }; + + /** + * Converts this AlterDefaultPrivilegesStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterDefaultPrivilegesStmt + * @instance + * @returns {Object.} JSON object + */ + AlterDefaultPrivilegesStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterDefaultPrivilegesStmt + * @function getTypeUrl + * @memberof pg_query.AlterDefaultPrivilegesStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterDefaultPrivilegesStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterDefaultPrivilegesStmt"; + }; + + return AlterDefaultPrivilegesStmt; + })(); + + pg_query.ClosePortalStmt = (function() { + + /** + * Properties of a ClosePortalStmt. + * @memberof pg_query + * @interface IClosePortalStmt + * @property {string|null} [portalname] ClosePortalStmt portalname + */ + + /** + * Constructs a new ClosePortalStmt. + * @memberof pg_query + * @classdesc Represents a ClosePortalStmt. + * @implements IClosePortalStmt + * @constructor + * @param {pg_query.IClosePortalStmt=} [properties] Properties to set + */ + function ClosePortalStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClosePortalStmt portalname. + * @member {string} portalname + * @memberof pg_query.ClosePortalStmt + * @instance + */ + ClosePortalStmt.prototype.portalname = ""; + + /** + * Creates a new ClosePortalStmt instance using the specified properties. + * @function create + * @memberof pg_query.ClosePortalStmt + * @static + * @param {pg_query.IClosePortalStmt=} [properties] Properties to set + * @returns {pg_query.ClosePortalStmt} ClosePortalStmt instance + */ + ClosePortalStmt.create = function create(properties) { + return new ClosePortalStmt(properties); + }; + + /** + * Encodes the specified ClosePortalStmt message. Does not implicitly {@link pg_query.ClosePortalStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.ClosePortalStmt + * @static + * @param {pg_query.IClosePortalStmt} message ClosePortalStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClosePortalStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portalname != null && Object.hasOwnProperty.call(message, "portalname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portalname); + return writer; + }; + + /** + * Encodes the specified ClosePortalStmt message, length delimited. Does not implicitly {@link pg_query.ClosePortalStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ClosePortalStmt + * @static + * @param {pg_query.IClosePortalStmt} message ClosePortalStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClosePortalStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClosePortalStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ClosePortalStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ClosePortalStmt} ClosePortalStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClosePortalStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ClosePortalStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.portalname = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClosePortalStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ClosePortalStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ClosePortalStmt} ClosePortalStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClosePortalStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClosePortalStmt message. + * @function verify + * @memberof pg_query.ClosePortalStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClosePortalStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portalname != null && message.hasOwnProperty("portalname")) + if (!$util.isString(message.portalname)) + return "portalname: string expected"; + return null; + }; + + /** + * Creates a ClosePortalStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ClosePortalStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ClosePortalStmt} ClosePortalStmt + */ + ClosePortalStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ClosePortalStmt) + return object; + var message = new $root.pg_query.ClosePortalStmt(); + if (object.portalname != null) + message.portalname = String(object.portalname); + return message; + }; + + /** + * Creates a plain object from a ClosePortalStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ClosePortalStmt + * @static + * @param {pg_query.ClosePortalStmt} message ClosePortalStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClosePortalStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.portalname = ""; + if (message.portalname != null && message.hasOwnProperty("portalname")) + object.portalname = message.portalname; + return object; + }; + + /** + * Converts this ClosePortalStmt to JSON. + * @function toJSON + * @memberof pg_query.ClosePortalStmt + * @instance + * @returns {Object.} JSON object + */ + ClosePortalStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClosePortalStmt + * @function getTypeUrl + * @memberof pg_query.ClosePortalStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClosePortalStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ClosePortalStmt"; + }; + + return ClosePortalStmt; + })(); + + pg_query.ClusterStmt = (function() { + + /** + * Properties of a ClusterStmt. + * @memberof pg_query + * @interface IClusterStmt + * @property {pg_query.IRangeVar|null} [relation] ClusterStmt relation + * @property {string|null} [indexname] ClusterStmt indexname + * @property {number|null} [options] ClusterStmt options + */ + + /** + * Constructs a new ClusterStmt. + * @memberof pg_query + * @classdesc Represents a ClusterStmt. + * @implements IClusterStmt + * @constructor + * @param {pg_query.IClusterStmt=} [properties] Properties to set + */ + function ClusterStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.ClusterStmt + * @instance + */ + ClusterStmt.prototype.relation = null; + + /** + * ClusterStmt indexname. + * @member {string} indexname + * @memberof pg_query.ClusterStmt + * @instance + */ + ClusterStmt.prototype.indexname = ""; + + /** + * ClusterStmt options. + * @member {number} options + * @memberof pg_query.ClusterStmt + * @instance + */ + ClusterStmt.prototype.options = 0; + + /** + * Creates a new ClusterStmt instance using the specified properties. + * @function create + * @memberof pg_query.ClusterStmt + * @static + * @param {pg_query.IClusterStmt=} [properties] Properties to set + * @returns {pg_query.ClusterStmt} ClusterStmt instance + */ + ClusterStmt.create = function create(properties) { + return new ClusterStmt(properties); + }; + + /** + * Encodes the specified ClusterStmt message. Does not implicitly {@link pg_query.ClusterStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.ClusterStmt + * @static + * @param {pg_query.IClusterStmt} message ClusterStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.indexname != null && Object.hasOwnProperty.call(message, "indexname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.indexname); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.options); + return writer; + }; + + /** + * Encodes the specified ClusterStmt message, length delimited. Does not implicitly {@link pg_query.ClusterStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ClusterStmt + * @static + * @param {pg_query.IClusterStmt} message ClusterStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ClusterStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ClusterStmt} ClusterStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ClusterStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + message.indexname = reader.string(); + break; + } + case 3: { + message.options = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ClusterStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ClusterStmt} ClusterStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterStmt message. + * @function verify + * @memberof pg_query.ClusterStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.indexname != null && message.hasOwnProperty("indexname")) + if (!$util.isString(message.indexname)) + return "indexname: string expected"; + if (message.options != null && message.hasOwnProperty("options")) + if (!$util.isInteger(message.options)) + return "options: integer expected"; + return null; + }; + + /** + * Creates a ClusterStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ClusterStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ClusterStmt} ClusterStmt + */ + ClusterStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ClusterStmt) + return object; + var message = new $root.pg_query.ClusterStmt(); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.ClusterStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.indexname != null) + message.indexname = String(object.indexname); + if (object.options != null) + message.options = object.options | 0; + return message; + }; + + /** + * Creates a plain object from a ClusterStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ClusterStmt + * @static + * @param {pg_query.ClusterStmt} message ClusterStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.relation = null; + object.indexname = ""; + object.options = 0; + } + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.indexname != null && message.hasOwnProperty("indexname")) + object.indexname = message.indexname; + if (message.options != null && message.hasOwnProperty("options")) + object.options = message.options; + return object; + }; + + /** + * Converts this ClusterStmt to JSON. + * @function toJSON + * @memberof pg_query.ClusterStmt + * @instance + * @returns {Object.} JSON object + */ + ClusterStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterStmt + * @function getTypeUrl + * @memberof pg_query.ClusterStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ClusterStmt"; + }; + + return ClusterStmt; + })(); + + pg_query.CopyStmt = (function() { + + /** + * Properties of a CopyStmt. + * @memberof pg_query + * @interface ICopyStmt + * @property {pg_query.IRangeVar|null} [relation] CopyStmt relation + * @property {pg_query.INode|null} [query] CopyStmt query + * @property {Array.|null} [attlist] CopyStmt attlist + * @property {boolean|null} [is_from] CopyStmt is_from + * @property {boolean|null} [is_program] CopyStmt is_program + * @property {string|null} [filename] CopyStmt filename + * @property {Array.|null} [options] CopyStmt options + * @property {pg_query.INode|null} [whereClause] CopyStmt whereClause + */ + + /** + * Constructs a new CopyStmt. + * @memberof pg_query + * @classdesc Represents a CopyStmt. + * @implements ICopyStmt + * @constructor + * @param {pg_query.ICopyStmt=} [properties] Properties to set + */ + function CopyStmt(properties) { + this.attlist = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CopyStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.CopyStmt + * @instance + */ + CopyStmt.prototype.relation = null; + + /** + * CopyStmt query. + * @member {pg_query.INode|null|undefined} query + * @memberof pg_query.CopyStmt + * @instance + */ + CopyStmt.prototype.query = null; + + /** + * CopyStmt attlist. + * @member {Array.} attlist + * @memberof pg_query.CopyStmt + * @instance + */ + CopyStmt.prototype.attlist = $util.emptyArray; + + /** + * CopyStmt is_from. + * @member {boolean} is_from + * @memberof pg_query.CopyStmt + * @instance + */ + CopyStmt.prototype.is_from = false; + + /** + * CopyStmt is_program. + * @member {boolean} is_program + * @memberof pg_query.CopyStmt + * @instance + */ + CopyStmt.prototype.is_program = false; + + /** + * CopyStmt filename. + * @member {string} filename + * @memberof pg_query.CopyStmt + * @instance + */ + CopyStmt.prototype.filename = ""; + + /** + * CopyStmt options. + * @member {Array.} options + * @memberof pg_query.CopyStmt + * @instance + */ + CopyStmt.prototype.options = $util.emptyArray; + + /** + * CopyStmt whereClause. + * @member {pg_query.INode|null|undefined} whereClause + * @memberof pg_query.CopyStmt + * @instance + */ + CopyStmt.prototype.whereClause = null; + + /** + * Creates a new CopyStmt instance using the specified properties. + * @function create + * @memberof pg_query.CopyStmt + * @static + * @param {pg_query.ICopyStmt=} [properties] Properties to set + * @returns {pg_query.CopyStmt} CopyStmt instance + */ + CopyStmt.create = function create(properties) { + return new CopyStmt(properties); + }; + + /** + * Encodes the specified CopyStmt message. Does not implicitly {@link pg_query.CopyStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CopyStmt + * @static + * @param {pg_query.ICopyStmt} message CopyStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.pg_query.Node.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.attlist != null && message.attlist.length) + for (var i = 0; i < message.attlist.length; ++i) + $root.pg_query.Node.encode(message.attlist[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.is_from != null && Object.hasOwnProperty.call(message, "is_from")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.is_from); + if (message.is_program != null && Object.hasOwnProperty.call(message, "is_program")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.is_program); + if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.filename); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.whereClause != null && Object.hasOwnProperty.call(message, "whereClause")) + $root.pg_query.Node.encode(message.whereClause, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CopyStmt message, length delimited. Does not implicitly {@link pg_query.CopyStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CopyStmt + * @static + * @param {pg_query.ICopyStmt} message CopyStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CopyStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CopyStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CopyStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CopyStmt} CopyStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CopyStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + message.query = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.attlist && message.attlist.length)) + message.attlist = []; + message.attlist.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.is_from = reader.bool(); + break; + } + case 5: { + message.is_program = reader.bool(); + break; + } + case 6: { + message.filename = reader.string(); + break; + } + case 7: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 8: { + message.whereClause = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CopyStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CopyStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CopyStmt} CopyStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CopyStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CopyStmt message. + * @function verify + * @memberof pg_query.CopyStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CopyStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.pg_query.Node.verify(message.query); + if (error) + return "query." + error; + } + if (message.attlist != null && message.hasOwnProperty("attlist")) { + if (!Array.isArray(message.attlist)) + return "attlist: array expected"; + for (var i = 0; i < message.attlist.length; ++i) { + var error = $root.pg_query.Node.verify(message.attlist[i]); + if (error) + return "attlist." + error; + } + } + if (message.is_from != null && message.hasOwnProperty("is_from")) + if (typeof message.is_from !== "boolean") + return "is_from: boolean expected"; + if (message.is_program != null && message.hasOwnProperty("is_program")) + if (typeof message.is_program !== "boolean") + return "is_program: boolean expected"; + if (message.filename != null && message.hasOwnProperty("filename")) + if (!$util.isString(message.filename)) + return "filename: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) { + var error = $root.pg_query.Node.verify(message.whereClause); + if (error) + return "whereClause." + error; + } + return null; + }; + + /** + * Creates a CopyStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CopyStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CopyStmt} CopyStmt + */ + CopyStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CopyStmt) + return object; + var message = new $root.pg_query.CopyStmt(); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.CopyStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".pg_query.CopyStmt.query: object expected"); + message.query = $root.pg_query.Node.fromObject(object.query); + } + if (object.attlist) { + if (!Array.isArray(object.attlist)) + throw TypeError(".pg_query.CopyStmt.attlist: array expected"); + message.attlist = []; + for (var i = 0; i < object.attlist.length; ++i) { + if (typeof object.attlist[i] !== "object") + throw TypeError(".pg_query.CopyStmt.attlist: object expected"); + message.attlist[i] = $root.pg_query.Node.fromObject(object.attlist[i]); + } + } + if (object.is_from != null) + message.is_from = Boolean(object.is_from); + if (object.is_program != null) + message.is_program = Boolean(object.is_program); + if (object.filename != null) + message.filename = String(object.filename); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CopyStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CopyStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.whereClause != null) { + if (typeof object.whereClause !== "object") + throw TypeError(".pg_query.CopyStmt.whereClause: object expected"); + message.whereClause = $root.pg_query.Node.fromObject(object.whereClause); + } + return message; + }; + + /** + * Creates a plain object from a CopyStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CopyStmt + * @static + * @param {pg_query.CopyStmt} message CopyStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CopyStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.attlist = []; + object.options = []; + } + if (options.defaults) { + object.relation = null; + object.query = null; + object.is_from = false; + object.is_program = false; + object.filename = ""; + object.whereClause = null; + } + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.pg_query.Node.toObject(message.query, options); + if (message.attlist && message.attlist.length) { + object.attlist = []; + for (var j = 0; j < message.attlist.length; ++j) + object.attlist[j] = $root.pg_query.Node.toObject(message.attlist[j], options); + } + if (message.is_from != null && message.hasOwnProperty("is_from")) + object.is_from = message.is_from; + if (message.is_program != null && message.hasOwnProperty("is_program")) + object.is_program = message.is_program; + if (message.filename != null && message.hasOwnProperty("filename")) + object.filename = message.filename; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) + object.whereClause = $root.pg_query.Node.toObject(message.whereClause, options); + return object; + }; + + /** + * Converts this CopyStmt to JSON. + * @function toJSON + * @memberof pg_query.CopyStmt + * @instance + * @returns {Object.} JSON object + */ + CopyStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CopyStmt + * @function getTypeUrl + * @memberof pg_query.CopyStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CopyStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CopyStmt"; + }; + + return CopyStmt; + })(); + + pg_query.CreateStmt = (function() { + + /** + * Properties of a CreateStmt. + * @memberof pg_query + * @interface ICreateStmt + * @property {pg_query.IRangeVar|null} [relation] CreateStmt relation + * @property {Array.|null} [tableElts] CreateStmt tableElts + * @property {Array.|null} [inhRelations] CreateStmt inhRelations + * @property {pg_query.IPartitionBoundSpec|null} [partbound] CreateStmt partbound + * @property {pg_query.IPartitionSpec|null} [partspec] CreateStmt partspec + * @property {pg_query.ITypeName|null} [ofTypename] CreateStmt ofTypename + * @property {Array.|null} [constraints] CreateStmt constraints + * @property {Array.|null} [options] CreateStmt options + * @property {pg_query.OnCommitAction|null} [oncommit] CreateStmt oncommit + * @property {string|null} [tablespacename] CreateStmt tablespacename + * @property {string|null} [accessMethod] CreateStmt accessMethod + * @property {boolean|null} [if_not_exists] CreateStmt if_not_exists + */ + + /** + * Constructs a new CreateStmt. + * @memberof pg_query + * @classdesc Represents a CreateStmt. + * @implements ICreateStmt + * @constructor + * @param {pg_query.ICreateStmt=} [properties] Properties to set + */ + function CreateStmt(properties) { + this.tableElts = []; + this.inhRelations = []; + this.constraints = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.CreateStmt + * @instance + */ + CreateStmt.prototype.relation = null; + + /** + * CreateStmt tableElts. + * @member {Array.} tableElts + * @memberof pg_query.CreateStmt + * @instance + */ + CreateStmt.prototype.tableElts = $util.emptyArray; + + /** + * CreateStmt inhRelations. + * @member {Array.} inhRelations + * @memberof pg_query.CreateStmt + * @instance + */ + CreateStmt.prototype.inhRelations = $util.emptyArray; + + /** + * CreateStmt partbound. + * @member {pg_query.IPartitionBoundSpec|null|undefined} partbound + * @memberof pg_query.CreateStmt + * @instance + */ + CreateStmt.prototype.partbound = null; + + /** + * CreateStmt partspec. + * @member {pg_query.IPartitionSpec|null|undefined} partspec + * @memberof pg_query.CreateStmt + * @instance + */ + CreateStmt.prototype.partspec = null; + + /** + * CreateStmt ofTypename. + * @member {pg_query.ITypeName|null|undefined} ofTypename + * @memberof pg_query.CreateStmt + * @instance + */ + CreateStmt.prototype.ofTypename = null; + + /** + * CreateStmt constraints. + * @member {Array.} constraints + * @memberof pg_query.CreateStmt + * @instance + */ + CreateStmt.prototype.constraints = $util.emptyArray; + + /** + * CreateStmt options. + * @member {Array.} options + * @memberof pg_query.CreateStmt + * @instance + */ + CreateStmt.prototype.options = $util.emptyArray; + + /** + * CreateStmt oncommit. + * @member {pg_query.OnCommitAction} oncommit + * @memberof pg_query.CreateStmt + * @instance + */ + CreateStmt.prototype.oncommit = 0; + + /** + * CreateStmt tablespacename. + * @member {string} tablespacename + * @memberof pg_query.CreateStmt + * @instance + */ + CreateStmt.prototype.tablespacename = ""; + + /** + * CreateStmt accessMethod. + * @member {string} accessMethod + * @memberof pg_query.CreateStmt + * @instance + */ + CreateStmt.prototype.accessMethod = ""; + + /** + * CreateStmt if_not_exists. + * @member {boolean} if_not_exists + * @memberof pg_query.CreateStmt + * @instance + */ + CreateStmt.prototype.if_not_exists = false; + + /** + * Creates a new CreateStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateStmt + * @static + * @param {pg_query.ICreateStmt=} [properties] Properties to set + * @returns {pg_query.CreateStmt} CreateStmt instance + */ + CreateStmt.create = function create(properties) { + return new CreateStmt(properties); + }; + + /** + * Encodes the specified CreateStmt message. Does not implicitly {@link pg_query.CreateStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateStmt + * @static + * @param {pg_query.ICreateStmt} message CreateStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tableElts != null && message.tableElts.length) + for (var i = 0; i < message.tableElts.length; ++i) + $root.pg_query.Node.encode(message.tableElts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inhRelations != null && message.inhRelations.length) + for (var i = 0; i < message.inhRelations.length; ++i) + $root.pg_query.Node.encode(message.inhRelations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.partbound != null && Object.hasOwnProperty.call(message, "partbound")) + $root.pg_query.PartitionBoundSpec.encode(message.partbound, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.partspec != null && Object.hasOwnProperty.call(message, "partspec")) + $root.pg_query.PartitionSpec.encode(message.partspec, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.ofTypename != null && Object.hasOwnProperty.call(message, "ofTypename")) + $root.pg_query.TypeName.encode(message.ofTypename, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.constraints != null && message.constraints.length) + for (var i = 0; i < message.constraints.length; ++i) + $root.pg_query.Node.encode(message.constraints[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oncommit != null && Object.hasOwnProperty.call(message, "oncommit")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oncommit); + if (message.tablespacename != null && Object.hasOwnProperty.call(message, "tablespacename")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.tablespacename); + if (message.accessMethod != null && Object.hasOwnProperty.call(message, "accessMethod")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.accessMethod); + if (message.if_not_exists != null && Object.hasOwnProperty.call(message, "if_not_exists")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.if_not_exists); + return writer; + }; + + /** + * Encodes the specified CreateStmt message, length delimited. Does not implicitly {@link pg_query.CreateStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateStmt + * @static + * @param {pg_query.ICreateStmt} message CreateStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateStmt} CreateStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.tableElts && message.tableElts.length)) + message.tableElts = []; + message.tableElts.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.inhRelations && message.inhRelations.length)) + message.inhRelations = []; + message.inhRelations.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.partbound = $root.pg_query.PartitionBoundSpec.decode(reader, reader.uint32()); + break; + } + case 5: { + message.partspec = $root.pg_query.PartitionSpec.decode(reader, reader.uint32()); + break; + } + case 6: { + message.ofTypename = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.constraints && message.constraints.length)) + message.constraints = []; + message.constraints.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 9: { + message.oncommit = reader.int32(); + break; + } + case 10: { + message.tablespacename = reader.string(); + break; + } + case 11: { + message.accessMethod = reader.string(); + break; + } + case 12: { + message.if_not_exists = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateStmt} CreateStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateStmt message. + * @function verify + * @memberof pg_query.CreateStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.tableElts != null && message.hasOwnProperty("tableElts")) { + if (!Array.isArray(message.tableElts)) + return "tableElts: array expected"; + for (var i = 0; i < message.tableElts.length; ++i) { + var error = $root.pg_query.Node.verify(message.tableElts[i]); + if (error) + return "tableElts." + error; + } + } + if (message.inhRelations != null && message.hasOwnProperty("inhRelations")) { + if (!Array.isArray(message.inhRelations)) + return "inhRelations: array expected"; + for (var i = 0; i < message.inhRelations.length; ++i) { + var error = $root.pg_query.Node.verify(message.inhRelations[i]); + if (error) + return "inhRelations." + error; + } + } + if (message.partbound != null && message.hasOwnProperty("partbound")) { + var error = $root.pg_query.PartitionBoundSpec.verify(message.partbound); + if (error) + return "partbound." + error; + } + if (message.partspec != null && message.hasOwnProperty("partspec")) { + var error = $root.pg_query.PartitionSpec.verify(message.partspec); + if (error) + return "partspec." + error; + } + if (message.ofTypename != null && message.hasOwnProperty("ofTypename")) { + var error = $root.pg_query.TypeName.verify(message.ofTypename); + if (error) + return "ofTypename." + error; + } + if (message.constraints != null && message.hasOwnProperty("constraints")) { + if (!Array.isArray(message.constraints)) + return "constraints: array expected"; + for (var i = 0; i < message.constraints.length; ++i) { + var error = $root.pg_query.Node.verify(message.constraints[i]); + if (error) + return "constraints." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.oncommit != null && message.hasOwnProperty("oncommit")) + switch (message.oncommit) { + default: + return "oncommit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.tablespacename != null && message.hasOwnProperty("tablespacename")) + if (!$util.isString(message.tablespacename)) + return "tablespacename: string expected"; + if (message.accessMethod != null && message.hasOwnProperty("accessMethod")) + if (!$util.isString(message.accessMethod)) + return "accessMethod: string expected"; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + if (typeof message.if_not_exists !== "boolean") + return "if_not_exists: boolean expected"; + return null; + }; + + /** + * Creates a CreateStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateStmt} CreateStmt + */ + CreateStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateStmt) + return object; + var message = new $root.pg_query.CreateStmt(); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.CreateStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.tableElts) { + if (!Array.isArray(object.tableElts)) + throw TypeError(".pg_query.CreateStmt.tableElts: array expected"); + message.tableElts = []; + for (var i = 0; i < object.tableElts.length; ++i) { + if (typeof object.tableElts[i] !== "object") + throw TypeError(".pg_query.CreateStmt.tableElts: object expected"); + message.tableElts[i] = $root.pg_query.Node.fromObject(object.tableElts[i]); + } + } + if (object.inhRelations) { + if (!Array.isArray(object.inhRelations)) + throw TypeError(".pg_query.CreateStmt.inhRelations: array expected"); + message.inhRelations = []; + for (var i = 0; i < object.inhRelations.length; ++i) { + if (typeof object.inhRelations[i] !== "object") + throw TypeError(".pg_query.CreateStmt.inhRelations: object expected"); + message.inhRelations[i] = $root.pg_query.Node.fromObject(object.inhRelations[i]); + } + } + if (object.partbound != null) { + if (typeof object.partbound !== "object") + throw TypeError(".pg_query.CreateStmt.partbound: object expected"); + message.partbound = $root.pg_query.PartitionBoundSpec.fromObject(object.partbound); + } + if (object.partspec != null) { + if (typeof object.partspec !== "object") + throw TypeError(".pg_query.CreateStmt.partspec: object expected"); + message.partspec = $root.pg_query.PartitionSpec.fromObject(object.partspec); + } + if (object.ofTypename != null) { + if (typeof object.ofTypename !== "object") + throw TypeError(".pg_query.CreateStmt.ofTypename: object expected"); + message.ofTypename = $root.pg_query.TypeName.fromObject(object.ofTypename); + } + if (object.constraints) { + if (!Array.isArray(object.constraints)) + throw TypeError(".pg_query.CreateStmt.constraints: array expected"); + message.constraints = []; + for (var i = 0; i < object.constraints.length; ++i) { + if (typeof object.constraints[i] !== "object") + throw TypeError(".pg_query.CreateStmt.constraints: object expected"); + message.constraints[i] = $root.pg_query.Node.fromObject(object.constraints[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreateStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreateStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + switch (object.oncommit) { + default: + if (typeof object.oncommit === "number") { + message.oncommit = object.oncommit; + break; + } + break; + case "ON_COMMIT_ACTION_UNDEFINED": + case 0: + message.oncommit = 0; + break; + case "ONCOMMIT_NOOP": + case 1: + message.oncommit = 1; + break; + case "ONCOMMIT_PRESERVE_ROWS": + case 2: + message.oncommit = 2; + break; + case "ONCOMMIT_DELETE_ROWS": + case 3: + message.oncommit = 3; + break; + case "ONCOMMIT_DROP": + case 4: + message.oncommit = 4; + break; + } + if (object.tablespacename != null) + message.tablespacename = String(object.tablespacename); + if (object.accessMethod != null) + message.accessMethod = String(object.accessMethod); + if (object.if_not_exists != null) + message.if_not_exists = Boolean(object.if_not_exists); + return message; + }; + + /** + * Creates a plain object from a CreateStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateStmt + * @static + * @param {pg_query.CreateStmt} message CreateStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.tableElts = []; + object.inhRelations = []; + object.constraints = []; + object.options = []; + } + if (options.defaults) { + object.relation = null; + object.partbound = null; + object.partspec = null; + object.ofTypename = null; + object.oncommit = options.enums === String ? "ON_COMMIT_ACTION_UNDEFINED" : 0; + object.tablespacename = ""; + object.accessMethod = ""; + object.if_not_exists = false; + } + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.tableElts && message.tableElts.length) { + object.tableElts = []; + for (var j = 0; j < message.tableElts.length; ++j) + object.tableElts[j] = $root.pg_query.Node.toObject(message.tableElts[j], options); + } + if (message.inhRelations && message.inhRelations.length) { + object.inhRelations = []; + for (var j = 0; j < message.inhRelations.length; ++j) + object.inhRelations[j] = $root.pg_query.Node.toObject(message.inhRelations[j], options); + } + if (message.partbound != null && message.hasOwnProperty("partbound")) + object.partbound = $root.pg_query.PartitionBoundSpec.toObject(message.partbound, options); + if (message.partspec != null && message.hasOwnProperty("partspec")) + object.partspec = $root.pg_query.PartitionSpec.toObject(message.partspec, options); + if (message.ofTypename != null && message.hasOwnProperty("ofTypename")) + object.ofTypename = $root.pg_query.TypeName.toObject(message.ofTypename, options); + if (message.constraints && message.constraints.length) { + object.constraints = []; + for (var j = 0; j < message.constraints.length; ++j) + object.constraints[j] = $root.pg_query.Node.toObject(message.constraints[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.oncommit != null && message.hasOwnProperty("oncommit")) + object.oncommit = options.enums === String ? $root.pg_query.OnCommitAction[message.oncommit] === undefined ? message.oncommit : $root.pg_query.OnCommitAction[message.oncommit] : message.oncommit; + if (message.tablespacename != null && message.hasOwnProperty("tablespacename")) + object.tablespacename = message.tablespacename; + if (message.accessMethod != null && message.hasOwnProperty("accessMethod")) + object.accessMethod = message.accessMethod; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + object.if_not_exists = message.if_not_exists; + return object; + }; + + /** + * Converts this CreateStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateStmt + * @instance + * @returns {Object.} JSON object + */ + CreateStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateStmt + * @function getTypeUrl + * @memberof pg_query.CreateStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateStmt"; + }; + + return CreateStmt; + })(); + + pg_query.DefineStmt = (function() { + + /** + * Properties of a DefineStmt. + * @memberof pg_query + * @interface IDefineStmt + * @property {pg_query.ObjectType|null} [kind] DefineStmt kind + * @property {boolean|null} [oldstyle] DefineStmt oldstyle + * @property {Array.|null} [defnames] DefineStmt defnames + * @property {Array.|null} [args] DefineStmt args + * @property {Array.|null} [definition] DefineStmt definition + * @property {boolean|null} [if_not_exists] DefineStmt if_not_exists + * @property {boolean|null} [replace] DefineStmt replace + */ + + /** + * Constructs a new DefineStmt. + * @memberof pg_query + * @classdesc Represents a DefineStmt. + * @implements IDefineStmt + * @constructor + * @param {pg_query.IDefineStmt=} [properties] Properties to set + */ + function DefineStmt(properties) { + this.defnames = []; + this.args = []; + this.definition = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DefineStmt kind. + * @member {pg_query.ObjectType} kind + * @memberof pg_query.DefineStmt + * @instance + */ + DefineStmt.prototype.kind = 0; + + /** + * DefineStmt oldstyle. + * @member {boolean} oldstyle + * @memberof pg_query.DefineStmt + * @instance + */ + DefineStmt.prototype.oldstyle = false; + + /** + * DefineStmt defnames. + * @member {Array.} defnames + * @memberof pg_query.DefineStmt + * @instance + */ + DefineStmt.prototype.defnames = $util.emptyArray; + + /** + * DefineStmt args. + * @member {Array.} args + * @memberof pg_query.DefineStmt + * @instance + */ + DefineStmt.prototype.args = $util.emptyArray; + + /** + * DefineStmt definition. + * @member {Array.} definition + * @memberof pg_query.DefineStmt + * @instance + */ + DefineStmt.prototype.definition = $util.emptyArray; + + /** + * DefineStmt if_not_exists. + * @member {boolean} if_not_exists + * @memberof pg_query.DefineStmt + * @instance + */ + DefineStmt.prototype.if_not_exists = false; + + /** + * DefineStmt replace. + * @member {boolean} replace + * @memberof pg_query.DefineStmt + * @instance + */ + DefineStmt.prototype.replace = false; + + /** + * Creates a new DefineStmt instance using the specified properties. + * @function create + * @memberof pg_query.DefineStmt + * @static + * @param {pg_query.IDefineStmt=} [properties] Properties to set + * @returns {pg_query.DefineStmt} DefineStmt instance + */ + DefineStmt.create = function create(properties) { + return new DefineStmt(properties); + }; + + /** + * Encodes the specified DefineStmt message. Does not implicitly {@link pg_query.DefineStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DefineStmt + * @static + * @param {pg_query.IDefineStmt} message DefineStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefineStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.oldstyle != null && Object.hasOwnProperty.call(message, "oldstyle")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.oldstyle); + if (message.defnames != null && message.defnames.length) + for (var i = 0; i < message.defnames.length; ++i) + $root.pg_query.Node.encode(message.defnames[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.definition != null && message.definition.length) + for (var i = 0; i < message.definition.length; ++i) + $root.pg_query.Node.encode(message.definition[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.if_not_exists != null && Object.hasOwnProperty.call(message, "if_not_exists")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.if_not_exists); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.replace); + return writer; + }; + + /** + * Encodes the specified DefineStmt message, length delimited. Does not implicitly {@link pg_query.DefineStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DefineStmt + * @static + * @param {pg_query.IDefineStmt} message DefineStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefineStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefineStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DefineStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DefineStmt} DefineStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefineStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DefineStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.oldstyle = reader.bool(); + break; + } + case 3: { + if (!(message.defnames && message.defnames.length)) + message.defnames = []; + message.defnames.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.definition && message.definition.length)) + message.definition = []; + message.definition.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.if_not_exists = reader.bool(); + break; + } + case 7: { + message.replace = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefineStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DefineStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DefineStmt} DefineStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefineStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefineStmt message. + * @function verify + * @memberof pg_query.DefineStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefineStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.oldstyle != null && message.hasOwnProperty("oldstyle")) + if (typeof message.oldstyle !== "boolean") + return "oldstyle: boolean expected"; + if (message.defnames != null && message.hasOwnProperty("defnames")) { + if (!Array.isArray(message.defnames)) + return "defnames: array expected"; + for (var i = 0; i < message.defnames.length; ++i) { + var error = $root.pg_query.Node.verify(message.defnames[i]); + if (error) + return "defnames." + error; + } + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.definition != null && message.hasOwnProperty("definition")) { + if (!Array.isArray(message.definition)) + return "definition: array expected"; + for (var i = 0; i < message.definition.length; ++i) { + var error = $root.pg_query.Node.verify(message.definition[i]); + if (error) + return "definition." + error; + } + } + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + if (typeof message.if_not_exists !== "boolean") + return "if_not_exists: boolean expected"; + if (message.replace != null && message.hasOwnProperty("replace")) + if (typeof message.replace !== "boolean") + return "replace: boolean expected"; + return null; + }; + + /** + * Creates a DefineStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DefineStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DefineStmt} DefineStmt + */ + DefineStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DefineStmt) + return object; + var message = new $root.pg_query.DefineStmt(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.kind = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.kind = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.kind = 2; + break; + case "OBJECT_AMOP": + case 3: + message.kind = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.kind = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.kind = 5; + break; + case "OBJECT_CAST": + case 6: + message.kind = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.kind = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.kind = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.kind = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.kind = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.kind = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.kind = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.kind = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.kind = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.kind = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.kind = 16; + break; + case "OBJECT_FDW": + case 17: + message.kind = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.kind = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.kind = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.kind = 20; + break; + case "OBJECT_INDEX": + case 21: + message.kind = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.kind = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.kind = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.kind = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.kind = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.kind = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.kind = 27; + break; + case "OBJECT_POLICY": + case 28: + message.kind = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.kind = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.kind = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.kind = 31; + break; + case "OBJECT_ROLE": + case 32: + message.kind = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.kind = 33; + break; + case "OBJECT_RULE": + case 34: + message.kind = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.kind = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.kind = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.kind = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.kind = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.kind = 39; + break; + case "OBJECT_TABLE": + case 40: + message.kind = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.kind = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.kind = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.kind = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.kind = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.kind = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.kind = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.kind = 47; + break; + case "OBJECT_TYPE": + case 48: + message.kind = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.kind = 49; + break; + case "OBJECT_VIEW": + case 50: + message.kind = 50; + break; + } + if (object.oldstyle != null) + message.oldstyle = Boolean(object.oldstyle); + if (object.defnames) { + if (!Array.isArray(object.defnames)) + throw TypeError(".pg_query.DefineStmt.defnames: array expected"); + message.defnames = []; + for (var i = 0; i < object.defnames.length; ++i) { + if (typeof object.defnames[i] !== "object") + throw TypeError(".pg_query.DefineStmt.defnames: object expected"); + message.defnames[i] = $root.pg_query.Node.fromObject(object.defnames[i]); + } + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.DefineStmt.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.DefineStmt.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.definition) { + if (!Array.isArray(object.definition)) + throw TypeError(".pg_query.DefineStmt.definition: array expected"); + message.definition = []; + for (var i = 0; i < object.definition.length; ++i) { + if (typeof object.definition[i] !== "object") + throw TypeError(".pg_query.DefineStmt.definition: object expected"); + message.definition[i] = $root.pg_query.Node.fromObject(object.definition[i]); + } + } + if (object.if_not_exists != null) + message.if_not_exists = Boolean(object.if_not_exists); + if (object.replace != null) + message.replace = Boolean(object.replace); + return message; + }; + + /** + * Creates a plain object from a DefineStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DefineStmt + * @static + * @param {pg_query.DefineStmt} message DefineStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefineStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.defnames = []; + object.args = []; + object.definition = []; + } + if (options.defaults) { + object.kind = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.oldstyle = false; + object.if_not_exists = false; + object.replace = false; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.pg_query.ObjectType[message.kind] === undefined ? message.kind : $root.pg_query.ObjectType[message.kind] : message.kind; + if (message.oldstyle != null && message.hasOwnProperty("oldstyle")) + object.oldstyle = message.oldstyle; + if (message.defnames && message.defnames.length) { + object.defnames = []; + for (var j = 0; j < message.defnames.length; ++j) + object.defnames[j] = $root.pg_query.Node.toObject(message.defnames[j], options); + } + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.definition && message.definition.length) { + object.definition = []; + for (var j = 0; j < message.definition.length; ++j) + object.definition[j] = $root.pg_query.Node.toObject(message.definition[j], options); + } + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + object.if_not_exists = message.if_not_exists; + if (message.replace != null && message.hasOwnProperty("replace")) + object.replace = message.replace; + return object; + }; + + /** + * Converts this DefineStmt to JSON. + * @function toJSON + * @memberof pg_query.DefineStmt + * @instance + * @returns {Object.} JSON object + */ + DefineStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DefineStmt + * @function getTypeUrl + * @memberof pg_query.DefineStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DefineStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DefineStmt"; + }; + + return DefineStmt; + })(); + + pg_query.DropStmt = (function() { + + /** + * Properties of a DropStmt. + * @memberof pg_query + * @interface IDropStmt + * @property {Array.|null} [objects] DropStmt objects + * @property {pg_query.ObjectType|null} [removeType] DropStmt removeType + * @property {pg_query.DropBehavior|null} [behavior] DropStmt behavior + * @property {boolean|null} [missing_ok] DropStmt missing_ok + * @property {boolean|null} [concurrent] DropStmt concurrent + */ + + /** + * Constructs a new DropStmt. + * @memberof pg_query + * @classdesc Represents a DropStmt. + * @implements IDropStmt + * @constructor + * @param {pg_query.IDropStmt=} [properties] Properties to set + */ + function DropStmt(properties) { + this.objects = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DropStmt objects. + * @member {Array.} objects + * @memberof pg_query.DropStmt + * @instance + */ + DropStmt.prototype.objects = $util.emptyArray; + + /** + * DropStmt removeType. + * @member {pg_query.ObjectType} removeType + * @memberof pg_query.DropStmt + * @instance + */ + DropStmt.prototype.removeType = 0; + + /** + * DropStmt behavior. + * @member {pg_query.DropBehavior} behavior + * @memberof pg_query.DropStmt + * @instance + */ + DropStmt.prototype.behavior = 0; + + /** + * DropStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.DropStmt + * @instance + */ + DropStmt.prototype.missing_ok = false; + + /** + * DropStmt concurrent. + * @member {boolean} concurrent + * @memberof pg_query.DropStmt + * @instance + */ + DropStmt.prototype.concurrent = false; + + /** + * Creates a new DropStmt instance using the specified properties. + * @function create + * @memberof pg_query.DropStmt + * @static + * @param {pg_query.IDropStmt=} [properties] Properties to set + * @returns {pg_query.DropStmt} DropStmt instance + */ + DropStmt.create = function create(properties) { + return new DropStmt(properties); + }; + + /** + * Encodes the specified DropStmt message. Does not implicitly {@link pg_query.DropStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DropStmt + * @static + * @param {pg_query.IDropStmt} message DropStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objects != null && message.objects.length) + for (var i = 0; i < message.objects.length; ++i) + $root.pg_query.Node.encode(message.objects[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.removeType != null && Object.hasOwnProperty.call(message, "removeType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.removeType); + if (message.behavior != null && Object.hasOwnProperty.call(message, "behavior")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.behavior); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.missing_ok); + if (message.concurrent != null && Object.hasOwnProperty.call(message, "concurrent")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.concurrent); + return writer; + }; + + /** + * Encodes the specified DropStmt message, length delimited. Does not implicitly {@link pg_query.DropStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DropStmt + * @static + * @param {pg_query.IDropStmt} message DropStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DropStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DropStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DropStmt} DropStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DropStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.objects && message.objects.length)) + message.objects = []; + message.objects.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.removeType = reader.int32(); + break; + } + case 3: { + message.behavior = reader.int32(); + break; + } + case 4: { + message.missing_ok = reader.bool(); + break; + } + case 5: { + message.concurrent = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DropStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DropStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DropStmt} DropStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DropStmt message. + * @function verify + * @memberof pg_query.DropStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DropStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objects != null && message.hasOwnProperty("objects")) { + if (!Array.isArray(message.objects)) + return "objects: array expected"; + for (var i = 0; i < message.objects.length; ++i) { + var error = $root.pg_query.Node.verify(message.objects[i]); + if (error) + return "objects." + error; + } + } + if (message.removeType != null && message.hasOwnProperty("removeType")) + switch (message.removeType) { + default: + return "removeType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.behavior != null && message.hasOwnProperty("behavior")) + switch (message.behavior) { + default: + return "behavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + if (message.concurrent != null && message.hasOwnProperty("concurrent")) + if (typeof message.concurrent !== "boolean") + return "concurrent: boolean expected"; + return null; + }; + + /** + * Creates a DropStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DropStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DropStmt} DropStmt + */ + DropStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DropStmt) + return object; + var message = new $root.pg_query.DropStmt(); + if (object.objects) { + if (!Array.isArray(object.objects)) + throw TypeError(".pg_query.DropStmt.objects: array expected"); + message.objects = []; + for (var i = 0; i < object.objects.length; ++i) { + if (typeof object.objects[i] !== "object") + throw TypeError(".pg_query.DropStmt.objects: object expected"); + message.objects[i] = $root.pg_query.Node.fromObject(object.objects[i]); + } + } + switch (object.removeType) { + default: + if (typeof object.removeType === "number") { + message.removeType = object.removeType; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.removeType = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.removeType = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.removeType = 2; + break; + case "OBJECT_AMOP": + case 3: + message.removeType = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.removeType = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.removeType = 5; + break; + case "OBJECT_CAST": + case 6: + message.removeType = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.removeType = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.removeType = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.removeType = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.removeType = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.removeType = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.removeType = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.removeType = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.removeType = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.removeType = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.removeType = 16; + break; + case "OBJECT_FDW": + case 17: + message.removeType = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.removeType = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.removeType = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.removeType = 20; + break; + case "OBJECT_INDEX": + case 21: + message.removeType = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.removeType = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.removeType = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.removeType = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.removeType = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.removeType = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.removeType = 27; + break; + case "OBJECT_POLICY": + case 28: + message.removeType = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.removeType = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.removeType = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.removeType = 31; + break; + case "OBJECT_ROLE": + case 32: + message.removeType = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.removeType = 33; + break; + case "OBJECT_RULE": + case 34: + message.removeType = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.removeType = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.removeType = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.removeType = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.removeType = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.removeType = 39; + break; + case "OBJECT_TABLE": + case 40: + message.removeType = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.removeType = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.removeType = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.removeType = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.removeType = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.removeType = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.removeType = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.removeType = 47; + break; + case "OBJECT_TYPE": + case 48: + message.removeType = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.removeType = 49; + break; + case "OBJECT_VIEW": + case 50: + message.removeType = 50; + break; + } + switch (object.behavior) { + default: + if (typeof object.behavior === "number") { + message.behavior = object.behavior; + break; + } + break; + case "DROP_BEHAVIOR_UNDEFINED": + case 0: + message.behavior = 0; + break; + case "DROP_RESTRICT": + case 1: + message.behavior = 1; + break; + case "DROP_CASCADE": + case 2: + message.behavior = 2; + break; + } + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + if (object.concurrent != null) + message.concurrent = Boolean(object.concurrent); + return message; + }; + + /** + * Creates a plain object from a DropStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DropStmt + * @static + * @param {pg_query.DropStmt} message DropStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DropStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.objects = []; + if (options.defaults) { + object.removeType = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.behavior = options.enums === String ? "DROP_BEHAVIOR_UNDEFINED" : 0; + object.missing_ok = false; + object.concurrent = false; + } + if (message.objects && message.objects.length) { + object.objects = []; + for (var j = 0; j < message.objects.length; ++j) + object.objects[j] = $root.pg_query.Node.toObject(message.objects[j], options); + } + if (message.removeType != null && message.hasOwnProperty("removeType")) + object.removeType = options.enums === String ? $root.pg_query.ObjectType[message.removeType] === undefined ? message.removeType : $root.pg_query.ObjectType[message.removeType] : message.removeType; + if (message.behavior != null && message.hasOwnProperty("behavior")) + object.behavior = options.enums === String ? $root.pg_query.DropBehavior[message.behavior] === undefined ? message.behavior : $root.pg_query.DropBehavior[message.behavior] : message.behavior; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + if (message.concurrent != null && message.hasOwnProperty("concurrent")) + object.concurrent = message.concurrent; + return object; + }; + + /** + * Converts this DropStmt to JSON. + * @function toJSON + * @memberof pg_query.DropStmt + * @instance + * @returns {Object.} JSON object + */ + DropStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DropStmt + * @function getTypeUrl + * @memberof pg_query.DropStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DropStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DropStmt"; + }; + + return DropStmt; + })(); + + pg_query.TruncateStmt = (function() { + + /** + * Properties of a TruncateStmt. + * @memberof pg_query + * @interface ITruncateStmt + * @property {Array.|null} [relations] TruncateStmt relations + * @property {boolean|null} [restart_seqs] TruncateStmt restart_seqs + * @property {pg_query.DropBehavior|null} [behavior] TruncateStmt behavior + */ + + /** + * Constructs a new TruncateStmt. + * @memberof pg_query + * @classdesc Represents a TruncateStmt. + * @implements ITruncateStmt + * @constructor + * @param {pg_query.ITruncateStmt=} [properties] Properties to set + */ + function TruncateStmt(properties) { + this.relations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TruncateStmt relations. + * @member {Array.} relations + * @memberof pg_query.TruncateStmt + * @instance + */ + TruncateStmt.prototype.relations = $util.emptyArray; + + /** + * TruncateStmt restart_seqs. + * @member {boolean} restart_seqs + * @memberof pg_query.TruncateStmt + * @instance + */ + TruncateStmt.prototype.restart_seqs = false; + + /** + * TruncateStmt behavior. + * @member {pg_query.DropBehavior} behavior + * @memberof pg_query.TruncateStmt + * @instance + */ + TruncateStmt.prototype.behavior = 0; + + /** + * Creates a new TruncateStmt instance using the specified properties. + * @function create + * @memberof pg_query.TruncateStmt + * @static + * @param {pg_query.ITruncateStmt=} [properties] Properties to set + * @returns {pg_query.TruncateStmt} TruncateStmt instance + */ + TruncateStmt.create = function create(properties) { + return new TruncateStmt(properties); + }; + + /** + * Encodes the specified TruncateStmt message. Does not implicitly {@link pg_query.TruncateStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.TruncateStmt + * @static + * @param {pg_query.ITruncateStmt} message TruncateStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TruncateStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relations != null && message.relations.length) + for (var i = 0; i < message.relations.length; ++i) + $root.pg_query.Node.encode(message.relations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.restart_seqs != null && Object.hasOwnProperty.call(message, "restart_seqs")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.restart_seqs); + if (message.behavior != null && Object.hasOwnProperty.call(message, "behavior")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.behavior); + return writer; + }; + + /** + * Encodes the specified TruncateStmt message, length delimited. Does not implicitly {@link pg_query.TruncateStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.TruncateStmt + * @static + * @param {pg_query.ITruncateStmt} message TruncateStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TruncateStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TruncateStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.TruncateStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.TruncateStmt} TruncateStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TruncateStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.TruncateStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.relations && message.relations.length)) + message.relations = []; + message.relations.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.restart_seqs = reader.bool(); + break; + } + case 3: { + message.behavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TruncateStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.TruncateStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.TruncateStmt} TruncateStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TruncateStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TruncateStmt message. + * @function verify + * @memberof pg_query.TruncateStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TruncateStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relations != null && message.hasOwnProperty("relations")) { + if (!Array.isArray(message.relations)) + return "relations: array expected"; + for (var i = 0; i < message.relations.length; ++i) { + var error = $root.pg_query.Node.verify(message.relations[i]); + if (error) + return "relations." + error; + } + } + if (message.restart_seqs != null && message.hasOwnProperty("restart_seqs")) + if (typeof message.restart_seqs !== "boolean") + return "restart_seqs: boolean expected"; + if (message.behavior != null && message.hasOwnProperty("behavior")) + switch (message.behavior) { + default: + return "behavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TruncateStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.TruncateStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.TruncateStmt} TruncateStmt + */ + TruncateStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.TruncateStmt) + return object; + var message = new $root.pg_query.TruncateStmt(); + if (object.relations) { + if (!Array.isArray(object.relations)) + throw TypeError(".pg_query.TruncateStmt.relations: array expected"); + message.relations = []; + for (var i = 0; i < object.relations.length; ++i) { + if (typeof object.relations[i] !== "object") + throw TypeError(".pg_query.TruncateStmt.relations: object expected"); + message.relations[i] = $root.pg_query.Node.fromObject(object.relations[i]); + } + } + if (object.restart_seqs != null) + message.restart_seqs = Boolean(object.restart_seqs); + switch (object.behavior) { + default: + if (typeof object.behavior === "number") { + message.behavior = object.behavior; + break; + } + break; + case "DROP_BEHAVIOR_UNDEFINED": + case 0: + message.behavior = 0; + break; + case "DROP_RESTRICT": + case 1: + message.behavior = 1; + break; + case "DROP_CASCADE": + case 2: + message.behavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TruncateStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.TruncateStmt + * @static + * @param {pg_query.TruncateStmt} message TruncateStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TruncateStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relations = []; + if (options.defaults) { + object.restart_seqs = false; + object.behavior = options.enums === String ? "DROP_BEHAVIOR_UNDEFINED" : 0; + } + if (message.relations && message.relations.length) { + object.relations = []; + for (var j = 0; j < message.relations.length; ++j) + object.relations[j] = $root.pg_query.Node.toObject(message.relations[j], options); + } + if (message.restart_seqs != null && message.hasOwnProperty("restart_seqs")) + object.restart_seqs = message.restart_seqs; + if (message.behavior != null && message.hasOwnProperty("behavior")) + object.behavior = options.enums === String ? $root.pg_query.DropBehavior[message.behavior] === undefined ? message.behavior : $root.pg_query.DropBehavior[message.behavior] : message.behavior; + return object; + }; + + /** + * Converts this TruncateStmt to JSON. + * @function toJSON + * @memberof pg_query.TruncateStmt + * @instance + * @returns {Object.} JSON object + */ + TruncateStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TruncateStmt + * @function getTypeUrl + * @memberof pg_query.TruncateStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TruncateStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.TruncateStmt"; + }; + + return TruncateStmt; + })(); + + pg_query.CommentStmt = (function() { + + /** + * Properties of a CommentStmt. + * @memberof pg_query + * @interface ICommentStmt + * @property {pg_query.ObjectType|null} [objtype] CommentStmt objtype + * @property {pg_query.INode|null} [object] CommentStmt object + * @property {string|null} [comment] CommentStmt comment + */ + + /** + * Constructs a new CommentStmt. + * @memberof pg_query + * @classdesc Represents a CommentStmt. + * @implements ICommentStmt + * @constructor + * @param {pg_query.ICommentStmt=} [properties] Properties to set + */ + function CommentStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommentStmt objtype. + * @member {pg_query.ObjectType} objtype + * @memberof pg_query.CommentStmt + * @instance + */ + CommentStmt.prototype.objtype = 0; + + /** + * CommentStmt object. + * @member {pg_query.INode|null|undefined} object + * @memberof pg_query.CommentStmt + * @instance + */ + CommentStmt.prototype.object = null; + + /** + * CommentStmt comment. + * @member {string} comment + * @memberof pg_query.CommentStmt + * @instance + */ + CommentStmt.prototype.comment = ""; + + /** + * Creates a new CommentStmt instance using the specified properties. + * @function create + * @memberof pg_query.CommentStmt + * @static + * @param {pg_query.ICommentStmt=} [properties] Properties to set + * @returns {pg_query.CommentStmt} CommentStmt instance + */ + CommentStmt.create = function create(properties) { + return new CommentStmt(properties); + }; + + /** + * Encodes the specified CommentStmt message. Does not implicitly {@link pg_query.CommentStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CommentStmt + * @static + * @param {pg_query.ICommentStmt} message CommentStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommentStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objtype != null && Object.hasOwnProperty.call(message, "objtype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.objtype); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + $root.pg_query.Node.encode(message.object, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.comment); + return writer; + }; + + /** + * Encodes the specified CommentStmt message, length delimited. Does not implicitly {@link pg_query.CommentStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CommentStmt + * @static + * @param {pg_query.ICommentStmt} message CommentStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommentStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommentStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CommentStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CommentStmt} CommentStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommentStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CommentStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.objtype = reader.int32(); + break; + } + case 2: { + message.object = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.comment = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommentStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CommentStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CommentStmt} CommentStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommentStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommentStmt message. + * @function verify + * @memberof pg_query.CommentStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommentStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objtype != null && message.hasOwnProperty("objtype")) + switch (message.objtype) { + default: + return "objtype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.object != null && message.hasOwnProperty("object")) { + var error = $root.pg_query.Node.verify(message.object); + if (error) + return "object." + error; + } + if (message.comment != null && message.hasOwnProperty("comment")) + if (!$util.isString(message.comment)) + return "comment: string expected"; + return null; + }; + + /** + * Creates a CommentStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CommentStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CommentStmt} CommentStmt + */ + CommentStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CommentStmt) + return object; + var message = new $root.pg_query.CommentStmt(); + switch (object.objtype) { + default: + if (typeof object.objtype === "number") { + message.objtype = object.objtype; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.objtype = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.objtype = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.objtype = 2; + break; + case "OBJECT_AMOP": + case 3: + message.objtype = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.objtype = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.objtype = 5; + break; + case "OBJECT_CAST": + case 6: + message.objtype = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.objtype = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.objtype = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.objtype = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.objtype = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.objtype = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.objtype = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.objtype = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.objtype = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.objtype = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.objtype = 16; + break; + case "OBJECT_FDW": + case 17: + message.objtype = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.objtype = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.objtype = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.objtype = 20; + break; + case "OBJECT_INDEX": + case 21: + message.objtype = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.objtype = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.objtype = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.objtype = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.objtype = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.objtype = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.objtype = 27; + break; + case "OBJECT_POLICY": + case 28: + message.objtype = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.objtype = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.objtype = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.objtype = 31; + break; + case "OBJECT_ROLE": + case 32: + message.objtype = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.objtype = 33; + break; + case "OBJECT_RULE": + case 34: + message.objtype = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.objtype = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.objtype = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.objtype = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.objtype = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.objtype = 39; + break; + case "OBJECT_TABLE": + case 40: + message.objtype = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.objtype = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.objtype = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.objtype = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.objtype = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.objtype = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.objtype = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.objtype = 47; + break; + case "OBJECT_TYPE": + case 48: + message.objtype = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.objtype = 49; + break; + case "OBJECT_VIEW": + case 50: + message.objtype = 50; + break; + } + if (object.object != null) { + if (typeof object.object !== "object") + throw TypeError(".pg_query.CommentStmt.object: object expected"); + message.object = $root.pg_query.Node.fromObject(object.object); + } + if (object.comment != null) + message.comment = String(object.comment); + return message; + }; + + /** + * Creates a plain object from a CommentStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CommentStmt + * @static + * @param {pg_query.CommentStmt} message CommentStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommentStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.objtype = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.object = null; + object.comment = ""; + } + if (message.objtype != null && message.hasOwnProperty("objtype")) + object.objtype = options.enums === String ? $root.pg_query.ObjectType[message.objtype] === undefined ? message.objtype : $root.pg_query.ObjectType[message.objtype] : message.objtype; + if (message.object != null && message.hasOwnProperty("object")) + object.object = $root.pg_query.Node.toObject(message.object, options); + if (message.comment != null && message.hasOwnProperty("comment")) + object.comment = message.comment; + return object; + }; + + /** + * Converts this CommentStmt to JSON. + * @function toJSON + * @memberof pg_query.CommentStmt + * @instance + * @returns {Object.} JSON object + */ + CommentStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommentStmt + * @function getTypeUrl + * @memberof pg_query.CommentStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommentStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CommentStmt"; + }; + + return CommentStmt; + })(); + + pg_query.FetchStmt = (function() { + + /** + * Properties of a FetchStmt. + * @memberof pg_query + * @interface IFetchStmt + * @property {pg_query.FetchDirection|null} [direction] FetchStmt direction + * @property {number|Long|null} [howMany] FetchStmt howMany + * @property {string|null} [portalname] FetchStmt portalname + * @property {boolean|null} [ismove] FetchStmt ismove + */ + + /** + * Constructs a new FetchStmt. + * @memberof pg_query + * @classdesc Represents a FetchStmt. + * @implements IFetchStmt + * @constructor + * @param {pg_query.IFetchStmt=} [properties] Properties to set + */ + function FetchStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchStmt direction. + * @member {pg_query.FetchDirection} direction + * @memberof pg_query.FetchStmt + * @instance + */ + FetchStmt.prototype.direction = 0; + + /** + * FetchStmt howMany. + * @member {number|Long} howMany + * @memberof pg_query.FetchStmt + * @instance + */ + FetchStmt.prototype.howMany = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * FetchStmt portalname. + * @member {string} portalname + * @memberof pg_query.FetchStmt + * @instance + */ + FetchStmt.prototype.portalname = ""; + + /** + * FetchStmt ismove. + * @member {boolean} ismove + * @memberof pg_query.FetchStmt + * @instance + */ + FetchStmt.prototype.ismove = false; + + /** + * Creates a new FetchStmt instance using the specified properties. + * @function create + * @memberof pg_query.FetchStmt + * @static + * @param {pg_query.IFetchStmt=} [properties] Properties to set + * @returns {pg_query.FetchStmt} FetchStmt instance + */ + FetchStmt.create = function create(properties) { + return new FetchStmt(properties); + }; + + /** + * Encodes the specified FetchStmt message. Does not implicitly {@link pg_query.FetchStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.FetchStmt + * @static + * @param {pg_query.IFetchStmt} message FetchStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.direction); + if (message.howMany != null && Object.hasOwnProperty.call(message, "howMany")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.howMany); + if (message.portalname != null && Object.hasOwnProperty.call(message, "portalname")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.portalname); + if (message.ismove != null && Object.hasOwnProperty.call(message, "ismove")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ismove); + return writer; + }; + + /** + * Encodes the specified FetchStmt message, length delimited. Does not implicitly {@link pg_query.FetchStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.FetchStmt + * @static + * @param {pg_query.IFetchStmt} message FetchStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.FetchStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.FetchStmt} FetchStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.FetchStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.direction = reader.int32(); + break; + } + case 2: { + message.howMany = reader.int64(); + break; + } + case 3: { + message.portalname = reader.string(); + break; + } + case 4: { + message.ismove = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.FetchStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.FetchStmt} FetchStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchStmt message. + * @function verify + * @memberof pg_query.FetchStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.howMany != null && message.hasOwnProperty("howMany")) + if (!$util.isInteger(message.howMany) && !(message.howMany && $util.isInteger(message.howMany.low) && $util.isInteger(message.howMany.high))) + return "howMany: integer|Long expected"; + if (message.portalname != null && message.hasOwnProperty("portalname")) + if (!$util.isString(message.portalname)) + return "portalname: string expected"; + if (message.ismove != null && message.hasOwnProperty("ismove")) + if (typeof message.ismove !== "boolean") + return "ismove: boolean expected"; + return null; + }; + + /** + * Creates a FetchStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.FetchStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.FetchStmt} FetchStmt + */ + FetchStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.FetchStmt) + return object; + var message = new $root.pg_query.FetchStmt(); + switch (object.direction) { + default: + if (typeof object.direction === "number") { + message.direction = object.direction; + break; + } + break; + case "FETCH_DIRECTION_UNDEFINED": + case 0: + message.direction = 0; + break; + case "FETCH_FORWARD": + case 1: + message.direction = 1; + break; + case "FETCH_BACKWARD": + case 2: + message.direction = 2; + break; + case "FETCH_ABSOLUTE": + case 3: + message.direction = 3; + break; + case "FETCH_RELATIVE": + case 4: + message.direction = 4; + break; + } + if (object.howMany != null) + if ($util.Long) + (message.howMany = $util.Long.fromValue(object.howMany)).unsigned = false; + else if (typeof object.howMany === "string") + message.howMany = parseInt(object.howMany, 10); + else if (typeof object.howMany === "number") + message.howMany = object.howMany; + else if (typeof object.howMany === "object") + message.howMany = new $util.LongBits(object.howMany.low >>> 0, object.howMany.high >>> 0).toNumber(); + if (object.portalname != null) + message.portalname = String(object.portalname); + if (object.ismove != null) + message.ismove = Boolean(object.ismove); + return message; + }; + + /** + * Creates a plain object from a FetchStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.FetchStmt + * @static + * @param {pg_query.FetchStmt} message FetchStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.direction = options.enums === String ? "FETCH_DIRECTION_UNDEFINED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.howMany = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.howMany = options.longs === String ? "0" : 0; + object.portalname = ""; + object.ismove = false; + } + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.pg_query.FetchDirection[message.direction] === undefined ? message.direction : $root.pg_query.FetchDirection[message.direction] : message.direction; + if (message.howMany != null && message.hasOwnProperty("howMany")) + if (typeof message.howMany === "number") + object.howMany = options.longs === String ? String(message.howMany) : message.howMany; + else + object.howMany = options.longs === String ? $util.Long.prototype.toString.call(message.howMany) : options.longs === Number ? new $util.LongBits(message.howMany.low >>> 0, message.howMany.high >>> 0).toNumber() : message.howMany; + if (message.portalname != null && message.hasOwnProperty("portalname")) + object.portalname = message.portalname; + if (message.ismove != null && message.hasOwnProperty("ismove")) + object.ismove = message.ismove; + return object; + }; + + /** + * Converts this FetchStmt to JSON. + * @function toJSON + * @memberof pg_query.FetchStmt + * @instance + * @returns {Object.} JSON object + */ + FetchStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchStmt + * @function getTypeUrl + * @memberof pg_query.FetchStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.FetchStmt"; + }; + + return FetchStmt; + })(); + + pg_query.IndexStmt = (function() { + + /** + * Properties of an IndexStmt. + * @memberof pg_query + * @interface IIndexStmt + * @property {string|null} [idxname] IndexStmt idxname + * @property {pg_query.IRangeVar|null} [relation] IndexStmt relation + * @property {string|null} [accessMethod] IndexStmt accessMethod + * @property {string|null} [tableSpace] IndexStmt tableSpace + * @property {Array.|null} [indexParams] IndexStmt indexParams + * @property {Array.|null} [indexIncludingParams] IndexStmt indexIncludingParams + * @property {Array.|null} [options] IndexStmt options + * @property {pg_query.INode|null} [whereClause] IndexStmt whereClause + * @property {Array.|null} [excludeOpNames] IndexStmt excludeOpNames + * @property {string|null} [idxcomment] IndexStmt idxcomment + * @property {number|null} [indexOid] IndexStmt indexOid + * @property {number|null} [oldNode] IndexStmt oldNode + * @property {number|null} [oldCreateSubid] IndexStmt oldCreateSubid + * @property {number|null} [oldFirstRelfilenodeSubid] IndexStmt oldFirstRelfilenodeSubid + * @property {boolean|null} [unique] IndexStmt unique + * @property {boolean|null} [primary] IndexStmt primary + * @property {boolean|null} [isconstraint] IndexStmt isconstraint + * @property {boolean|null} [deferrable] IndexStmt deferrable + * @property {boolean|null} [initdeferred] IndexStmt initdeferred + * @property {boolean|null} [transformed] IndexStmt transformed + * @property {boolean|null} [concurrent] IndexStmt concurrent + * @property {boolean|null} [if_not_exists] IndexStmt if_not_exists + * @property {boolean|null} [reset_default_tblspc] IndexStmt reset_default_tblspc + */ + + /** + * Constructs a new IndexStmt. + * @memberof pg_query + * @classdesc Represents an IndexStmt. + * @implements IIndexStmt + * @constructor + * @param {pg_query.IIndexStmt=} [properties] Properties to set + */ + function IndexStmt(properties) { + this.indexParams = []; + this.indexIncludingParams = []; + this.options = []; + this.excludeOpNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndexStmt idxname. + * @member {string} idxname + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.idxname = ""; + + /** + * IndexStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.relation = null; + + /** + * IndexStmt accessMethod. + * @member {string} accessMethod + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.accessMethod = ""; + + /** + * IndexStmt tableSpace. + * @member {string} tableSpace + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.tableSpace = ""; + + /** + * IndexStmt indexParams. + * @member {Array.} indexParams + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.indexParams = $util.emptyArray; + + /** + * IndexStmt indexIncludingParams. + * @member {Array.} indexIncludingParams + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.indexIncludingParams = $util.emptyArray; + + /** + * IndexStmt options. + * @member {Array.} options + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.options = $util.emptyArray; + + /** + * IndexStmt whereClause. + * @member {pg_query.INode|null|undefined} whereClause + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.whereClause = null; + + /** + * IndexStmt excludeOpNames. + * @member {Array.} excludeOpNames + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.excludeOpNames = $util.emptyArray; + + /** + * IndexStmt idxcomment. + * @member {string} idxcomment + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.idxcomment = ""; + + /** + * IndexStmt indexOid. + * @member {number} indexOid + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.indexOid = 0; + + /** + * IndexStmt oldNode. + * @member {number} oldNode + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.oldNode = 0; + + /** + * IndexStmt oldCreateSubid. + * @member {number} oldCreateSubid + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.oldCreateSubid = 0; + + /** + * IndexStmt oldFirstRelfilenodeSubid. + * @member {number} oldFirstRelfilenodeSubid + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.oldFirstRelfilenodeSubid = 0; + + /** + * IndexStmt unique. + * @member {boolean} unique + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.unique = false; + + /** + * IndexStmt primary. + * @member {boolean} primary + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.primary = false; + + /** + * IndexStmt isconstraint. + * @member {boolean} isconstraint + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.isconstraint = false; + + /** + * IndexStmt deferrable. + * @member {boolean} deferrable + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.deferrable = false; + + /** + * IndexStmt initdeferred. + * @member {boolean} initdeferred + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.initdeferred = false; + + /** + * IndexStmt transformed. + * @member {boolean} transformed + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.transformed = false; + + /** + * IndexStmt concurrent. + * @member {boolean} concurrent + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.concurrent = false; + + /** + * IndexStmt if_not_exists. + * @member {boolean} if_not_exists + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.if_not_exists = false; + + /** + * IndexStmt reset_default_tblspc. + * @member {boolean} reset_default_tblspc + * @memberof pg_query.IndexStmt + * @instance + */ + IndexStmt.prototype.reset_default_tblspc = false; + + /** + * Creates a new IndexStmt instance using the specified properties. + * @function create + * @memberof pg_query.IndexStmt + * @static + * @param {pg_query.IIndexStmt=} [properties] Properties to set + * @returns {pg_query.IndexStmt} IndexStmt instance + */ + IndexStmt.create = function create(properties) { + return new IndexStmt(properties); + }; + + /** + * Encodes the specified IndexStmt message. Does not implicitly {@link pg_query.IndexStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.IndexStmt + * @static + * @param {pg_query.IIndexStmt} message IndexStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.idxname != null && Object.hasOwnProperty.call(message, "idxname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.idxname); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.accessMethod != null && Object.hasOwnProperty.call(message, "accessMethod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.accessMethod); + if (message.tableSpace != null && Object.hasOwnProperty.call(message, "tableSpace")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tableSpace); + if (message.indexParams != null && message.indexParams.length) + for (var i = 0; i < message.indexParams.length; ++i) + $root.pg_query.Node.encode(message.indexParams[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.indexIncludingParams != null && message.indexIncludingParams.length) + for (var i = 0; i < message.indexIncludingParams.length; ++i) + $root.pg_query.Node.encode(message.indexIncludingParams[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.whereClause != null && Object.hasOwnProperty.call(message, "whereClause")) + $root.pg_query.Node.encode(message.whereClause, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.excludeOpNames != null && message.excludeOpNames.length) + for (var i = 0; i < message.excludeOpNames.length; ++i) + $root.pg_query.Node.encode(message.excludeOpNames[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.idxcomment != null && Object.hasOwnProperty.call(message, "idxcomment")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.idxcomment); + if (message.indexOid != null && Object.hasOwnProperty.call(message, "indexOid")) + writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.indexOid); + if (message.oldNode != null && Object.hasOwnProperty.call(message, "oldNode")) + writer.uint32(/* id 12, wireType 0 =*/96).uint32(message.oldNode); + if (message.oldCreateSubid != null && Object.hasOwnProperty.call(message, "oldCreateSubid")) + writer.uint32(/* id 13, wireType 0 =*/104).uint32(message.oldCreateSubid); + if (message.oldFirstRelfilenodeSubid != null && Object.hasOwnProperty.call(message, "oldFirstRelfilenodeSubid")) + writer.uint32(/* id 14, wireType 0 =*/112).uint32(message.oldFirstRelfilenodeSubid); + if (message.unique != null && Object.hasOwnProperty.call(message, "unique")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unique); + if (message.primary != null && Object.hasOwnProperty.call(message, "primary")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.primary); + if (message.isconstraint != null && Object.hasOwnProperty.call(message, "isconstraint")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.isconstraint); + if (message.deferrable != null && Object.hasOwnProperty.call(message, "deferrable")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.deferrable); + if (message.initdeferred != null && Object.hasOwnProperty.call(message, "initdeferred")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.initdeferred); + if (message.transformed != null && Object.hasOwnProperty.call(message, "transformed")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.transformed); + if (message.concurrent != null && Object.hasOwnProperty.call(message, "concurrent")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.concurrent); + if (message.if_not_exists != null && Object.hasOwnProperty.call(message, "if_not_exists")) + writer.uint32(/* id 22, wireType 0 =*/176).bool(message.if_not_exists); + if (message.reset_default_tblspc != null && Object.hasOwnProperty.call(message, "reset_default_tblspc")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.reset_default_tblspc); + return writer; + }; + + /** + * Encodes the specified IndexStmt message, length delimited. Does not implicitly {@link pg_query.IndexStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.IndexStmt + * @static + * @param {pg_query.IIndexStmt} message IndexStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndexStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.IndexStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.IndexStmt} IndexStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.IndexStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.idxname = reader.string(); + break; + } + case 2: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 3: { + message.accessMethod = reader.string(); + break; + } + case 4: { + message.tableSpace = reader.string(); + break; + } + case 5: { + if (!(message.indexParams && message.indexParams.length)) + message.indexParams = []; + message.indexParams.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.indexIncludingParams && message.indexIncludingParams.length)) + message.indexIncludingParams = []; + message.indexIncludingParams.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 8: { + message.whereClause = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.excludeOpNames && message.excludeOpNames.length)) + message.excludeOpNames = []; + message.excludeOpNames.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 10: { + message.idxcomment = reader.string(); + break; + } + case 11: { + message.indexOid = reader.uint32(); + break; + } + case 12: { + message.oldNode = reader.uint32(); + break; + } + case 13: { + message.oldCreateSubid = reader.uint32(); + break; + } + case 14: { + message.oldFirstRelfilenodeSubid = reader.uint32(); + break; + } + case 15: { + message.unique = reader.bool(); + break; + } + case 16: { + message.primary = reader.bool(); + break; + } + case 17: { + message.isconstraint = reader.bool(); + break; + } + case 18: { + message.deferrable = reader.bool(); + break; + } + case 19: { + message.initdeferred = reader.bool(); + break; + } + case 20: { + message.transformed = reader.bool(); + break; + } + case 21: { + message.concurrent = reader.bool(); + break; + } + case 22: { + message.if_not_exists = reader.bool(); + break; + } + case 23: { + message.reset_default_tblspc = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndexStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.IndexStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.IndexStmt} IndexStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndexStmt message. + * @function verify + * @memberof pg_query.IndexStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndexStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.idxname != null && message.hasOwnProperty("idxname")) + if (!$util.isString(message.idxname)) + return "idxname: string expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.accessMethod != null && message.hasOwnProperty("accessMethod")) + if (!$util.isString(message.accessMethod)) + return "accessMethod: string expected"; + if (message.tableSpace != null && message.hasOwnProperty("tableSpace")) + if (!$util.isString(message.tableSpace)) + return "tableSpace: string expected"; + if (message.indexParams != null && message.hasOwnProperty("indexParams")) { + if (!Array.isArray(message.indexParams)) + return "indexParams: array expected"; + for (var i = 0; i < message.indexParams.length; ++i) { + var error = $root.pg_query.Node.verify(message.indexParams[i]); + if (error) + return "indexParams." + error; + } + } + if (message.indexIncludingParams != null && message.hasOwnProperty("indexIncludingParams")) { + if (!Array.isArray(message.indexIncludingParams)) + return "indexIncludingParams: array expected"; + for (var i = 0; i < message.indexIncludingParams.length; ++i) { + var error = $root.pg_query.Node.verify(message.indexIncludingParams[i]); + if (error) + return "indexIncludingParams." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) { + var error = $root.pg_query.Node.verify(message.whereClause); + if (error) + return "whereClause." + error; + } + if (message.excludeOpNames != null && message.hasOwnProperty("excludeOpNames")) { + if (!Array.isArray(message.excludeOpNames)) + return "excludeOpNames: array expected"; + for (var i = 0; i < message.excludeOpNames.length; ++i) { + var error = $root.pg_query.Node.verify(message.excludeOpNames[i]); + if (error) + return "excludeOpNames." + error; + } + } + if (message.idxcomment != null && message.hasOwnProperty("idxcomment")) + if (!$util.isString(message.idxcomment)) + return "idxcomment: string expected"; + if (message.indexOid != null && message.hasOwnProperty("indexOid")) + if (!$util.isInteger(message.indexOid)) + return "indexOid: integer expected"; + if (message.oldNode != null && message.hasOwnProperty("oldNode")) + if (!$util.isInteger(message.oldNode)) + return "oldNode: integer expected"; + if (message.oldCreateSubid != null && message.hasOwnProperty("oldCreateSubid")) + if (!$util.isInteger(message.oldCreateSubid)) + return "oldCreateSubid: integer expected"; + if (message.oldFirstRelfilenodeSubid != null && message.hasOwnProperty("oldFirstRelfilenodeSubid")) + if (!$util.isInteger(message.oldFirstRelfilenodeSubid)) + return "oldFirstRelfilenodeSubid: integer expected"; + if (message.unique != null && message.hasOwnProperty("unique")) + if (typeof message.unique !== "boolean") + return "unique: boolean expected"; + if (message.primary != null && message.hasOwnProperty("primary")) + if (typeof message.primary !== "boolean") + return "primary: boolean expected"; + if (message.isconstraint != null && message.hasOwnProperty("isconstraint")) + if (typeof message.isconstraint !== "boolean") + return "isconstraint: boolean expected"; + if (message.deferrable != null && message.hasOwnProperty("deferrable")) + if (typeof message.deferrable !== "boolean") + return "deferrable: boolean expected"; + if (message.initdeferred != null && message.hasOwnProperty("initdeferred")) + if (typeof message.initdeferred !== "boolean") + return "initdeferred: boolean expected"; + if (message.transformed != null && message.hasOwnProperty("transformed")) + if (typeof message.transformed !== "boolean") + return "transformed: boolean expected"; + if (message.concurrent != null && message.hasOwnProperty("concurrent")) + if (typeof message.concurrent !== "boolean") + return "concurrent: boolean expected"; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + if (typeof message.if_not_exists !== "boolean") + return "if_not_exists: boolean expected"; + if (message.reset_default_tblspc != null && message.hasOwnProperty("reset_default_tblspc")) + if (typeof message.reset_default_tblspc !== "boolean") + return "reset_default_tblspc: boolean expected"; + return null; + }; + + /** + * Creates an IndexStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.IndexStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.IndexStmt} IndexStmt + */ + IndexStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.IndexStmt) + return object; + var message = new $root.pg_query.IndexStmt(); + if (object.idxname != null) + message.idxname = String(object.idxname); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.IndexStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.accessMethod != null) + message.accessMethod = String(object.accessMethod); + if (object.tableSpace != null) + message.tableSpace = String(object.tableSpace); + if (object.indexParams) { + if (!Array.isArray(object.indexParams)) + throw TypeError(".pg_query.IndexStmt.indexParams: array expected"); + message.indexParams = []; + for (var i = 0; i < object.indexParams.length; ++i) { + if (typeof object.indexParams[i] !== "object") + throw TypeError(".pg_query.IndexStmt.indexParams: object expected"); + message.indexParams[i] = $root.pg_query.Node.fromObject(object.indexParams[i]); + } + } + if (object.indexIncludingParams) { + if (!Array.isArray(object.indexIncludingParams)) + throw TypeError(".pg_query.IndexStmt.indexIncludingParams: array expected"); + message.indexIncludingParams = []; + for (var i = 0; i < object.indexIncludingParams.length; ++i) { + if (typeof object.indexIncludingParams[i] !== "object") + throw TypeError(".pg_query.IndexStmt.indexIncludingParams: object expected"); + message.indexIncludingParams[i] = $root.pg_query.Node.fromObject(object.indexIncludingParams[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.IndexStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.IndexStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.whereClause != null) { + if (typeof object.whereClause !== "object") + throw TypeError(".pg_query.IndexStmt.whereClause: object expected"); + message.whereClause = $root.pg_query.Node.fromObject(object.whereClause); + } + if (object.excludeOpNames) { + if (!Array.isArray(object.excludeOpNames)) + throw TypeError(".pg_query.IndexStmt.excludeOpNames: array expected"); + message.excludeOpNames = []; + for (var i = 0; i < object.excludeOpNames.length; ++i) { + if (typeof object.excludeOpNames[i] !== "object") + throw TypeError(".pg_query.IndexStmt.excludeOpNames: object expected"); + message.excludeOpNames[i] = $root.pg_query.Node.fromObject(object.excludeOpNames[i]); + } + } + if (object.idxcomment != null) + message.idxcomment = String(object.idxcomment); + if (object.indexOid != null) + message.indexOid = object.indexOid >>> 0; + if (object.oldNode != null) + message.oldNode = object.oldNode >>> 0; + if (object.oldCreateSubid != null) + message.oldCreateSubid = object.oldCreateSubid >>> 0; + if (object.oldFirstRelfilenodeSubid != null) + message.oldFirstRelfilenodeSubid = object.oldFirstRelfilenodeSubid >>> 0; + if (object.unique != null) + message.unique = Boolean(object.unique); + if (object.primary != null) + message.primary = Boolean(object.primary); + if (object.isconstraint != null) + message.isconstraint = Boolean(object.isconstraint); + if (object.deferrable != null) + message.deferrable = Boolean(object.deferrable); + if (object.initdeferred != null) + message.initdeferred = Boolean(object.initdeferred); + if (object.transformed != null) + message.transformed = Boolean(object.transformed); + if (object.concurrent != null) + message.concurrent = Boolean(object.concurrent); + if (object.if_not_exists != null) + message.if_not_exists = Boolean(object.if_not_exists); + if (object.reset_default_tblspc != null) + message.reset_default_tblspc = Boolean(object.reset_default_tblspc); + return message; + }; + + /** + * Creates a plain object from an IndexStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.IndexStmt + * @static + * @param {pg_query.IndexStmt} message IndexStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.indexParams = []; + object.indexIncludingParams = []; + object.options = []; + object.excludeOpNames = []; + } + if (options.defaults) { + object.idxname = ""; + object.relation = null; + object.accessMethod = ""; + object.tableSpace = ""; + object.whereClause = null; + object.idxcomment = ""; + object.indexOid = 0; + object.oldNode = 0; + object.oldCreateSubid = 0; + object.oldFirstRelfilenodeSubid = 0; + object.unique = false; + object.primary = false; + object.isconstraint = false; + object.deferrable = false; + object.initdeferred = false; + object.transformed = false; + object.concurrent = false; + object.if_not_exists = false; + object.reset_default_tblspc = false; + } + if (message.idxname != null && message.hasOwnProperty("idxname")) + object.idxname = message.idxname; + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.accessMethod != null && message.hasOwnProperty("accessMethod")) + object.accessMethod = message.accessMethod; + if (message.tableSpace != null && message.hasOwnProperty("tableSpace")) + object.tableSpace = message.tableSpace; + if (message.indexParams && message.indexParams.length) { + object.indexParams = []; + for (var j = 0; j < message.indexParams.length; ++j) + object.indexParams[j] = $root.pg_query.Node.toObject(message.indexParams[j], options); + } + if (message.indexIncludingParams && message.indexIncludingParams.length) { + object.indexIncludingParams = []; + for (var j = 0; j < message.indexIncludingParams.length; ++j) + object.indexIncludingParams[j] = $root.pg_query.Node.toObject(message.indexIncludingParams[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) + object.whereClause = $root.pg_query.Node.toObject(message.whereClause, options); + if (message.excludeOpNames && message.excludeOpNames.length) { + object.excludeOpNames = []; + for (var j = 0; j < message.excludeOpNames.length; ++j) + object.excludeOpNames[j] = $root.pg_query.Node.toObject(message.excludeOpNames[j], options); + } + if (message.idxcomment != null && message.hasOwnProperty("idxcomment")) + object.idxcomment = message.idxcomment; + if (message.indexOid != null && message.hasOwnProperty("indexOid")) + object.indexOid = message.indexOid; + if (message.oldNode != null && message.hasOwnProperty("oldNode")) + object.oldNode = message.oldNode; + if (message.oldCreateSubid != null && message.hasOwnProperty("oldCreateSubid")) + object.oldCreateSubid = message.oldCreateSubid; + if (message.oldFirstRelfilenodeSubid != null && message.hasOwnProperty("oldFirstRelfilenodeSubid")) + object.oldFirstRelfilenodeSubid = message.oldFirstRelfilenodeSubid; + if (message.unique != null && message.hasOwnProperty("unique")) + object.unique = message.unique; + if (message.primary != null && message.hasOwnProperty("primary")) + object.primary = message.primary; + if (message.isconstraint != null && message.hasOwnProperty("isconstraint")) + object.isconstraint = message.isconstraint; + if (message.deferrable != null && message.hasOwnProperty("deferrable")) + object.deferrable = message.deferrable; + if (message.initdeferred != null && message.hasOwnProperty("initdeferred")) + object.initdeferred = message.initdeferred; + if (message.transformed != null && message.hasOwnProperty("transformed")) + object.transformed = message.transformed; + if (message.concurrent != null && message.hasOwnProperty("concurrent")) + object.concurrent = message.concurrent; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + object.if_not_exists = message.if_not_exists; + if (message.reset_default_tblspc != null && message.hasOwnProperty("reset_default_tblspc")) + object.reset_default_tblspc = message.reset_default_tblspc; + return object; + }; + + /** + * Converts this IndexStmt to JSON. + * @function toJSON + * @memberof pg_query.IndexStmt + * @instance + * @returns {Object.} JSON object + */ + IndexStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndexStmt + * @function getTypeUrl + * @memberof pg_query.IndexStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndexStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.IndexStmt"; + }; + + return IndexStmt; + })(); + + pg_query.CreateFunctionStmt = (function() { + + /** + * Properties of a CreateFunctionStmt. + * @memberof pg_query + * @interface ICreateFunctionStmt + * @property {boolean|null} [is_procedure] CreateFunctionStmt is_procedure + * @property {boolean|null} [replace] CreateFunctionStmt replace + * @property {Array.|null} [funcname] CreateFunctionStmt funcname + * @property {Array.|null} [parameters] CreateFunctionStmt parameters + * @property {pg_query.ITypeName|null} [returnType] CreateFunctionStmt returnType + * @property {Array.|null} [options] CreateFunctionStmt options + */ + + /** + * Constructs a new CreateFunctionStmt. + * @memberof pg_query + * @classdesc Represents a CreateFunctionStmt. + * @implements ICreateFunctionStmt + * @constructor + * @param {pg_query.ICreateFunctionStmt=} [properties] Properties to set + */ + function CreateFunctionStmt(properties) { + this.funcname = []; + this.parameters = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateFunctionStmt is_procedure. + * @member {boolean} is_procedure + * @memberof pg_query.CreateFunctionStmt + * @instance + */ + CreateFunctionStmt.prototype.is_procedure = false; + + /** + * CreateFunctionStmt replace. + * @member {boolean} replace + * @memberof pg_query.CreateFunctionStmt + * @instance + */ + CreateFunctionStmt.prototype.replace = false; + + /** + * CreateFunctionStmt funcname. + * @member {Array.} funcname + * @memberof pg_query.CreateFunctionStmt + * @instance + */ + CreateFunctionStmt.prototype.funcname = $util.emptyArray; + + /** + * CreateFunctionStmt parameters. + * @member {Array.} parameters + * @memberof pg_query.CreateFunctionStmt + * @instance + */ + CreateFunctionStmt.prototype.parameters = $util.emptyArray; + + /** + * CreateFunctionStmt returnType. + * @member {pg_query.ITypeName|null|undefined} returnType + * @memberof pg_query.CreateFunctionStmt + * @instance + */ + CreateFunctionStmt.prototype.returnType = null; + + /** + * CreateFunctionStmt options. + * @member {Array.} options + * @memberof pg_query.CreateFunctionStmt + * @instance + */ + CreateFunctionStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new CreateFunctionStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateFunctionStmt + * @static + * @param {pg_query.ICreateFunctionStmt=} [properties] Properties to set + * @returns {pg_query.CreateFunctionStmt} CreateFunctionStmt instance + */ + CreateFunctionStmt.create = function create(properties) { + return new CreateFunctionStmt(properties); + }; + + /** + * Encodes the specified CreateFunctionStmt message. Does not implicitly {@link pg_query.CreateFunctionStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateFunctionStmt + * @static + * @param {pg_query.ICreateFunctionStmt} message CreateFunctionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFunctionStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.is_procedure != null && Object.hasOwnProperty.call(message, "is_procedure")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.is_procedure); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.replace); + if (message.funcname != null && message.funcname.length) + for (var i = 0; i < message.funcname.length; ++i) + $root.pg_query.Node.encode(message.funcname[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.pg_query.Node.encode(message.parameters[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.returnType != null && Object.hasOwnProperty.call(message, "returnType")) + $root.pg_query.TypeName.encode(message.returnType, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFunctionStmt message, length delimited. Does not implicitly {@link pg_query.CreateFunctionStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateFunctionStmt + * @static + * @param {pg_query.ICreateFunctionStmt} message CreateFunctionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFunctionStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFunctionStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateFunctionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateFunctionStmt} CreateFunctionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFunctionStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateFunctionStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.is_procedure = reader.bool(); + break; + } + case 2: { + message.replace = reader.bool(); + break; + } + case 3: { + if (!(message.funcname && message.funcname.length)) + message.funcname = []; + message.funcname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.returnType = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFunctionStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateFunctionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateFunctionStmt} CreateFunctionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFunctionStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFunctionStmt message. + * @function verify + * @memberof pg_query.CreateFunctionStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFunctionStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.is_procedure != null && message.hasOwnProperty("is_procedure")) + if (typeof message.is_procedure !== "boolean") + return "is_procedure: boolean expected"; + if (message.replace != null && message.hasOwnProperty("replace")) + if (typeof message.replace !== "boolean") + return "replace: boolean expected"; + if (message.funcname != null && message.hasOwnProperty("funcname")) { + if (!Array.isArray(message.funcname)) + return "funcname: array expected"; + for (var i = 0; i < message.funcname.length; ++i) { + var error = $root.pg_query.Node.verify(message.funcname[i]); + if (error) + return "funcname." + error; + } + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.pg_query.Node.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + if (message.returnType != null && message.hasOwnProperty("returnType")) { + var error = $root.pg_query.TypeName.verify(message.returnType); + if (error) + return "returnType." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates a CreateFunctionStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateFunctionStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateFunctionStmt} CreateFunctionStmt + */ + CreateFunctionStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateFunctionStmt) + return object; + var message = new $root.pg_query.CreateFunctionStmt(); + if (object.is_procedure != null) + message.is_procedure = Boolean(object.is_procedure); + if (object.replace != null) + message.replace = Boolean(object.replace); + if (object.funcname) { + if (!Array.isArray(object.funcname)) + throw TypeError(".pg_query.CreateFunctionStmt.funcname: array expected"); + message.funcname = []; + for (var i = 0; i < object.funcname.length; ++i) { + if (typeof object.funcname[i] !== "object") + throw TypeError(".pg_query.CreateFunctionStmt.funcname: object expected"); + message.funcname[i] = $root.pg_query.Node.fromObject(object.funcname[i]); + } + } + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".pg_query.CreateFunctionStmt.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".pg_query.CreateFunctionStmt.parameters: object expected"); + message.parameters[i] = $root.pg_query.Node.fromObject(object.parameters[i]); + } + } + if (object.returnType != null) { + if (typeof object.returnType !== "object") + throw TypeError(".pg_query.CreateFunctionStmt.returnType: object expected"); + message.returnType = $root.pg_query.TypeName.fromObject(object.returnType); + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreateFunctionStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreateFunctionStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateFunctionStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateFunctionStmt + * @static + * @param {pg_query.CreateFunctionStmt} message CreateFunctionStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFunctionStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.funcname = []; + object.parameters = []; + object.options = []; + } + if (options.defaults) { + object.is_procedure = false; + object.replace = false; + object.returnType = null; + } + if (message.is_procedure != null && message.hasOwnProperty("is_procedure")) + object.is_procedure = message.is_procedure; + if (message.replace != null && message.hasOwnProperty("replace")) + object.replace = message.replace; + if (message.funcname && message.funcname.length) { + object.funcname = []; + for (var j = 0; j < message.funcname.length; ++j) + object.funcname[j] = $root.pg_query.Node.toObject(message.funcname[j], options); + } + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.pg_query.Node.toObject(message.parameters[j], options); + } + if (message.returnType != null && message.hasOwnProperty("returnType")) + object.returnType = $root.pg_query.TypeName.toObject(message.returnType, options); + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this CreateFunctionStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateFunctionStmt + * @instance + * @returns {Object.} JSON object + */ + CreateFunctionStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFunctionStmt + * @function getTypeUrl + * @memberof pg_query.CreateFunctionStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFunctionStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateFunctionStmt"; + }; + + return CreateFunctionStmt; + })(); + + pg_query.AlterFunctionStmt = (function() { + + /** + * Properties of an AlterFunctionStmt. + * @memberof pg_query + * @interface IAlterFunctionStmt + * @property {pg_query.ObjectType|null} [objtype] AlterFunctionStmt objtype + * @property {pg_query.IObjectWithArgs|null} [func] AlterFunctionStmt func + * @property {Array.|null} [actions] AlterFunctionStmt actions + */ + + /** + * Constructs a new AlterFunctionStmt. + * @memberof pg_query + * @classdesc Represents an AlterFunctionStmt. + * @implements IAlterFunctionStmt + * @constructor + * @param {pg_query.IAlterFunctionStmt=} [properties] Properties to set + */ + function AlterFunctionStmt(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterFunctionStmt objtype. + * @member {pg_query.ObjectType} objtype + * @memberof pg_query.AlterFunctionStmt + * @instance + */ + AlterFunctionStmt.prototype.objtype = 0; + + /** + * AlterFunctionStmt func. + * @member {pg_query.IObjectWithArgs|null|undefined} func + * @memberof pg_query.AlterFunctionStmt + * @instance + */ + AlterFunctionStmt.prototype.func = null; + + /** + * AlterFunctionStmt actions. + * @member {Array.} actions + * @memberof pg_query.AlterFunctionStmt + * @instance + */ + AlterFunctionStmt.prototype.actions = $util.emptyArray; + + /** + * Creates a new AlterFunctionStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterFunctionStmt + * @static + * @param {pg_query.IAlterFunctionStmt=} [properties] Properties to set + * @returns {pg_query.AlterFunctionStmt} AlterFunctionStmt instance + */ + AlterFunctionStmt.create = function create(properties) { + return new AlterFunctionStmt(properties); + }; + + /** + * Encodes the specified AlterFunctionStmt message. Does not implicitly {@link pg_query.AlterFunctionStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterFunctionStmt + * @static + * @param {pg_query.IAlterFunctionStmt} message AlterFunctionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterFunctionStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objtype != null && Object.hasOwnProperty.call(message, "objtype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.objtype); + if (message.func != null && Object.hasOwnProperty.call(message, "func")) + $root.pg_query.ObjectWithArgs.encode(message.func, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.pg_query.Node.encode(message.actions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterFunctionStmt message, length delimited. Does not implicitly {@link pg_query.AlterFunctionStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterFunctionStmt + * @static + * @param {pg_query.IAlterFunctionStmt} message AlterFunctionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterFunctionStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterFunctionStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterFunctionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterFunctionStmt} AlterFunctionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterFunctionStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterFunctionStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.objtype = reader.int32(); + break; + } + case 2: { + message.func = $root.pg_query.ObjectWithArgs.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterFunctionStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterFunctionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterFunctionStmt} AlterFunctionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterFunctionStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterFunctionStmt message. + * @function verify + * @memberof pg_query.AlterFunctionStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterFunctionStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objtype != null && message.hasOwnProperty("objtype")) + switch (message.objtype) { + default: + return "objtype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.func != null && message.hasOwnProperty("func")) { + var error = $root.pg_query.ObjectWithArgs.verify(message.func); + if (error) + return "func." + error; + } + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.pg_query.Node.verify(message.actions[i]); + if (error) + return "actions." + error; + } + } + return null; + }; + + /** + * Creates an AlterFunctionStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterFunctionStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterFunctionStmt} AlterFunctionStmt + */ + AlterFunctionStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterFunctionStmt) + return object; + var message = new $root.pg_query.AlterFunctionStmt(); + switch (object.objtype) { + default: + if (typeof object.objtype === "number") { + message.objtype = object.objtype; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.objtype = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.objtype = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.objtype = 2; + break; + case "OBJECT_AMOP": + case 3: + message.objtype = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.objtype = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.objtype = 5; + break; + case "OBJECT_CAST": + case 6: + message.objtype = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.objtype = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.objtype = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.objtype = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.objtype = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.objtype = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.objtype = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.objtype = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.objtype = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.objtype = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.objtype = 16; + break; + case "OBJECT_FDW": + case 17: + message.objtype = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.objtype = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.objtype = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.objtype = 20; + break; + case "OBJECT_INDEX": + case 21: + message.objtype = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.objtype = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.objtype = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.objtype = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.objtype = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.objtype = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.objtype = 27; + break; + case "OBJECT_POLICY": + case 28: + message.objtype = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.objtype = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.objtype = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.objtype = 31; + break; + case "OBJECT_ROLE": + case 32: + message.objtype = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.objtype = 33; + break; + case "OBJECT_RULE": + case 34: + message.objtype = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.objtype = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.objtype = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.objtype = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.objtype = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.objtype = 39; + break; + case "OBJECT_TABLE": + case 40: + message.objtype = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.objtype = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.objtype = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.objtype = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.objtype = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.objtype = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.objtype = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.objtype = 47; + break; + case "OBJECT_TYPE": + case 48: + message.objtype = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.objtype = 49; + break; + case "OBJECT_VIEW": + case 50: + message.objtype = 50; + break; + } + if (object.func != null) { + if (typeof object.func !== "object") + throw TypeError(".pg_query.AlterFunctionStmt.func: object expected"); + message.func = $root.pg_query.ObjectWithArgs.fromObject(object.func); + } + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".pg_query.AlterFunctionStmt.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".pg_query.AlterFunctionStmt.actions: object expected"); + message.actions[i] = $root.pg_query.Node.fromObject(object.actions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlterFunctionStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterFunctionStmt + * @static + * @param {pg_query.AlterFunctionStmt} message AlterFunctionStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterFunctionStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + object.objtype = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.func = null; + } + if (message.objtype != null && message.hasOwnProperty("objtype")) + object.objtype = options.enums === String ? $root.pg_query.ObjectType[message.objtype] === undefined ? message.objtype : $root.pg_query.ObjectType[message.objtype] : message.objtype; + if (message.func != null && message.hasOwnProperty("func")) + object.func = $root.pg_query.ObjectWithArgs.toObject(message.func, options); + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.pg_query.Node.toObject(message.actions[j], options); + } + return object; + }; + + /** + * Converts this AlterFunctionStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterFunctionStmt + * @instance + * @returns {Object.} JSON object + */ + AlterFunctionStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterFunctionStmt + * @function getTypeUrl + * @memberof pg_query.AlterFunctionStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterFunctionStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterFunctionStmt"; + }; + + return AlterFunctionStmt; + })(); + + pg_query.DoStmt = (function() { + + /** + * Properties of a DoStmt. + * @memberof pg_query + * @interface IDoStmt + * @property {Array.|null} [args] DoStmt args + */ + + /** + * Constructs a new DoStmt. + * @memberof pg_query + * @classdesc Represents a DoStmt. + * @implements IDoStmt + * @constructor + * @param {pg_query.IDoStmt=} [properties] Properties to set + */ + function DoStmt(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoStmt args. + * @member {Array.} args + * @memberof pg_query.DoStmt + * @instance + */ + DoStmt.prototype.args = $util.emptyArray; + + /** + * Creates a new DoStmt instance using the specified properties. + * @function create + * @memberof pg_query.DoStmt + * @static + * @param {pg_query.IDoStmt=} [properties] Properties to set + * @returns {pg_query.DoStmt} DoStmt instance + */ + DoStmt.create = function create(properties) { + return new DoStmt(properties); + }; + + /** + * Encodes the specified DoStmt message. Does not implicitly {@link pg_query.DoStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DoStmt + * @static + * @param {pg_query.IDoStmt} message DoStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DoStmt message, length delimited. Does not implicitly {@link pg_query.DoStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DoStmt + * @static + * @param {pg_query.IDoStmt} message DoStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DoStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DoStmt} DoStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DoStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DoStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DoStmt} DoStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoStmt message. + * @function verify + * @memberof pg_query.DoStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + return null; + }; + + /** + * Creates a DoStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DoStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DoStmt} DoStmt + */ + DoStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DoStmt) + return object; + var message = new $root.pg_query.DoStmt(); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.DoStmt.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.DoStmt.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DoStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DoStmt + * @static + * @param {pg_query.DoStmt} message DoStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + return object; + }; + + /** + * Converts this DoStmt to JSON. + * @function toJSON + * @memberof pg_query.DoStmt + * @instance + * @returns {Object.} JSON object + */ + DoStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoStmt + * @function getTypeUrl + * @memberof pg_query.DoStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DoStmt"; + }; + + return DoStmt; + })(); + + pg_query.RenameStmt = (function() { + + /** + * Properties of a RenameStmt. + * @memberof pg_query + * @interface IRenameStmt + * @property {pg_query.ObjectType|null} [renameType] RenameStmt renameType + * @property {pg_query.ObjectType|null} [relationType] RenameStmt relationType + * @property {pg_query.IRangeVar|null} [relation] RenameStmt relation + * @property {pg_query.INode|null} [object] RenameStmt object + * @property {string|null} [subname] RenameStmt subname + * @property {string|null} [newname] RenameStmt newname + * @property {pg_query.DropBehavior|null} [behavior] RenameStmt behavior + * @property {boolean|null} [missing_ok] RenameStmt missing_ok + */ + + /** + * Constructs a new RenameStmt. + * @memberof pg_query + * @classdesc Represents a RenameStmt. + * @implements IRenameStmt + * @constructor + * @param {pg_query.IRenameStmt=} [properties] Properties to set + */ + function RenameStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RenameStmt renameType. + * @member {pg_query.ObjectType} renameType + * @memberof pg_query.RenameStmt + * @instance + */ + RenameStmt.prototype.renameType = 0; + + /** + * RenameStmt relationType. + * @member {pg_query.ObjectType} relationType + * @memberof pg_query.RenameStmt + * @instance + */ + RenameStmt.prototype.relationType = 0; + + /** + * RenameStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.RenameStmt + * @instance + */ + RenameStmt.prototype.relation = null; + + /** + * RenameStmt object. + * @member {pg_query.INode|null|undefined} object + * @memberof pg_query.RenameStmt + * @instance + */ + RenameStmt.prototype.object = null; + + /** + * RenameStmt subname. + * @member {string} subname + * @memberof pg_query.RenameStmt + * @instance + */ + RenameStmt.prototype.subname = ""; + + /** + * RenameStmt newname. + * @member {string} newname + * @memberof pg_query.RenameStmt + * @instance + */ + RenameStmt.prototype.newname = ""; + + /** + * RenameStmt behavior. + * @member {pg_query.DropBehavior} behavior + * @memberof pg_query.RenameStmt + * @instance + */ + RenameStmt.prototype.behavior = 0; + + /** + * RenameStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.RenameStmt + * @instance + */ + RenameStmt.prototype.missing_ok = false; + + /** + * Creates a new RenameStmt instance using the specified properties. + * @function create + * @memberof pg_query.RenameStmt + * @static + * @param {pg_query.IRenameStmt=} [properties] Properties to set + * @returns {pg_query.RenameStmt} RenameStmt instance + */ + RenameStmt.create = function create(properties) { + return new RenameStmt(properties); + }; + + /** + * Encodes the specified RenameStmt message. Does not implicitly {@link pg_query.RenameStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.RenameStmt + * @static + * @param {pg_query.IRenameStmt} message RenameStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RenameStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.renameType != null && Object.hasOwnProperty.call(message, "renameType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.renameType); + if (message.relationType != null && Object.hasOwnProperty.call(message, "relationType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.relationType); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + $root.pg_query.Node.encode(message.object, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.subname != null && Object.hasOwnProperty.call(message, "subname")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.subname); + if (message.newname != null && Object.hasOwnProperty.call(message, "newname")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.newname); + if (message.behavior != null && Object.hasOwnProperty.call(message, "behavior")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.behavior); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.missing_ok); + return writer; + }; + + /** + * Encodes the specified RenameStmt message, length delimited. Does not implicitly {@link pg_query.RenameStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RenameStmt + * @static + * @param {pg_query.IRenameStmt} message RenameStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RenameStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RenameStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RenameStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RenameStmt} RenameStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RenameStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RenameStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.renameType = reader.int32(); + break; + } + case 2: { + message.relationType = reader.int32(); + break; + } + case 3: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 4: { + message.object = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + message.subname = reader.string(); + break; + } + case 6: { + message.newname = reader.string(); + break; + } + case 7: { + message.behavior = reader.int32(); + break; + } + case 8: { + message.missing_ok = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RenameStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RenameStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RenameStmt} RenameStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RenameStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RenameStmt message. + * @function verify + * @memberof pg_query.RenameStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RenameStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.renameType != null && message.hasOwnProperty("renameType")) + switch (message.renameType) { + default: + return "renameType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.relationType != null && message.hasOwnProperty("relationType")) + switch (message.relationType) { + default: + return "relationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.object != null && message.hasOwnProperty("object")) { + var error = $root.pg_query.Node.verify(message.object); + if (error) + return "object." + error; + } + if (message.subname != null && message.hasOwnProperty("subname")) + if (!$util.isString(message.subname)) + return "subname: string expected"; + if (message.newname != null && message.hasOwnProperty("newname")) + if (!$util.isString(message.newname)) + return "newname: string expected"; + if (message.behavior != null && message.hasOwnProperty("behavior")) + switch (message.behavior) { + default: + return "behavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + return null; + }; + + /** + * Creates a RenameStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RenameStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RenameStmt} RenameStmt + */ + RenameStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RenameStmt) + return object; + var message = new $root.pg_query.RenameStmt(); + switch (object.renameType) { + default: + if (typeof object.renameType === "number") { + message.renameType = object.renameType; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.renameType = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.renameType = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.renameType = 2; + break; + case "OBJECT_AMOP": + case 3: + message.renameType = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.renameType = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.renameType = 5; + break; + case "OBJECT_CAST": + case 6: + message.renameType = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.renameType = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.renameType = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.renameType = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.renameType = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.renameType = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.renameType = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.renameType = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.renameType = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.renameType = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.renameType = 16; + break; + case "OBJECT_FDW": + case 17: + message.renameType = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.renameType = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.renameType = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.renameType = 20; + break; + case "OBJECT_INDEX": + case 21: + message.renameType = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.renameType = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.renameType = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.renameType = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.renameType = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.renameType = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.renameType = 27; + break; + case "OBJECT_POLICY": + case 28: + message.renameType = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.renameType = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.renameType = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.renameType = 31; + break; + case "OBJECT_ROLE": + case 32: + message.renameType = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.renameType = 33; + break; + case "OBJECT_RULE": + case 34: + message.renameType = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.renameType = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.renameType = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.renameType = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.renameType = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.renameType = 39; + break; + case "OBJECT_TABLE": + case 40: + message.renameType = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.renameType = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.renameType = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.renameType = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.renameType = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.renameType = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.renameType = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.renameType = 47; + break; + case "OBJECT_TYPE": + case 48: + message.renameType = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.renameType = 49; + break; + case "OBJECT_VIEW": + case 50: + message.renameType = 50; + break; + } + switch (object.relationType) { + default: + if (typeof object.relationType === "number") { + message.relationType = object.relationType; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.relationType = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.relationType = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.relationType = 2; + break; + case "OBJECT_AMOP": + case 3: + message.relationType = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.relationType = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.relationType = 5; + break; + case "OBJECT_CAST": + case 6: + message.relationType = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.relationType = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.relationType = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.relationType = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.relationType = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.relationType = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.relationType = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.relationType = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.relationType = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.relationType = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.relationType = 16; + break; + case "OBJECT_FDW": + case 17: + message.relationType = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.relationType = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.relationType = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.relationType = 20; + break; + case "OBJECT_INDEX": + case 21: + message.relationType = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.relationType = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.relationType = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.relationType = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.relationType = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.relationType = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.relationType = 27; + break; + case "OBJECT_POLICY": + case 28: + message.relationType = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.relationType = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.relationType = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.relationType = 31; + break; + case "OBJECT_ROLE": + case 32: + message.relationType = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.relationType = 33; + break; + case "OBJECT_RULE": + case 34: + message.relationType = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.relationType = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.relationType = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.relationType = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.relationType = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.relationType = 39; + break; + case "OBJECT_TABLE": + case 40: + message.relationType = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.relationType = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.relationType = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.relationType = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.relationType = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.relationType = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.relationType = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.relationType = 47; + break; + case "OBJECT_TYPE": + case 48: + message.relationType = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.relationType = 49; + break; + case "OBJECT_VIEW": + case 50: + message.relationType = 50; + break; + } + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.RenameStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.object != null) { + if (typeof object.object !== "object") + throw TypeError(".pg_query.RenameStmt.object: object expected"); + message.object = $root.pg_query.Node.fromObject(object.object); + } + if (object.subname != null) + message.subname = String(object.subname); + if (object.newname != null) + message.newname = String(object.newname); + switch (object.behavior) { + default: + if (typeof object.behavior === "number") { + message.behavior = object.behavior; + break; + } + break; + case "DROP_BEHAVIOR_UNDEFINED": + case 0: + message.behavior = 0; + break; + case "DROP_RESTRICT": + case 1: + message.behavior = 1; + break; + case "DROP_CASCADE": + case 2: + message.behavior = 2; + break; + } + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + return message; + }; + + /** + * Creates a plain object from a RenameStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RenameStmt + * @static + * @param {pg_query.RenameStmt} message RenameStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RenameStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.renameType = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.relationType = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.relation = null; + object.object = null; + object.subname = ""; + object.newname = ""; + object.behavior = options.enums === String ? "DROP_BEHAVIOR_UNDEFINED" : 0; + object.missing_ok = false; + } + if (message.renameType != null && message.hasOwnProperty("renameType")) + object.renameType = options.enums === String ? $root.pg_query.ObjectType[message.renameType] === undefined ? message.renameType : $root.pg_query.ObjectType[message.renameType] : message.renameType; + if (message.relationType != null && message.hasOwnProperty("relationType")) + object.relationType = options.enums === String ? $root.pg_query.ObjectType[message.relationType] === undefined ? message.relationType : $root.pg_query.ObjectType[message.relationType] : message.relationType; + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.object != null && message.hasOwnProperty("object")) + object.object = $root.pg_query.Node.toObject(message.object, options); + if (message.subname != null && message.hasOwnProperty("subname")) + object.subname = message.subname; + if (message.newname != null && message.hasOwnProperty("newname")) + object.newname = message.newname; + if (message.behavior != null && message.hasOwnProperty("behavior")) + object.behavior = options.enums === String ? $root.pg_query.DropBehavior[message.behavior] === undefined ? message.behavior : $root.pg_query.DropBehavior[message.behavior] : message.behavior; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + return object; + }; + + /** + * Converts this RenameStmt to JSON. + * @function toJSON + * @memberof pg_query.RenameStmt + * @instance + * @returns {Object.} JSON object + */ + RenameStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RenameStmt + * @function getTypeUrl + * @memberof pg_query.RenameStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RenameStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RenameStmt"; + }; + + return RenameStmt; + })(); + + pg_query.RuleStmt = (function() { + + /** + * Properties of a RuleStmt. + * @memberof pg_query + * @interface IRuleStmt + * @property {pg_query.IRangeVar|null} [relation] RuleStmt relation + * @property {string|null} [rulename] RuleStmt rulename + * @property {pg_query.INode|null} [whereClause] RuleStmt whereClause + * @property {pg_query.CmdType|null} [event] RuleStmt event + * @property {boolean|null} [instead] RuleStmt instead + * @property {Array.|null} [actions] RuleStmt actions + * @property {boolean|null} [replace] RuleStmt replace + */ + + /** + * Constructs a new RuleStmt. + * @memberof pg_query + * @classdesc Represents a RuleStmt. + * @implements IRuleStmt + * @constructor + * @param {pg_query.IRuleStmt=} [properties] Properties to set + */ + function RuleStmt(properties) { + this.actions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RuleStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.RuleStmt + * @instance + */ + RuleStmt.prototype.relation = null; + + /** + * RuleStmt rulename. + * @member {string} rulename + * @memberof pg_query.RuleStmt + * @instance + */ + RuleStmt.prototype.rulename = ""; + + /** + * RuleStmt whereClause. + * @member {pg_query.INode|null|undefined} whereClause + * @memberof pg_query.RuleStmt + * @instance + */ + RuleStmt.prototype.whereClause = null; + + /** + * RuleStmt event. + * @member {pg_query.CmdType} event + * @memberof pg_query.RuleStmt + * @instance + */ + RuleStmt.prototype.event = 0; + + /** + * RuleStmt instead. + * @member {boolean} instead + * @memberof pg_query.RuleStmt + * @instance + */ + RuleStmt.prototype.instead = false; + + /** + * RuleStmt actions. + * @member {Array.} actions + * @memberof pg_query.RuleStmt + * @instance + */ + RuleStmt.prototype.actions = $util.emptyArray; + + /** + * RuleStmt replace. + * @member {boolean} replace + * @memberof pg_query.RuleStmt + * @instance + */ + RuleStmt.prototype.replace = false; + + /** + * Creates a new RuleStmt instance using the specified properties. + * @function create + * @memberof pg_query.RuleStmt + * @static + * @param {pg_query.IRuleStmt=} [properties] Properties to set + * @returns {pg_query.RuleStmt} RuleStmt instance + */ + RuleStmt.create = function create(properties) { + return new RuleStmt(properties); + }; + + /** + * Encodes the specified RuleStmt message. Does not implicitly {@link pg_query.RuleStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.RuleStmt + * @static + * @param {pg_query.IRuleStmt} message RuleStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rulename != null && Object.hasOwnProperty.call(message, "rulename")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rulename); + if (message.whereClause != null && Object.hasOwnProperty.call(message, "whereClause")) + $root.pg_query.Node.encode(message.whereClause, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.event); + if (message.instead != null && Object.hasOwnProperty.call(message, "instead")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.instead); + if (message.actions != null && message.actions.length) + for (var i = 0; i < message.actions.length; ++i) + $root.pg_query.Node.encode(message.actions[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.replace); + return writer; + }; + + /** + * Encodes the specified RuleStmt message, length delimited. Does not implicitly {@link pg_query.RuleStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RuleStmt + * @static + * @param {pg_query.IRuleStmt} message RuleStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuleStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RuleStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RuleStmt} RuleStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RuleStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + message.rulename = reader.string(); + break; + } + case 3: { + message.whereClause = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.event = reader.int32(); + break; + } + case 5: { + message.instead = reader.bool(); + break; + } + case 6: { + if (!(message.actions && message.actions.length)) + message.actions = []; + message.actions.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + message.replace = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuleStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RuleStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RuleStmt} RuleStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuleStmt message. + * @function verify + * @memberof pg_query.RuleStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuleStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.rulename != null && message.hasOwnProperty("rulename")) + if (!$util.isString(message.rulename)) + return "rulename: string expected"; + if (message.whereClause != null && message.hasOwnProperty("whereClause")) { + var error = $root.pg_query.Node.verify(message.whereClause); + if (error) + return "whereClause." + error; + } + if (message.event != null && message.hasOwnProperty("event")) + switch (message.event) { + default: + return "event: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.instead != null && message.hasOwnProperty("instead")) + if (typeof message.instead !== "boolean") + return "instead: boolean expected"; + if (message.actions != null && message.hasOwnProperty("actions")) { + if (!Array.isArray(message.actions)) + return "actions: array expected"; + for (var i = 0; i < message.actions.length; ++i) { + var error = $root.pg_query.Node.verify(message.actions[i]); + if (error) + return "actions." + error; + } + } + if (message.replace != null && message.hasOwnProperty("replace")) + if (typeof message.replace !== "boolean") + return "replace: boolean expected"; + return null; + }; + + /** + * Creates a RuleStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RuleStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RuleStmt} RuleStmt + */ + RuleStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RuleStmt) + return object; + var message = new $root.pg_query.RuleStmt(); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.RuleStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.rulename != null) + message.rulename = String(object.rulename); + if (object.whereClause != null) { + if (typeof object.whereClause !== "object") + throw TypeError(".pg_query.RuleStmt.whereClause: object expected"); + message.whereClause = $root.pg_query.Node.fromObject(object.whereClause); + } + switch (object.event) { + default: + if (typeof object.event === "number") { + message.event = object.event; + break; + } + break; + case "CMD_TYPE_UNDEFINED": + case 0: + message.event = 0; + break; + case "CMD_UNKNOWN": + case 1: + message.event = 1; + break; + case "CMD_SELECT": + case 2: + message.event = 2; + break; + case "CMD_UPDATE": + case 3: + message.event = 3; + break; + case "CMD_INSERT": + case 4: + message.event = 4; + break; + case "CMD_DELETE": + case 5: + message.event = 5; + break; + case "CMD_UTILITY": + case 6: + message.event = 6; + break; + case "CMD_NOTHING": + case 7: + message.event = 7; + break; + } + if (object.instead != null) + message.instead = Boolean(object.instead); + if (object.actions) { + if (!Array.isArray(object.actions)) + throw TypeError(".pg_query.RuleStmt.actions: array expected"); + message.actions = []; + for (var i = 0; i < object.actions.length; ++i) { + if (typeof object.actions[i] !== "object") + throw TypeError(".pg_query.RuleStmt.actions: object expected"); + message.actions[i] = $root.pg_query.Node.fromObject(object.actions[i]); + } + } + if (object.replace != null) + message.replace = Boolean(object.replace); + return message; + }; + + /** + * Creates a plain object from a RuleStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RuleStmt + * @static + * @param {pg_query.RuleStmt} message RuleStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuleStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.actions = []; + if (options.defaults) { + object.relation = null; + object.rulename = ""; + object.whereClause = null; + object.event = options.enums === String ? "CMD_TYPE_UNDEFINED" : 0; + object.instead = false; + object.replace = false; + } + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.rulename != null && message.hasOwnProperty("rulename")) + object.rulename = message.rulename; + if (message.whereClause != null && message.hasOwnProperty("whereClause")) + object.whereClause = $root.pg_query.Node.toObject(message.whereClause, options); + if (message.event != null && message.hasOwnProperty("event")) + object.event = options.enums === String ? $root.pg_query.CmdType[message.event] === undefined ? message.event : $root.pg_query.CmdType[message.event] : message.event; + if (message.instead != null && message.hasOwnProperty("instead")) + object.instead = message.instead; + if (message.actions && message.actions.length) { + object.actions = []; + for (var j = 0; j < message.actions.length; ++j) + object.actions[j] = $root.pg_query.Node.toObject(message.actions[j], options); + } + if (message.replace != null && message.hasOwnProperty("replace")) + object.replace = message.replace; + return object; + }; + + /** + * Converts this RuleStmt to JSON. + * @function toJSON + * @memberof pg_query.RuleStmt + * @instance + * @returns {Object.} JSON object + */ + RuleStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuleStmt + * @function getTypeUrl + * @memberof pg_query.RuleStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuleStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RuleStmt"; + }; + + return RuleStmt; + })(); + + pg_query.NotifyStmt = (function() { + + /** + * Properties of a NotifyStmt. + * @memberof pg_query + * @interface INotifyStmt + * @property {string|null} [conditionname] NotifyStmt conditionname + * @property {string|null} [payload] NotifyStmt payload + */ + + /** + * Constructs a new NotifyStmt. + * @memberof pg_query + * @classdesc Represents a NotifyStmt. + * @implements INotifyStmt + * @constructor + * @param {pg_query.INotifyStmt=} [properties] Properties to set + */ + function NotifyStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotifyStmt conditionname. + * @member {string} conditionname + * @memberof pg_query.NotifyStmt + * @instance + */ + NotifyStmt.prototype.conditionname = ""; + + /** + * NotifyStmt payload. + * @member {string} payload + * @memberof pg_query.NotifyStmt + * @instance + */ + NotifyStmt.prototype.payload = ""; + + /** + * Creates a new NotifyStmt instance using the specified properties. + * @function create + * @memberof pg_query.NotifyStmt + * @static + * @param {pg_query.INotifyStmt=} [properties] Properties to set + * @returns {pg_query.NotifyStmt} NotifyStmt instance + */ + NotifyStmt.create = function create(properties) { + return new NotifyStmt(properties); + }; + + /** + * Encodes the specified NotifyStmt message. Does not implicitly {@link pg_query.NotifyStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.NotifyStmt + * @static + * @param {pg_query.INotifyStmt} message NotifyStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotifyStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionname != null && Object.hasOwnProperty.call(message, "conditionname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conditionname); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.payload); + return writer; + }; + + /** + * Encodes the specified NotifyStmt message, length delimited. Does not implicitly {@link pg_query.NotifyStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.NotifyStmt + * @static + * @param {pg_query.INotifyStmt} message NotifyStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotifyStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotifyStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.NotifyStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.NotifyStmt} NotifyStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotifyStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.NotifyStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.conditionname = reader.string(); + break; + } + case 2: { + message.payload = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotifyStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.NotifyStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.NotifyStmt} NotifyStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotifyStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotifyStmt message. + * @function verify + * @memberof pg_query.NotifyStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotifyStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditionname != null && message.hasOwnProperty("conditionname")) + if (!$util.isString(message.conditionname)) + return "conditionname: string expected"; + if (message.payload != null && message.hasOwnProperty("payload")) + if (!$util.isString(message.payload)) + return "payload: string expected"; + return null; + }; + + /** + * Creates a NotifyStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.NotifyStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.NotifyStmt} NotifyStmt + */ + NotifyStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.NotifyStmt) + return object; + var message = new $root.pg_query.NotifyStmt(); + if (object.conditionname != null) + message.conditionname = String(object.conditionname); + if (object.payload != null) + message.payload = String(object.payload); + return message; + }; + + /** + * Creates a plain object from a NotifyStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.NotifyStmt + * @static + * @param {pg_query.NotifyStmt} message NotifyStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotifyStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.conditionname = ""; + object.payload = ""; + } + if (message.conditionname != null && message.hasOwnProperty("conditionname")) + object.conditionname = message.conditionname; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = message.payload; + return object; + }; + + /** + * Converts this NotifyStmt to JSON. + * @function toJSON + * @memberof pg_query.NotifyStmt + * @instance + * @returns {Object.} JSON object + */ + NotifyStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NotifyStmt + * @function getTypeUrl + * @memberof pg_query.NotifyStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotifyStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.NotifyStmt"; + }; + + return NotifyStmt; + })(); + + pg_query.ListenStmt = (function() { + + /** + * Properties of a ListenStmt. + * @memberof pg_query + * @interface IListenStmt + * @property {string|null} [conditionname] ListenStmt conditionname + */ + + /** + * Constructs a new ListenStmt. + * @memberof pg_query + * @classdesc Represents a ListenStmt. + * @implements IListenStmt + * @constructor + * @param {pg_query.IListenStmt=} [properties] Properties to set + */ + function ListenStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListenStmt conditionname. + * @member {string} conditionname + * @memberof pg_query.ListenStmt + * @instance + */ + ListenStmt.prototype.conditionname = ""; + + /** + * Creates a new ListenStmt instance using the specified properties. + * @function create + * @memberof pg_query.ListenStmt + * @static + * @param {pg_query.IListenStmt=} [properties] Properties to set + * @returns {pg_query.ListenStmt} ListenStmt instance + */ + ListenStmt.create = function create(properties) { + return new ListenStmt(properties); + }; + + /** + * Encodes the specified ListenStmt message. Does not implicitly {@link pg_query.ListenStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.ListenStmt + * @static + * @param {pg_query.IListenStmt} message ListenStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListenStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionname != null && Object.hasOwnProperty.call(message, "conditionname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conditionname); + return writer; + }; + + /** + * Encodes the specified ListenStmt message, length delimited. Does not implicitly {@link pg_query.ListenStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ListenStmt + * @static + * @param {pg_query.IListenStmt} message ListenStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListenStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListenStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ListenStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ListenStmt} ListenStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListenStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ListenStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.conditionname = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListenStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ListenStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ListenStmt} ListenStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListenStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListenStmt message. + * @function verify + * @memberof pg_query.ListenStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListenStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditionname != null && message.hasOwnProperty("conditionname")) + if (!$util.isString(message.conditionname)) + return "conditionname: string expected"; + return null; + }; + + /** + * Creates a ListenStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ListenStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ListenStmt} ListenStmt + */ + ListenStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ListenStmt) + return object; + var message = new $root.pg_query.ListenStmt(); + if (object.conditionname != null) + message.conditionname = String(object.conditionname); + return message; + }; + + /** + * Creates a plain object from a ListenStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ListenStmt + * @static + * @param {pg_query.ListenStmt} message ListenStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListenStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.conditionname = ""; + if (message.conditionname != null && message.hasOwnProperty("conditionname")) + object.conditionname = message.conditionname; + return object; + }; + + /** + * Converts this ListenStmt to JSON. + * @function toJSON + * @memberof pg_query.ListenStmt + * @instance + * @returns {Object.} JSON object + */ + ListenStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListenStmt + * @function getTypeUrl + * @memberof pg_query.ListenStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListenStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ListenStmt"; + }; + + return ListenStmt; + })(); + + pg_query.UnlistenStmt = (function() { + + /** + * Properties of an UnlistenStmt. + * @memberof pg_query + * @interface IUnlistenStmt + * @property {string|null} [conditionname] UnlistenStmt conditionname + */ + + /** + * Constructs a new UnlistenStmt. + * @memberof pg_query + * @classdesc Represents an UnlistenStmt. + * @implements IUnlistenStmt + * @constructor + * @param {pg_query.IUnlistenStmt=} [properties] Properties to set + */ + function UnlistenStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UnlistenStmt conditionname. + * @member {string} conditionname + * @memberof pg_query.UnlistenStmt + * @instance + */ + UnlistenStmt.prototype.conditionname = ""; + + /** + * Creates a new UnlistenStmt instance using the specified properties. + * @function create + * @memberof pg_query.UnlistenStmt + * @static + * @param {pg_query.IUnlistenStmt=} [properties] Properties to set + * @returns {pg_query.UnlistenStmt} UnlistenStmt instance + */ + UnlistenStmt.create = function create(properties) { + return new UnlistenStmt(properties); + }; + + /** + * Encodes the specified UnlistenStmt message. Does not implicitly {@link pg_query.UnlistenStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.UnlistenStmt + * @static + * @param {pg_query.IUnlistenStmt} message UnlistenStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnlistenStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditionname != null && Object.hasOwnProperty.call(message, "conditionname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conditionname); + return writer; + }; + + /** + * Encodes the specified UnlistenStmt message, length delimited. Does not implicitly {@link pg_query.UnlistenStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.UnlistenStmt + * @static + * @param {pg_query.IUnlistenStmt} message UnlistenStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UnlistenStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UnlistenStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.UnlistenStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.UnlistenStmt} UnlistenStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnlistenStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.UnlistenStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.conditionname = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UnlistenStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.UnlistenStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.UnlistenStmt} UnlistenStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UnlistenStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UnlistenStmt message. + * @function verify + * @memberof pg_query.UnlistenStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UnlistenStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditionname != null && message.hasOwnProperty("conditionname")) + if (!$util.isString(message.conditionname)) + return "conditionname: string expected"; + return null; + }; + + /** + * Creates an UnlistenStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.UnlistenStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.UnlistenStmt} UnlistenStmt + */ + UnlistenStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.UnlistenStmt) + return object; + var message = new $root.pg_query.UnlistenStmt(); + if (object.conditionname != null) + message.conditionname = String(object.conditionname); + return message; + }; + + /** + * Creates a plain object from an UnlistenStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.UnlistenStmt + * @static + * @param {pg_query.UnlistenStmt} message UnlistenStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UnlistenStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.conditionname = ""; + if (message.conditionname != null && message.hasOwnProperty("conditionname")) + object.conditionname = message.conditionname; + return object; + }; + + /** + * Converts this UnlistenStmt to JSON. + * @function toJSON + * @memberof pg_query.UnlistenStmt + * @instance + * @returns {Object.} JSON object + */ + UnlistenStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UnlistenStmt + * @function getTypeUrl + * @memberof pg_query.UnlistenStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UnlistenStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.UnlistenStmt"; + }; + + return UnlistenStmt; + })(); + + pg_query.TransactionStmt = (function() { + + /** + * Properties of a TransactionStmt. + * @memberof pg_query + * @interface ITransactionStmt + * @property {pg_query.TransactionStmtKind|null} [kind] TransactionStmt kind + * @property {Array.|null} [options] TransactionStmt options + * @property {string|null} [savepoint_name] TransactionStmt savepoint_name + * @property {string|null} [gid] TransactionStmt gid + * @property {boolean|null} [chain] TransactionStmt chain + */ + + /** + * Constructs a new TransactionStmt. + * @memberof pg_query + * @classdesc Represents a TransactionStmt. + * @implements ITransactionStmt + * @constructor + * @param {pg_query.ITransactionStmt=} [properties] Properties to set + */ + function TransactionStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransactionStmt kind. + * @member {pg_query.TransactionStmtKind} kind + * @memberof pg_query.TransactionStmt + * @instance + */ + TransactionStmt.prototype.kind = 0; + + /** + * TransactionStmt options. + * @member {Array.} options + * @memberof pg_query.TransactionStmt + * @instance + */ + TransactionStmt.prototype.options = $util.emptyArray; + + /** + * TransactionStmt savepoint_name. + * @member {string} savepoint_name + * @memberof pg_query.TransactionStmt + * @instance + */ + TransactionStmt.prototype.savepoint_name = ""; + + /** + * TransactionStmt gid. + * @member {string} gid + * @memberof pg_query.TransactionStmt + * @instance + */ + TransactionStmt.prototype.gid = ""; + + /** + * TransactionStmt chain. + * @member {boolean} chain + * @memberof pg_query.TransactionStmt + * @instance + */ + TransactionStmt.prototype.chain = false; + + /** + * Creates a new TransactionStmt instance using the specified properties. + * @function create + * @memberof pg_query.TransactionStmt + * @static + * @param {pg_query.ITransactionStmt=} [properties] Properties to set + * @returns {pg_query.TransactionStmt} TransactionStmt instance + */ + TransactionStmt.create = function create(properties) { + return new TransactionStmt(properties); + }; + + /** + * Encodes the specified TransactionStmt message. Does not implicitly {@link pg_query.TransactionStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.TransactionStmt + * @static + * @param {pg_query.ITransactionStmt} message TransactionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.savepoint_name != null && Object.hasOwnProperty.call(message, "savepoint_name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.savepoint_name); + if (message.gid != null && Object.hasOwnProperty.call(message, "gid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.gid); + if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.chain); + return writer; + }; + + /** + * Encodes the specified TransactionStmt message, length delimited. Does not implicitly {@link pg_query.TransactionStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.TransactionStmt + * @static + * @param {pg_query.ITransactionStmt} message TransactionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransactionStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransactionStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.TransactionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.TransactionStmt} TransactionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.TransactionStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.savepoint_name = reader.string(); + break; + } + case 4: { + message.gid = reader.string(); + break; + } + case 5: { + message.chain = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransactionStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.TransactionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.TransactionStmt} TransactionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransactionStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransactionStmt message. + * @function verify + * @memberof pg_query.TransactionStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransactionStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.savepoint_name != null && message.hasOwnProperty("savepoint_name")) + if (!$util.isString(message.savepoint_name)) + return "savepoint_name: string expected"; + if (message.gid != null && message.hasOwnProperty("gid")) + if (!$util.isString(message.gid)) + return "gid: string expected"; + if (message.chain != null && message.hasOwnProperty("chain")) + if (typeof message.chain !== "boolean") + return "chain: boolean expected"; + return null; + }; + + /** + * Creates a TransactionStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.TransactionStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.TransactionStmt} TransactionStmt + */ + TransactionStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.TransactionStmt) + return object; + var message = new $root.pg_query.TransactionStmt(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "TRANSACTION_STMT_KIND_UNDEFINED": + case 0: + message.kind = 0; + break; + case "TRANS_STMT_BEGIN": + case 1: + message.kind = 1; + break; + case "TRANS_STMT_START": + case 2: + message.kind = 2; + break; + case "TRANS_STMT_COMMIT": + case 3: + message.kind = 3; + break; + case "TRANS_STMT_ROLLBACK": + case 4: + message.kind = 4; + break; + case "TRANS_STMT_SAVEPOINT": + case 5: + message.kind = 5; + break; + case "TRANS_STMT_RELEASE": + case 6: + message.kind = 6; + break; + case "TRANS_STMT_ROLLBACK_TO": + case 7: + message.kind = 7; + break; + case "TRANS_STMT_PREPARE": + case 8: + message.kind = 8; + break; + case "TRANS_STMT_COMMIT_PREPARED": + case 9: + message.kind = 9; + break; + case "TRANS_STMT_ROLLBACK_PREPARED": + case 10: + message.kind = 10; + break; + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.TransactionStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.TransactionStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.savepoint_name != null) + message.savepoint_name = String(object.savepoint_name); + if (object.gid != null) + message.gid = String(object.gid); + if (object.chain != null) + message.chain = Boolean(object.chain); + return message; + }; + + /** + * Creates a plain object from a TransactionStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.TransactionStmt + * @static + * @param {pg_query.TransactionStmt} message TransactionStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransactionStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.kind = options.enums === String ? "TRANSACTION_STMT_KIND_UNDEFINED" : 0; + object.savepoint_name = ""; + object.gid = ""; + object.chain = false; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.pg_query.TransactionStmtKind[message.kind] === undefined ? message.kind : $root.pg_query.TransactionStmtKind[message.kind] : message.kind; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.savepoint_name != null && message.hasOwnProperty("savepoint_name")) + object.savepoint_name = message.savepoint_name; + if (message.gid != null && message.hasOwnProperty("gid")) + object.gid = message.gid; + if (message.chain != null && message.hasOwnProperty("chain")) + object.chain = message.chain; + return object; + }; + + /** + * Converts this TransactionStmt to JSON. + * @function toJSON + * @memberof pg_query.TransactionStmt + * @instance + * @returns {Object.} JSON object + */ + TransactionStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransactionStmt + * @function getTypeUrl + * @memberof pg_query.TransactionStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransactionStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.TransactionStmt"; + }; + + return TransactionStmt; + })(); + + pg_query.ViewStmt = (function() { + + /** + * Properties of a ViewStmt. + * @memberof pg_query + * @interface IViewStmt + * @property {pg_query.IRangeVar|null} [view] ViewStmt view + * @property {Array.|null} [aliases] ViewStmt aliases + * @property {pg_query.INode|null} [query] ViewStmt query + * @property {boolean|null} [replace] ViewStmt replace + * @property {Array.|null} [options] ViewStmt options + * @property {pg_query.ViewCheckOption|null} [withCheckOption] ViewStmt withCheckOption + */ + + /** + * Constructs a new ViewStmt. + * @memberof pg_query + * @classdesc Represents a ViewStmt. + * @implements IViewStmt + * @constructor + * @param {pg_query.IViewStmt=} [properties] Properties to set + */ + function ViewStmt(properties) { + this.aliases = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ViewStmt view. + * @member {pg_query.IRangeVar|null|undefined} view + * @memberof pg_query.ViewStmt + * @instance + */ + ViewStmt.prototype.view = null; + + /** + * ViewStmt aliases. + * @member {Array.} aliases + * @memberof pg_query.ViewStmt + * @instance + */ + ViewStmt.prototype.aliases = $util.emptyArray; + + /** + * ViewStmt query. + * @member {pg_query.INode|null|undefined} query + * @memberof pg_query.ViewStmt + * @instance + */ + ViewStmt.prototype.query = null; + + /** + * ViewStmt replace. + * @member {boolean} replace + * @memberof pg_query.ViewStmt + * @instance + */ + ViewStmt.prototype.replace = false; + + /** + * ViewStmt options. + * @member {Array.} options + * @memberof pg_query.ViewStmt + * @instance + */ + ViewStmt.prototype.options = $util.emptyArray; + + /** + * ViewStmt withCheckOption. + * @member {pg_query.ViewCheckOption} withCheckOption + * @memberof pg_query.ViewStmt + * @instance + */ + ViewStmt.prototype.withCheckOption = 0; + + /** + * Creates a new ViewStmt instance using the specified properties. + * @function create + * @memberof pg_query.ViewStmt + * @static + * @param {pg_query.IViewStmt=} [properties] Properties to set + * @returns {pg_query.ViewStmt} ViewStmt instance + */ + ViewStmt.create = function create(properties) { + return new ViewStmt(properties); + }; + + /** + * Encodes the specified ViewStmt message. Does not implicitly {@link pg_query.ViewStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.ViewStmt + * @static + * @param {pg_query.IViewStmt} message ViewStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViewStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + $root.pg_query.RangeVar.encode(message.view, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.aliases != null && message.aliases.length) + for (var i = 0; i < message.aliases.length; ++i) + $root.pg_query.Node.encode(message.aliases[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.pg_query.Node.encode(message.query, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.replace); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.withCheckOption != null && Object.hasOwnProperty.call(message, "withCheckOption")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.withCheckOption); + return writer; + }; + + /** + * Encodes the specified ViewStmt message, length delimited. Does not implicitly {@link pg_query.ViewStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ViewStmt + * @static + * @param {pg_query.IViewStmt} message ViewStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ViewStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ViewStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ViewStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ViewStmt} ViewStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViewStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ViewStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.view = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.aliases && message.aliases.length)) + message.aliases = []; + message.aliases.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.query = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.replace = reader.bool(); + break; + } + case 5: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.withCheckOption = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ViewStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ViewStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ViewStmt} ViewStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ViewStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ViewStmt message. + * @function verify + * @memberof pg_query.ViewStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ViewStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.view != null && message.hasOwnProperty("view")) { + var error = $root.pg_query.RangeVar.verify(message.view); + if (error) + return "view." + error; + } + if (message.aliases != null && message.hasOwnProperty("aliases")) { + if (!Array.isArray(message.aliases)) + return "aliases: array expected"; + for (var i = 0; i < message.aliases.length; ++i) { + var error = $root.pg_query.Node.verify(message.aliases[i]); + if (error) + return "aliases." + error; + } + } + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.pg_query.Node.verify(message.query); + if (error) + return "query." + error; + } + if (message.replace != null && message.hasOwnProperty("replace")) + if (typeof message.replace !== "boolean") + return "replace: boolean expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.withCheckOption != null && message.hasOwnProperty("withCheckOption")) + switch (message.withCheckOption) { + default: + return "withCheckOption: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ViewStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ViewStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ViewStmt} ViewStmt + */ + ViewStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ViewStmt) + return object; + var message = new $root.pg_query.ViewStmt(); + if (object.view != null) { + if (typeof object.view !== "object") + throw TypeError(".pg_query.ViewStmt.view: object expected"); + message.view = $root.pg_query.RangeVar.fromObject(object.view); + } + if (object.aliases) { + if (!Array.isArray(object.aliases)) + throw TypeError(".pg_query.ViewStmt.aliases: array expected"); + message.aliases = []; + for (var i = 0; i < object.aliases.length; ++i) { + if (typeof object.aliases[i] !== "object") + throw TypeError(".pg_query.ViewStmt.aliases: object expected"); + message.aliases[i] = $root.pg_query.Node.fromObject(object.aliases[i]); + } + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".pg_query.ViewStmt.query: object expected"); + message.query = $root.pg_query.Node.fromObject(object.query); + } + if (object.replace != null) + message.replace = Boolean(object.replace); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.ViewStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.ViewStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + switch (object.withCheckOption) { + default: + if (typeof object.withCheckOption === "number") { + message.withCheckOption = object.withCheckOption; + break; + } + break; + case "VIEW_CHECK_OPTION_UNDEFINED": + case 0: + message.withCheckOption = 0; + break; + case "NO_CHECK_OPTION": + case 1: + message.withCheckOption = 1; + break; + case "LOCAL_CHECK_OPTION": + case 2: + message.withCheckOption = 2; + break; + case "CASCADED_CHECK_OPTION": + case 3: + message.withCheckOption = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ViewStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ViewStmt + * @static + * @param {pg_query.ViewStmt} message ViewStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ViewStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.aliases = []; + object.options = []; + } + if (options.defaults) { + object.view = null; + object.query = null; + object.replace = false; + object.withCheckOption = options.enums === String ? "VIEW_CHECK_OPTION_UNDEFINED" : 0; + } + if (message.view != null && message.hasOwnProperty("view")) + object.view = $root.pg_query.RangeVar.toObject(message.view, options); + if (message.aliases && message.aliases.length) { + object.aliases = []; + for (var j = 0; j < message.aliases.length; ++j) + object.aliases[j] = $root.pg_query.Node.toObject(message.aliases[j], options); + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.pg_query.Node.toObject(message.query, options); + if (message.replace != null && message.hasOwnProperty("replace")) + object.replace = message.replace; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.withCheckOption != null && message.hasOwnProperty("withCheckOption")) + object.withCheckOption = options.enums === String ? $root.pg_query.ViewCheckOption[message.withCheckOption] === undefined ? message.withCheckOption : $root.pg_query.ViewCheckOption[message.withCheckOption] : message.withCheckOption; + return object; + }; + + /** + * Converts this ViewStmt to JSON. + * @function toJSON + * @memberof pg_query.ViewStmt + * @instance + * @returns {Object.} JSON object + */ + ViewStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ViewStmt + * @function getTypeUrl + * @memberof pg_query.ViewStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ViewStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ViewStmt"; + }; + + return ViewStmt; + })(); + + pg_query.LoadStmt = (function() { + + /** + * Properties of a LoadStmt. + * @memberof pg_query + * @interface ILoadStmt + * @property {string|null} [filename] LoadStmt filename + */ + + /** + * Constructs a new LoadStmt. + * @memberof pg_query + * @classdesc Represents a LoadStmt. + * @implements ILoadStmt + * @constructor + * @param {pg_query.ILoadStmt=} [properties] Properties to set + */ + function LoadStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoadStmt filename. + * @member {string} filename + * @memberof pg_query.LoadStmt + * @instance + */ + LoadStmt.prototype.filename = ""; + + /** + * Creates a new LoadStmt instance using the specified properties. + * @function create + * @memberof pg_query.LoadStmt + * @static + * @param {pg_query.ILoadStmt=} [properties] Properties to set + * @returns {pg_query.LoadStmt} LoadStmt instance + */ + LoadStmt.create = function create(properties) { + return new LoadStmt(properties); + }; + + /** + * Encodes the specified LoadStmt message. Does not implicitly {@link pg_query.LoadStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.LoadStmt + * @static + * @param {pg_query.ILoadStmt} message LoadStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filename); + return writer; + }; + + /** + * Encodes the specified LoadStmt message, length delimited. Does not implicitly {@link pg_query.LoadStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.LoadStmt + * @static + * @param {pg_query.ILoadStmt} message LoadStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoadStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoadStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.LoadStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.LoadStmt} LoadStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.LoadStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.filename = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoadStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.LoadStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.LoadStmt} LoadStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoadStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoadStmt message. + * @function verify + * @memberof pg_query.LoadStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoadStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.filename != null && message.hasOwnProperty("filename")) + if (!$util.isString(message.filename)) + return "filename: string expected"; + return null; + }; + + /** + * Creates a LoadStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.LoadStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.LoadStmt} LoadStmt + */ + LoadStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.LoadStmt) + return object; + var message = new $root.pg_query.LoadStmt(); + if (object.filename != null) + message.filename = String(object.filename); + return message; + }; + + /** + * Creates a plain object from a LoadStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.LoadStmt + * @static + * @param {pg_query.LoadStmt} message LoadStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoadStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.filename = ""; + if (message.filename != null && message.hasOwnProperty("filename")) + object.filename = message.filename; + return object; + }; + + /** + * Converts this LoadStmt to JSON. + * @function toJSON + * @memberof pg_query.LoadStmt + * @instance + * @returns {Object.} JSON object + */ + LoadStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoadStmt + * @function getTypeUrl + * @memberof pg_query.LoadStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoadStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.LoadStmt"; + }; + + return LoadStmt; + })(); + + pg_query.CreateDomainStmt = (function() { + + /** + * Properties of a CreateDomainStmt. + * @memberof pg_query + * @interface ICreateDomainStmt + * @property {Array.|null} [domainname] CreateDomainStmt domainname + * @property {pg_query.ITypeName|null} [typeName] CreateDomainStmt typeName + * @property {pg_query.ICollateClause|null} [collClause] CreateDomainStmt collClause + * @property {Array.|null} [constraints] CreateDomainStmt constraints + */ + + /** + * Constructs a new CreateDomainStmt. + * @memberof pg_query + * @classdesc Represents a CreateDomainStmt. + * @implements ICreateDomainStmt + * @constructor + * @param {pg_query.ICreateDomainStmt=} [properties] Properties to set + */ + function CreateDomainStmt(properties) { + this.domainname = []; + this.constraints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDomainStmt domainname. + * @member {Array.} domainname + * @memberof pg_query.CreateDomainStmt + * @instance + */ + CreateDomainStmt.prototype.domainname = $util.emptyArray; + + /** + * CreateDomainStmt typeName. + * @member {pg_query.ITypeName|null|undefined} typeName + * @memberof pg_query.CreateDomainStmt + * @instance + */ + CreateDomainStmt.prototype.typeName = null; + + /** + * CreateDomainStmt collClause. + * @member {pg_query.ICollateClause|null|undefined} collClause + * @memberof pg_query.CreateDomainStmt + * @instance + */ + CreateDomainStmt.prototype.collClause = null; + + /** + * CreateDomainStmt constraints. + * @member {Array.} constraints + * @memberof pg_query.CreateDomainStmt + * @instance + */ + CreateDomainStmt.prototype.constraints = $util.emptyArray; + + /** + * Creates a new CreateDomainStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateDomainStmt + * @static + * @param {pg_query.ICreateDomainStmt=} [properties] Properties to set + * @returns {pg_query.CreateDomainStmt} CreateDomainStmt instance + */ + CreateDomainStmt.create = function create(properties) { + return new CreateDomainStmt(properties); + }; + + /** + * Encodes the specified CreateDomainStmt message. Does not implicitly {@link pg_query.CreateDomainStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateDomainStmt + * @static + * @param {pg_query.ICreateDomainStmt} message CreateDomainStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDomainStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.domainname != null && message.domainname.length) + for (var i = 0; i < message.domainname.length; ++i) + $root.pg_query.Node.encode(message.domainname[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + $root.pg_query.TypeName.encode(message.typeName, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.collClause != null && Object.hasOwnProperty.call(message, "collClause")) + $root.pg_query.CollateClause.encode(message.collClause, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.constraints != null && message.constraints.length) + for (var i = 0; i < message.constraints.length; ++i) + $root.pg_query.Node.encode(message.constraints[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDomainStmt message, length delimited. Does not implicitly {@link pg_query.CreateDomainStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateDomainStmt + * @static + * @param {pg_query.ICreateDomainStmt} message CreateDomainStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDomainStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDomainStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateDomainStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateDomainStmt} CreateDomainStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDomainStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateDomainStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.domainname && message.domainname.length)) + message.domainname = []; + message.domainname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.typeName = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 3: { + message.collClause = $root.pg_query.CollateClause.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.constraints && message.constraints.length)) + message.constraints = []; + message.constraints.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDomainStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateDomainStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateDomainStmt} CreateDomainStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDomainStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDomainStmt message. + * @function verify + * @memberof pg_query.CreateDomainStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDomainStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.domainname != null && message.hasOwnProperty("domainname")) { + if (!Array.isArray(message.domainname)) + return "domainname: array expected"; + for (var i = 0; i < message.domainname.length; ++i) { + var error = $root.pg_query.Node.verify(message.domainname[i]); + if (error) + return "domainname." + error; + } + } + if (message.typeName != null && message.hasOwnProperty("typeName")) { + var error = $root.pg_query.TypeName.verify(message.typeName); + if (error) + return "typeName." + error; + } + if (message.collClause != null && message.hasOwnProperty("collClause")) { + var error = $root.pg_query.CollateClause.verify(message.collClause); + if (error) + return "collClause." + error; + } + if (message.constraints != null && message.hasOwnProperty("constraints")) { + if (!Array.isArray(message.constraints)) + return "constraints: array expected"; + for (var i = 0; i < message.constraints.length; ++i) { + var error = $root.pg_query.Node.verify(message.constraints[i]); + if (error) + return "constraints." + error; + } + } + return null; + }; + + /** + * Creates a CreateDomainStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateDomainStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateDomainStmt} CreateDomainStmt + */ + CreateDomainStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateDomainStmt) + return object; + var message = new $root.pg_query.CreateDomainStmt(); + if (object.domainname) { + if (!Array.isArray(object.domainname)) + throw TypeError(".pg_query.CreateDomainStmt.domainname: array expected"); + message.domainname = []; + for (var i = 0; i < object.domainname.length; ++i) { + if (typeof object.domainname[i] !== "object") + throw TypeError(".pg_query.CreateDomainStmt.domainname: object expected"); + message.domainname[i] = $root.pg_query.Node.fromObject(object.domainname[i]); + } + } + if (object.typeName != null) { + if (typeof object.typeName !== "object") + throw TypeError(".pg_query.CreateDomainStmt.typeName: object expected"); + message.typeName = $root.pg_query.TypeName.fromObject(object.typeName); + } + if (object.collClause != null) { + if (typeof object.collClause !== "object") + throw TypeError(".pg_query.CreateDomainStmt.collClause: object expected"); + message.collClause = $root.pg_query.CollateClause.fromObject(object.collClause); + } + if (object.constraints) { + if (!Array.isArray(object.constraints)) + throw TypeError(".pg_query.CreateDomainStmt.constraints: array expected"); + message.constraints = []; + for (var i = 0; i < object.constraints.length; ++i) { + if (typeof object.constraints[i] !== "object") + throw TypeError(".pg_query.CreateDomainStmt.constraints: object expected"); + message.constraints[i] = $root.pg_query.Node.fromObject(object.constraints[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateDomainStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateDomainStmt + * @static + * @param {pg_query.CreateDomainStmt} message CreateDomainStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDomainStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.domainname = []; + object.constraints = []; + } + if (options.defaults) { + object.typeName = null; + object.collClause = null; + } + if (message.domainname && message.domainname.length) { + object.domainname = []; + for (var j = 0; j < message.domainname.length; ++j) + object.domainname[j] = $root.pg_query.Node.toObject(message.domainname[j], options); + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = $root.pg_query.TypeName.toObject(message.typeName, options); + if (message.collClause != null && message.hasOwnProperty("collClause")) + object.collClause = $root.pg_query.CollateClause.toObject(message.collClause, options); + if (message.constraints && message.constraints.length) { + object.constraints = []; + for (var j = 0; j < message.constraints.length; ++j) + object.constraints[j] = $root.pg_query.Node.toObject(message.constraints[j], options); + } + return object; + }; + + /** + * Converts this CreateDomainStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateDomainStmt + * @instance + * @returns {Object.} JSON object + */ + CreateDomainStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDomainStmt + * @function getTypeUrl + * @memberof pg_query.CreateDomainStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDomainStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateDomainStmt"; + }; + + return CreateDomainStmt; + })(); + + pg_query.CreatedbStmt = (function() { + + /** + * Properties of a CreatedbStmt. + * @memberof pg_query + * @interface ICreatedbStmt + * @property {string|null} [dbname] CreatedbStmt dbname + * @property {Array.|null} [options] CreatedbStmt options + */ + + /** + * Constructs a new CreatedbStmt. + * @memberof pg_query + * @classdesc Represents a CreatedbStmt. + * @implements ICreatedbStmt + * @constructor + * @param {pg_query.ICreatedbStmt=} [properties] Properties to set + */ + function CreatedbStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatedbStmt dbname. + * @member {string} dbname + * @memberof pg_query.CreatedbStmt + * @instance + */ + CreatedbStmt.prototype.dbname = ""; + + /** + * CreatedbStmt options. + * @member {Array.} options + * @memberof pg_query.CreatedbStmt + * @instance + */ + CreatedbStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new CreatedbStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreatedbStmt + * @static + * @param {pg_query.ICreatedbStmt=} [properties] Properties to set + * @returns {pg_query.CreatedbStmt} CreatedbStmt instance + */ + CreatedbStmt.create = function create(properties) { + return new CreatedbStmt(properties); + }; + + /** + * Encodes the specified CreatedbStmt message. Does not implicitly {@link pg_query.CreatedbStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreatedbStmt + * @static + * @param {pg_query.ICreatedbStmt} message CreatedbStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatedbStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dbname != null && Object.hasOwnProperty.call(message, "dbname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dbname); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatedbStmt message, length delimited. Does not implicitly {@link pg_query.CreatedbStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreatedbStmt + * @static + * @param {pg_query.ICreatedbStmt} message CreatedbStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatedbStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatedbStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreatedbStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreatedbStmt} CreatedbStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatedbStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreatedbStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dbname = reader.string(); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatedbStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreatedbStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreatedbStmt} CreatedbStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatedbStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatedbStmt message. + * @function verify + * @memberof pg_query.CreatedbStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatedbStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dbname != null && message.hasOwnProperty("dbname")) + if (!$util.isString(message.dbname)) + return "dbname: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates a CreatedbStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreatedbStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreatedbStmt} CreatedbStmt + */ + CreatedbStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreatedbStmt) + return object; + var message = new $root.pg_query.CreatedbStmt(); + if (object.dbname != null) + message.dbname = String(object.dbname); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreatedbStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreatedbStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreatedbStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreatedbStmt + * @static + * @param {pg_query.CreatedbStmt} message CreatedbStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatedbStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) + object.dbname = ""; + if (message.dbname != null && message.hasOwnProperty("dbname")) + object.dbname = message.dbname; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this CreatedbStmt to JSON. + * @function toJSON + * @memberof pg_query.CreatedbStmt + * @instance + * @returns {Object.} JSON object + */ + CreatedbStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatedbStmt + * @function getTypeUrl + * @memberof pg_query.CreatedbStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatedbStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreatedbStmt"; + }; + + return CreatedbStmt; + })(); + + pg_query.DropdbStmt = (function() { + + /** + * Properties of a DropdbStmt. + * @memberof pg_query + * @interface IDropdbStmt + * @property {string|null} [dbname] DropdbStmt dbname + * @property {boolean|null} [missing_ok] DropdbStmt missing_ok + * @property {Array.|null} [options] DropdbStmt options + */ + + /** + * Constructs a new DropdbStmt. + * @memberof pg_query + * @classdesc Represents a DropdbStmt. + * @implements IDropdbStmt + * @constructor + * @param {pg_query.IDropdbStmt=} [properties] Properties to set + */ + function DropdbStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DropdbStmt dbname. + * @member {string} dbname + * @memberof pg_query.DropdbStmt + * @instance + */ + DropdbStmt.prototype.dbname = ""; + + /** + * DropdbStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.DropdbStmt + * @instance + */ + DropdbStmt.prototype.missing_ok = false; + + /** + * DropdbStmt options. + * @member {Array.} options + * @memberof pg_query.DropdbStmt + * @instance + */ + DropdbStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new DropdbStmt instance using the specified properties. + * @function create + * @memberof pg_query.DropdbStmt + * @static + * @param {pg_query.IDropdbStmt=} [properties] Properties to set + * @returns {pg_query.DropdbStmt} DropdbStmt instance + */ + DropdbStmt.create = function create(properties) { + return new DropdbStmt(properties); + }; + + /** + * Encodes the specified DropdbStmt message. Does not implicitly {@link pg_query.DropdbStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DropdbStmt + * @static + * @param {pg_query.IDropdbStmt} message DropdbStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropdbStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dbname != null && Object.hasOwnProperty.call(message, "dbname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dbname); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.missing_ok); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DropdbStmt message, length delimited. Does not implicitly {@link pg_query.DropdbStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DropdbStmt + * @static + * @param {pg_query.IDropdbStmt} message DropdbStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropdbStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DropdbStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DropdbStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DropdbStmt} DropdbStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropdbStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DropdbStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dbname = reader.string(); + break; + } + case 2: { + message.missing_ok = reader.bool(); + break; + } + case 3: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DropdbStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DropdbStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DropdbStmt} DropdbStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropdbStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DropdbStmt message. + * @function verify + * @memberof pg_query.DropdbStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DropdbStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dbname != null && message.hasOwnProperty("dbname")) + if (!$util.isString(message.dbname)) + return "dbname: string expected"; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates a DropdbStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DropdbStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DropdbStmt} DropdbStmt + */ + DropdbStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DropdbStmt) + return object; + var message = new $root.pg_query.DropdbStmt(); + if (object.dbname != null) + message.dbname = String(object.dbname); + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.DropdbStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.DropdbStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DropdbStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DropdbStmt + * @static + * @param {pg_query.DropdbStmt} message DropdbStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DropdbStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.dbname = ""; + object.missing_ok = false; + } + if (message.dbname != null && message.hasOwnProperty("dbname")) + object.dbname = message.dbname; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this DropdbStmt to JSON. + * @function toJSON + * @memberof pg_query.DropdbStmt + * @instance + * @returns {Object.} JSON object + */ + DropdbStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DropdbStmt + * @function getTypeUrl + * @memberof pg_query.DropdbStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DropdbStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DropdbStmt"; + }; + + return DropdbStmt; + })(); + + pg_query.VacuumStmt = (function() { + + /** + * Properties of a VacuumStmt. + * @memberof pg_query + * @interface IVacuumStmt + * @property {Array.|null} [options] VacuumStmt options + * @property {Array.|null} [rels] VacuumStmt rels + * @property {boolean|null} [is_vacuumcmd] VacuumStmt is_vacuumcmd + */ + + /** + * Constructs a new VacuumStmt. + * @memberof pg_query + * @classdesc Represents a VacuumStmt. + * @implements IVacuumStmt + * @constructor + * @param {pg_query.IVacuumStmt=} [properties] Properties to set + */ + function VacuumStmt(properties) { + this.options = []; + this.rels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VacuumStmt options. + * @member {Array.} options + * @memberof pg_query.VacuumStmt + * @instance + */ + VacuumStmt.prototype.options = $util.emptyArray; + + /** + * VacuumStmt rels. + * @member {Array.} rels + * @memberof pg_query.VacuumStmt + * @instance + */ + VacuumStmt.prototype.rels = $util.emptyArray; + + /** + * VacuumStmt is_vacuumcmd. + * @member {boolean} is_vacuumcmd + * @memberof pg_query.VacuumStmt + * @instance + */ + VacuumStmt.prototype.is_vacuumcmd = false; + + /** + * Creates a new VacuumStmt instance using the specified properties. + * @function create + * @memberof pg_query.VacuumStmt + * @static + * @param {pg_query.IVacuumStmt=} [properties] Properties to set + * @returns {pg_query.VacuumStmt} VacuumStmt instance + */ + VacuumStmt.create = function create(properties) { + return new VacuumStmt(properties); + }; + + /** + * Encodes the specified VacuumStmt message. Does not implicitly {@link pg_query.VacuumStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.VacuumStmt + * @static + * @param {pg_query.IVacuumStmt} message VacuumStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VacuumStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.rels != null && message.rels.length) + for (var i = 0; i < message.rels.length; ++i) + $root.pg_query.Node.encode(message.rels[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.is_vacuumcmd != null && Object.hasOwnProperty.call(message, "is_vacuumcmd")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.is_vacuumcmd); + return writer; + }; + + /** + * Encodes the specified VacuumStmt message, length delimited. Does not implicitly {@link pg_query.VacuumStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.VacuumStmt + * @static + * @param {pg_query.IVacuumStmt} message VacuumStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VacuumStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VacuumStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.VacuumStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.VacuumStmt} VacuumStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VacuumStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.VacuumStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.rels && message.rels.length)) + message.rels = []; + message.rels.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.is_vacuumcmd = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VacuumStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.VacuumStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.VacuumStmt} VacuumStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VacuumStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VacuumStmt message. + * @function verify + * @memberof pg_query.VacuumStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VacuumStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.rels != null && message.hasOwnProperty("rels")) { + if (!Array.isArray(message.rels)) + return "rels: array expected"; + for (var i = 0; i < message.rels.length; ++i) { + var error = $root.pg_query.Node.verify(message.rels[i]); + if (error) + return "rels." + error; + } + } + if (message.is_vacuumcmd != null && message.hasOwnProperty("is_vacuumcmd")) + if (typeof message.is_vacuumcmd !== "boolean") + return "is_vacuumcmd: boolean expected"; + return null; + }; + + /** + * Creates a VacuumStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.VacuumStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.VacuumStmt} VacuumStmt + */ + VacuumStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.VacuumStmt) + return object; + var message = new $root.pg_query.VacuumStmt(); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.VacuumStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.VacuumStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.rels) { + if (!Array.isArray(object.rels)) + throw TypeError(".pg_query.VacuumStmt.rels: array expected"); + message.rels = []; + for (var i = 0; i < object.rels.length; ++i) { + if (typeof object.rels[i] !== "object") + throw TypeError(".pg_query.VacuumStmt.rels: object expected"); + message.rels[i] = $root.pg_query.Node.fromObject(object.rels[i]); + } + } + if (object.is_vacuumcmd != null) + message.is_vacuumcmd = Boolean(object.is_vacuumcmd); + return message; + }; + + /** + * Creates a plain object from a VacuumStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.VacuumStmt + * @static + * @param {pg_query.VacuumStmt} message VacuumStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VacuumStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.options = []; + object.rels = []; + } + if (options.defaults) + object.is_vacuumcmd = false; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.rels && message.rels.length) { + object.rels = []; + for (var j = 0; j < message.rels.length; ++j) + object.rels[j] = $root.pg_query.Node.toObject(message.rels[j], options); + } + if (message.is_vacuumcmd != null && message.hasOwnProperty("is_vacuumcmd")) + object.is_vacuumcmd = message.is_vacuumcmd; + return object; + }; + + /** + * Converts this VacuumStmt to JSON. + * @function toJSON + * @memberof pg_query.VacuumStmt + * @instance + * @returns {Object.} JSON object + */ + VacuumStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VacuumStmt + * @function getTypeUrl + * @memberof pg_query.VacuumStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VacuumStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.VacuumStmt"; + }; + + return VacuumStmt; + })(); + + pg_query.ExplainStmt = (function() { + + /** + * Properties of an ExplainStmt. + * @memberof pg_query + * @interface IExplainStmt + * @property {pg_query.INode|null} [query] ExplainStmt query + * @property {Array.|null} [options] ExplainStmt options + */ + + /** + * Constructs a new ExplainStmt. + * @memberof pg_query + * @classdesc Represents an ExplainStmt. + * @implements IExplainStmt + * @constructor + * @param {pg_query.IExplainStmt=} [properties] Properties to set + */ + function ExplainStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExplainStmt query. + * @member {pg_query.INode|null|undefined} query + * @memberof pg_query.ExplainStmt + * @instance + */ + ExplainStmt.prototype.query = null; + + /** + * ExplainStmt options. + * @member {Array.} options + * @memberof pg_query.ExplainStmt + * @instance + */ + ExplainStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new ExplainStmt instance using the specified properties. + * @function create + * @memberof pg_query.ExplainStmt + * @static + * @param {pg_query.IExplainStmt=} [properties] Properties to set + * @returns {pg_query.ExplainStmt} ExplainStmt instance + */ + ExplainStmt.create = function create(properties) { + return new ExplainStmt(properties); + }; + + /** + * Encodes the specified ExplainStmt message. Does not implicitly {@link pg_query.ExplainStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.ExplainStmt + * @static + * @param {pg_query.IExplainStmt} message ExplainStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.pg_query.Node.encode(message.query, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExplainStmt message, length delimited. Does not implicitly {@link pg_query.ExplainStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ExplainStmt + * @static + * @param {pg_query.IExplainStmt} message ExplainStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExplainStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExplainStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ExplainStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ExplainStmt} ExplainStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ExplainStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.query = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExplainStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ExplainStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ExplainStmt} ExplainStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExplainStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExplainStmt message. + * @function verify + * @memberof pg_query.ExplainStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExplainStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.pg_query.Node.verify(message.query); + if (error) + return "query." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates an ExplainStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ExplainStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ExplainStmt} ExplainStmt + */ + ExplainStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ExplainStmt) + return object; + var message = new $root.pg_query.ExplainStmt(); + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".pg_query.ExplainStmt.query: object expected"); + message.query = $root.pg_query.Node.fromObject(object.query); + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.ExplainStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.ExplainStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExplainStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ExplainStmt + * @static + * @param {pg_query.ExplainStmt} message ExplainStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExplainStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) + object.query = null; + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.pg_query.Node.toObject(message.query, options); + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this ExplainStmt to JSON. + * @function toJSON + * @memberof pg_query.ExplainStmt + * @instance + * @returns {Object.} JSON object + */ + ExplainStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExplainStmt + * @function getTypeUrl + * @memberof pg_query.ExplainStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExplainStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ExplainStmt"; + }; + + return ExplainStmt; + })(); + + pg_query.CreateTableAsStmt = (function() { + + /** + * Properties of a CreateTableAsStmt. + * @memberof pg_query + * @interface ICreateTableAsStmt + * @property {pg_query.INode|null} [query] CreateTableAsStmt query + * @property {pg_query.IIntoClause|null} [into] CreateTableAsStmt into + * @property {pg_query.ObjectType|null} [relkind] CreateTableAsStmt relkind + * @property {boolean|null} [is_select_into] CreateTableAsStmt is_select_into + * @property {boolean|null} [if_not_exists] CreateTableAsStmt if_not_exists + */ + + /** + * Constructs a new CreateTableAsStmt. + * @memberof pg_query + * @classdesc Represents a CreateTableAsStmt. + * @implements ICreateTableAsStmt + * @constructor + * @param {pg_query.ICreateTableAsStmt=} [properties] Properties to set + */ + function CreateTableAsStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTableAsStmt query. + * @member {pg_query.INode|null|undefined} query + * @memberof pg_query.CreateTableAsStmt + * @instance + */ + CreateTableAsStmt.prototype.query = null; + + /** + * CreateTableAsStmt into. + * @member {pg_query.IIntoClause|null|undefined} into + * @memberof pg_query.CreateTableAsStmt + * @instance + */ + CreateTableAsStmt.prototype.into = null; + + /** + * CreateTableAsStmt relkind. + * @member {pg_query.ObjectType} relkind + * @memberof pg_query.CreateTableAsStmt + * @instance + */ + CreateTableAsStmt.prototype.relkind = 0; + + /** + * CreateTableAsStmt is_select_into. + * @member {boolean} is_select_into + * @memberof pg_query.CreateTableAsStmt + * @instance + */ + CreateTableAsStmt.prototype.is_select_into = false; + + /** + * CreateTableAsStmt if_not_exists. + * @member {boolean} if_not_exists + * @memberof pg_query.CreateTableAsStmt + * @instance + */ + CreateTableAsStmt.prototype.if_not_exists = false; + + /** + * Creates a new CreateTableAsStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateTableAsStmt + * @static + * @param {pg_query.ICreateTableAsStmt=} [properties] Properties to set + * @returns {pg_query.CreateTableAsStmt} CreateTableAsStmt instance + */ + CreateTableAsStmt.create = function create(properties) { + return new CreateTableAsStmt(properties); + }; + + /** + * Encodes the specified CreateTableAsStmt message. Does not implicitly {@link pg_query.CreateTableAsStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateTableAsStmt + * @static + * @param {pg_query.ICreateTableAsStmt} message CreateTableAsStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableAsStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.pg_query.Node.encode(message.query, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.into != null && Object.hasOwnProperty.call(message, "into")) + $root.pg_query.IntoClause.encode(message.into, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.relkind != null && Object.hasOwnProperty.call(message, "relkind")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.relkind); + if (message.is_select_into != null && Object.hasOwnProperty.call(message, "is_select_into")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.is_select_into); + if (message.if_not_exists != null && Object.hasOwnProperty.call(message, "if_not_exists")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.if_not_exists); + return writer; + }; + + /** + * Encodes the specified CreateTableAsStmt message, length delimited. Does not implicitly {@link pg_query.CreateTableAsStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateTableAsStmt + * @static + * @param {pg_query.ICreateTableAsStmt} message CreateTableAsStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableAsStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTableAsStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateTableAsStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateTableAsStmt} CreateTableAsStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableAsStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateTableAsStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.query = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.into = $root.pg_query.IntoClause.decode(reader, reader.uint32()); + break; + } + case 3: { + message.relkind = reader.int32(); + break; + } + case 4: { + message.is_select_into = reader.bool(); + break; + } + case 5: { + message.if_not_exists = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTableAsStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateTableAsStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateTableAsStmt} CreateTableAsStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableAsStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTableAsStmt message. + * @function verify + * @memberof pg_query.CreateTableAsStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTableAsStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.pg_query.Node.verify(message.query); + if (error) + return "query." + error; + } + if (message.into != null && message.hasOwnProperty("into")) { + var error = $root.pg_query.IntoClause.verify(message.into); + if (error) + return "into." + error; + } + if (message.relkind != null && message.hasOwnProperty("relkind")) + switch (message.relkind) { + default: + return "relkind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.is_select_into != null && message.hasOwnProperty("is_select_into")) + if (typeof message.is_select_into !== "boolean") + return "is_select_into: boolean expected"; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + if (typeof message.if_not_exists !== "boolean") + return "if_not_exists: boolean expected"; + return null; + }; + + /** + * Creates a CreateTableAsStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateTableAsStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateTableAsStmt} CreateTableAsStmt + */ + CreateTableAsStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateTableAsStmt) + return object; + var message = new $root.pg_query.CreateTableAsStmt(); + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".pg_query.CreateTableAsStmt.query: object expected"); + message.query = $root.pg_query.Node.fromObject(object.query); + } + if (object.into != null) { + if (typeof object.into !== "object") + throw TypeError(".pg_query.CreateTableAsStmt.into: object expected"); + message.into = $root.pg_query.IntoClause.fromObject(object.into); + } + switch (object.relkind) { + default: + if (typeof object.relkind === "number") { + message.relkind = object.relkind; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.relkind = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.relkind = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.relkind = 2; + break; + case "OBJECT_AMOP": + case 3: + message.relkind = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.relkind = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.relkind = 5; + break; + case "OBJECT_CAST": + case 6: + message.relkind = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.relkind = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.relkind = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.relkind = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.relkind = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.relkind = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.relkind = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.relkind = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.relkind = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.relkind = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.relkind = 16; + break; + case "OBJECT_FDW": + case 17: + message.relkind = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.relkind = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.relkind = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.relkind = 20; + break; + case "OBJECT_INDEX": + case 21: + message.relkind = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.relkind = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.relkind = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.relkind = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.relkind = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.relkind = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.relkind = 27; + break; + case "OBJECT_POLICY": + case 28: + message.relkind = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.relkind = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.relkind = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.relkind = 31; + break; + case "OBJECT_ROLE": + case 32: + message.relkind = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.relkind = 33; + break; + case "OBJECT_RULE": + case 34: + message.relkind = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.relkind = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.relkind = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.relkind = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.relkind = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.relkind = 39; + break; + case "OBJECT_TABLE": + case 40: + message.relkind = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.relkind = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.relkind = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.relkind = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.relkind = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.relkind = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.relkind = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.relkind = 47; + break; + case "OBJECT_TYPE": + case 48: + message.relkind = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.relkind = 49; + break; + case "OBJECT_VIEW": + case 50: + message.relkind = 50; + break; + } + if (object.is_select_into != null) + message.is_select_into = Boolean(object.is_select_into); + if (object.if_not_exists != null) + message.if_not_exists = Boolean(object.if_not_exists); + return message; + }; + + /** + * Creates a plain object from a CreateTableAsStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateTableAsStmt + * @static + * @param {pg_query.CreateTableAsStmt} message CreateTableAsStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTableAsStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.query = null; + object.into = null; + object.relkind = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.is_select_into = false; + object.if_not_exists = false; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.pg_query.Node.toObject(message.query, options); + if (message.into != null && message.hasOwnProperty("into")) + object.into = $root.pg_query.IntoClause.toObject(message.into, options); + if (message.relkind != null && message.hasOwnProperty("relkind")) + object.relkind = options.enums === String ? $root.pg_query.ObjectType[message.relkind] === undefined ? message.relkind : $root.pg_query.ObjectType[message.relkind] : message.relkind; + if (message.is_select_into != null && message.hasOwnProperty("is_select_into")) + object.is_select_into = message.is_select_into; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + object.if_not_exists = message.if_not_exists; + return object; + }; + + /** + * Converts this CreateTableAsStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateTableAsStmt + * @instance + * @returns {Object.} JSON object + */ + CreateTableAsStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTableAsStmt + * @function getTypeUrl + * @memberof pg_query.CreateTableAsStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTableAsStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateTableAsStmt"; + }; + + return CreateTableAsStmt; + })(); + + pg_query.CreateSeqStmt = (function() { + + /** + * Properties of a CreateSeqStmt. + * @memberof pg_query + * @interface ICreateSeqStmt + * @property {pg_query.IRangeVar|null} [sequence] CreateSeqStmt sequence + * @property {Array.|null} [options] CreateSeqStmt options + * @property {number|null} [ownerId] CreateSeqStmt ownerId + * @property {boolean|null} [for_identity] CreateSeqStmt for_identity + * @property {boolean|null} [if_not_exists] CreateSeqStmt if_not_exists + */ + + /** + * Constructs a new CreateSeqStmt. + * @memberof pg_query + * @classdesc Represents a CreateSeqStmt. + * @implements ICreateSeqStmt + * @constructor + * @param {pg_query.ICreateSeqStmt=} [properties] Properties to set + */ + function CreateSeqStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSeqStmt sequence. + * @member {pg_query.IRangeVar|null|undefined} sequence + * @memberof pg_query.CreateSeqStmt + * @instance + */ + CreateSeqStmt.prototype.sequence = null; + + /** + * CreateSeqStmt options. + * @member {Array.} options + * @memberof pg_query.CreateSeqStmt + * @instance + */ + CreateSeqStmt.prototype.options = $util.emptyArray; + + /** + * CreateSeqStmt ownerId. + * @member {number} ownerId + * @memberof pg_query.CreateSeqStmt + * @instance + */ + CreateSeqStmt.prototype.ownerId = 0; + + /** + * CreateSeqStmt for_identity. + * @member {boolean} for_identity + * @memberof pg_query.CreateSeqStmt + * @instance + */ + CreateSeqStmt.prototype.for_identity = false; + + /** + * CreateSeqStmt if_not_exists. + * @member {boolean} if_not_exists + * @memberof pg_query.CreateSeqStmt + * @instance + */ + CreateSeqStmt.prototype.if_not_exists = false; + + /** + * Creates a new CreateSeqStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateSeqStmt + * @static + * @param {pg_query.ICreateSeqStmt=} [properties] Properties to set + * @returns {pg_query.CreateSeqStmt} CreateSeqStmt instance + */ + CreateSeqStmt.create = function create(properties) { + return new CreateSeqStmt(properties); + }; + + /** + * Encodes the specified CreateSeqStmt message. Does not implicitly {@link pg_query.CreateSeqStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateSeqStmt + * @static + * @param {pg_query.ICreateSeqStmt} message CreateSeqStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSeqStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + $root.pg_query.RangeVar.encode(message.sequence, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ownerId != null && Object.hasOwnProperty.call(message, "ownerId")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.ownerId); + if (message.for_identity != null && Object.hasOwnProperty.call(message, "for_identity")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.for_identity); + if (message.if_not_exists != null && Object.hasOwnProperty.call(message, "if_not_exists")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.if_not_exists); + return writer; + }; + + /** + * Encodes the specified CreateSeqStmt message, length delimited. Does not implicitly {@link pg_query.CreateSeqStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateSeqStmt + * @static + * @param {pg_query.ICreateSeqStmt} message CreateSeqStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSeqStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSeqStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateSeqStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateSeqStmt} CreateSeqStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSeqStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateSeqStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sequence = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.ownerId = reader.uint32(); + break; + } + case 4: { + message.for_identity = reader.bool(); + break; + } + case 5: { + message.if_not_exists = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSeqStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateSeqStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateSeqStmt} CreateSeqStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSeqStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSeqStmt message. + * @function verify + * @memberof pg_query.CreateSeqStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSeqStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sequence != null && message.hasOwnProperty("sequence")) { + var error = $root.pg_query.RangeVar.verify(message.sequence); + if (error) + return "sequence." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.ownerId != null && message.hasOwnProperty("ownerId")) + if (!$util.isInteger(message.ownerId)) + return "ownerId: integer expected"; + if (message.for_identity != null && message.hasOwnProperty("for_identity")) + if (typeof message.for_identity !== "boolean") + return "for_identity: boolean expected"; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + if (typeof message.if_not_exists !== "boolean") + return "if_not_exists: boolean expected"; + return null; + }; + + /** + * Creates a CreateSeqStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateSeqStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateSeqStmt} CreateSeqStmt + */ + CreateSeqStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateSeqStmt) + return object; + var message = new $root.pg_query.CreateSeqStmt(); + if (object.sequence != null) { + if (typeof object.sequence !== "object") + throw TypeError(".pg_query.CreateSeqStmt.sequence: object expected"); + message.sequence = $root.pg_query.RangeVar.fromObject(object.sequence); + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreateSeqStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreateSeqStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.ownerId != null) + message.ownerId = object.ownerId >>> 0; + if (object.for_identity != null) + message.for_identity = Boolean(object.for_identity); + if (object.if_not_exists != null) + message.if_not_exists = Boolean(object.if_not_exists); + return message; + }; + + /** + * Creates a plain object from a CreateSeqStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateSeqStmt + * @static + * @param {pg_query.CreateSeqStmt} message CreateSeqStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSeqStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.sequence = null; + object.ownerId = 0; + object.for_identity = false; + object.if_not_exists = false; + } + if (message.sequence != null && message.hasOwnProperty("sequence")) + object.sequence = $root.pg_query.RangeVar.toObject(message.sequence, options); + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.ownerId != null && message.hasOwnProperty("ownerId")) + object.ownerId = message.ownerId; + if (message.for_identity != null && message.hasOwnProperty("for_identity")) + object.for_identity = message.for_identity; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + object.if_not_exists = message.if_not_exists; + return object; + }; + + /** + * Converts this CreateSeqStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateSeqStmt + * @instance + * @returns {Object.} JSON object + */ + CreateSeqStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSeqStmt + * @function getTypeUrl + * @memberof pg_query.CreateSeqStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSeqStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateSeqStmt"; + }; + + return CreateSeqStmt; + })(); + + pg_query.AlterSeqStmt = (function() { + + /** + * Properties of an AlterSeqStmt. + * @memberof pg_query + * @interface IAlterSeqStmt + * @property {pg_query.IRangeVar|null} [sequence] AlterSeqStmt sequence + * @property {Array.|null} [options] AlterSeqStmt options + * @property {boolean|null} [for_identity] AlterSeqStmt for_identity + * @property {boolean|null} [missing_ok] AlterSeqStmt missing_ok + */ + + /** + * Constructs a new AlterSeqStmt. + * @memberof pg_query + * @classdesc Represents an AlterSeqStmt. + * @implements IAlterSeqStmt + * @constructor + * @param {pg_query.IAlterSeqStmt=} [properties] Properties to set + */ + function AlterSeqStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterSeqStmt sequence. + * @member {pg_query.IRangeVar|null|undefined} sequence + * @memberof pg_query.AlterSeqStmt + * @instance + */ + AlterSeqStmt.prototype.sequence = null; + + /** + * AlterSeqStmt options. + * @member {Array.} options + * @memberof pg_query.AlterSeqStmt + * @instance + */ + AlterSeqStmt.prototype.options = $util.emptyArray; + + /** + * AlterSeqStmt for_identity. + * @member {boolean} for_identity + * @memberof pg_query.AlterSeqStmt + * @instance + */ + AlterSeqStmt.prototype.for_identity = false; + + /** + * AlterSeqStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.AlterSeqStmt + * @instance + */ + AlterSeqStmt.prototype.missing_ok = false; + + /** + * Creates a new AlterSeqStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterSeqStmt + * @static + * @param {pg_query.IAlterSeqStmt=} [properties] Properties to set + * @returns {pg_query.AlterSeqStmt} AlterSeqStmt instance + */ + AlterSeqStmt.create = function create(properties) { + return new AlterSeqStmt(properties); + }; + + /** + * Encodes the specified AlterSeqStmt message. Does not implicitly {@link pg_query.AlterSeqStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterSeqStmt + * @static + * @param {pg_query.IAlterSeqStmt} message AlterSeqStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterSeqStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sequence != null && Object.hasOwnProperty.call(message, "sequence")) + $root.pg_query.RangeVar.encode(message.sequence, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.for_identity != null && Object.hasOwnProperty.call(message, "for_identity")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.for_identity); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.missing_ok); + return writer; + }; + + /** + * Encodes the specified AlterSeqStmt message, length delimited. Does not implicitly {@link pg_query.AlterSeqStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterSeqStmt + * @static + * @param {pg_query.IAlterSeqStmt} message AlterSeqStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterSeqStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterSeqStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterSeqStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterSeqStmt} AlterSeqStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterSeqStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterSeqStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sequence = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.for_identity = reader.bool(); + break; + } + case 4: { + message.missing_ok = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterSeqStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterSeqStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterSeqStmt} AlterSeqStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterSeqStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterSeqStmt message. + * @function verify + * @memberof pg_query.AlterSeqStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterSeqStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sequence != null && message.hasOwnProperty("sequence")) { + var error = $root.pg_query.RangeVar.verify(message.sequence); + if (error) + return "sequence." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.for_identity != null && message.hasOwnProperty("for_identity")) + if (typeof message.for_identity !== "boolean") + return "for_identity: boolean expected"; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + return null; + }; + + /** + * Creates an AlterSeqStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterSeqStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterSeqStmt} AlterSeqStmt + */ + AlterSeqStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterSeqStmt) + return object; + var message = new $root.pg_query.AlterSeqStmt(); + if (object.sequence != null) { + if (typeof object.sequence !== "object") + throw TypeError(".pg_query.AlterSeqStmt.sequence: object expected"); + message.sequence = $root.pg_query.RangeVar.fromObject(object.sequence); + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterSeqStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterSeqStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.for_identity != null) + message.for_identity = Boolean(object.for_identity); + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + return message; + }; + + /** + * Creates a plain object from an AlterSeqStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterSeqStmt + * @static + * @param {pg_query.AlterSeqStmt} message AlterSeqStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterSeqStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.sequence = null; + object.for_identity = false; + object.missing_ok = false; + } + if (message.sequence != null && message.hasOwnProperty("sequence")) + object.sequence = $root.pg_query.RangeVar.toObject(message.sequence, options); + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.for_identity != null && message.hasOwnProperty("for_identity")) + object.for_identity = message.for_identity; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + return object; + }; + + /** + * Converts this AlterSeqStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterSeqStmt + * @instance + * @returns {Object.} JSON object + */ + AlterSeqStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterSeqStmt + * @function getTypeUrl + * @memberof pg_query.AlterSeqStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterSeqStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterSeqStmt"; + }; + + return AlterSeqStmt; + })(); + + pg_query.VariableSetStmt = (function() { + + /** + * Properties of a VariableSetStmt. + * @memberof pg_query + * @interface IVariableSetStmt + * @property {pg_query.VariableSetKind|null} [kind] VariableSetStmt kind + * @property {string|null} [name] VariableSetStmt name + * @property {Array.|null} [args] VariableSetStmt args + * @property {boolean|null} [is_local] VariableSetStmt is_local + */ + + /** + * Constructs a new VariableSetStmt. + * @memberof pg_query + * @classdesc Represents a VariableSetStmt. + * @implements IVariableSetStmt + * @constructor + * @param {pg_query.IVariableSetStmt=} [properties] Properties to set + */ + function VariableSetStmt(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VariableSetStmt kind. + * @member {pg_query.VariableSetKind} kind + * @memberof pg_query.VariableSetStmt + * @instance + */ + VariableSetStmt.prototype.kind = 0; + + /** + * VariableSetStmt name. + * @member {string} name + * @memberof pg_query.VariableSetStmt + * @instance + */ + VariableSetStmt.prototype.name = ""; + + /** + * VariableSetStmt args. + * @member {Array.} args + * @memberof pg_query.VariableSetStmt + * @instance + */ + VariableSetStmt.prototype.args = $util.emptyArray; + + /** + * VariableSetStmt is_local. + * @member {boolean} is_local + * @memberof pg_query.VariableSetStmt + * @instance + */ + VariableSetStmt.prototype.is_local = false; + + /** + * Creates a new VariableSetStmt instance using the specified properties. + * @function create + * @memberof pg_query.VariableSetStmt + * @static + * @param {pg_query.IVariableSetStmt=} [properties] Properties to set + * @returns {pg_query.VariableSetStmt} VariableSetStmt instance + */ + VariableSetStmt.create = function create(properties) { + return new VariableSetStmt(properties); + }; + + /** + * Encodes the specified VariableSetStmt message. Does not implicitly {@link pg_query.VariableSetStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.VariableSetStmt + * @static + * @param {pg_query.IVariableSetStmt} message VariableSetStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariableSetStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.is_local != null && Object.hasOwnProperty.call(message, "is_local")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.is_local); + return writer; + }; + + /** + * Encodes the specified VariableSetStmt message, length delimited. Does not implicitly {@link pg_query.VariableSetStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.VariableSetStmt + * @static + * @param {pg_query.IVariableSetStmt} message VariableSetStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariableSetStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VariableSetStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.VariableSetStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.VariableSetStmt} VariableSetStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariableSetStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.VariableSetStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.is_local = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VariableSetStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.VariableSetStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.VariableSetStmt} VariableSetStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariableSetStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VariableSetStmt message. + * @function verify + * @memberof pg_query.VariableSetStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VariableSetStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.is_local != null && message.hasOwnProperty("is_local")) + if (typeof message.is_local !== "boolean") + return "is_local: boolean expected"; + return null; + }; + + /** + * Creates a VariableSetStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.VariableSetStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.VariableSetStmt} VariableSetStmt + */ + VariableSetStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.VariableSetStmt) + return object; + var message = new $root.pg_query.VariableSetStmt(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "VARIABLE_SET_KIND_UNDEFINED": + case 0: + message.kind = 0; + break; + case "VAR_SET_VALUE": + case 1: + message.kind = 1; + break; + case "VAR_SET_DEFAULT": + case 2: + message.kind = 2; + break; + case "VAR_SET_CURRENT": + case 3: + message.kind = 3; + break; + case "VAR_SET_MULTI": + case 4: + message.kind = 4; + break; + case "VAR_RESET": + case 5: + message.kind = 5; + break; + case "VAR_RESET_ALL": + case 6: + message.kind = 6; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.VariableSetStmt.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.VariableSetStmt.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.is_local != null) + message.is_local = Boolean(object.is_local); + return message; + }; + + /** + * Creates a plain object from a VariableSetStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.VariableSetStmt + * @static + * @param {pg_query.VariableSetStmt} message VariableSetStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VariableSetStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.kind = options.enums === String ? "VARIABLE_SET_KIND_UNDEFINED" : 0; + object.name = ""; + object.is_local = false; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.pg_query.VariableSetKind[message.kind] === undefined ? message.kind : $root.pg_query.VariableSetKind[message.kind] : message.kind; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.is_local != null && message.hasOwnProperty("is_local")) + object.is_local = message.is_local; + return object; + }; + + /** + * Converts this VariableSetStmt to JSON. + * @function toJSON + * @memberof pg_query.VariableSetStmt + * @instance + * @returns {Object.} JSON object + */ + VariableSetStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VariableSetStmt + * @function getTypeUrl + * @memberof pg_query.VariableSetStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VariableSetStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.VariableSetStmt"; + }; + + return VariableSetStmt; + })(); + + pg_query.VariableShowStmt = (function() { + + /** + * Properties of a VariableShowStmt. + * @memberof pg_query + * @interface IVariableShowStmt + * @property {string|null} [name] VariableShowStmt name + */ + + /** + * Constructs a new VariableShowStmt. + * @memberof pg_query + * @classdesc Represents a VariableShowStmt. + * @implements IVariableShowStmt + * @constructor + * @param {pg_query.IVariableShowStmt=} [properties] Properties to set + */ + function VariableShowStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VariableShowStmt name. + * @member {string} name + * @memberof pg_query.VariableShowStmt + * @instance + */ + VariableShowStmt.prototype.name = ""; + + /** + * Creates a new VariableShowStmt instance using the specified properties. + * @function create + * @memberof pg_query.VariableShowStmt + * @static + * @param {pg_query.IVariableShowStmt=} [properties] Properties to set + * @returns {pg_query.VariableShowStmt} VariableShowStmt instance + */ + VariableShowStmt.create = function create(properties) { + return new VariableShowStmt(properties); + }; + + /** + * Encodes the specified VariableShowStmt message. Does not implicitly {@link pg_query.VariableShowStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.VariableShowStmt + * @static + * @param {pg_query.IVariableShowStmt} message VariableShowStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariableShowStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified VariableShowStmt message, length delimited. Does not implicitly {@link pg_query.VariableShowStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.VariableShowStmt + * @static + * @param {pg_query.IVariableShowStmt} message VariableShowStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VariableShowStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VariableShowStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.VariableShowStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.VariableShowStmt} VariableShowStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariableShowStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.VariableShowStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VariableShowStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.VariableShowStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.VariableShowStmt} VariableShowStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VariableShowStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VariableShowStmt message. + * @function verify + * @memberof pg_query.VariableShowStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VariableShowStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a VariableShowStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.VariableShowStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.VariableShowStmt} VariableShowStmt + */ + VariableShowStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.VariableShowStmt) + return object; + var message = new $root.pg_query.VariableShowStmt(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a VariableShowStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.VariableShowStmt + * @static + * @param {pg_query.VariableShowStmt} message VariableShowStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VariableShowStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this VariableShowStmt to JSON. + * @function toJSON + * @memberof pg_query.VariableShowStmt + * @instance + * @returns {Object.} JSON object + */ + VariableShowStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VariableShowStmt + * @function getTypeUrl + * @memberof pg_query.VariableShowStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VariableShowStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.VariableShowStmt"; + }; + + return VariableShowStmt; + })(); + + pg_query.DiscardStmt = (function() { + + /** + * Properties of a DiscardStmt. + * @memberof pg_query + * @interface IDiscardStmt + * @property {pg_query.DiscardMode|null} [target] DiscardStmt target + */ + + /** + * Constructs a new DiscardStmt. + * @memberof pg_query + * @classdesc Represents a DiscardStmt. + * @implements IDiscardStmt + * @constructor + * @param {pg_query.IDiscardStmt=} [properties] Properties to set + */ + function DiscardStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiscardStmt target. + * @member {pg_query.DiscardMode} target + * @memberof pg_query.DiscardStmt + * @instance + */ + DiscardStmt.prototype.target = 0; + + /** + * Creates a new DiscardStmt instance using the specified properties. + * @function create + * @memberof pg_query.DiscardStmt + * @static + * @param {pg_query.IDiscardStmt=} [properties] Properties to set + * @returns {pg_query.DiscardStmt} DiscardStmt instance + */ + DiscardStmt.create = function create(properties) { + return new DiscardStmt(properties); + }; + + /** + * Encodes the specified DiscardStmt message. Does not implicitly {@link pg_query.DiscardStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DiscardStmt + * @static + * @param {pg_query.IDiscardStmt} message DiscardStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiscardStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.target); + return writer; + }; + + /** + * Encodes the specified DiscardStmt message, length delimited. Does not implicitly {@link pg_query.DiscardStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DiscardStmt + * @static + * @param {pg_query.IDiscardStmt} message DiscardStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiscardStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiscardStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DiscardStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DiscardStmt} DiscardStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiscardStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DiscardStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.target = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiscardStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DiscardStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DiscardStmt} DiscardStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiscardStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiscardStmt message. + * @function verify + * @memberof pg_query.DiscardStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiscardStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.target != null && message.hasOwnProperty("target")) + switch (message.target) { + default: + return "target: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a DiscardStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DiscardStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DiscardStmt} DiscardStmt + */ + DiscardStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DiscardStmt) + return object; + var message = new $root.pg_query.DiscardStmt(); + switch (object.target) { + default: + if (typeof object.target === "number") { + message.target = object.target; + break; + } + break; + case "DISCARD_MODE_UNDEFINED": + case 0: + message.target = 0; + break; + case "DISCARD_ALL": + case 1: + message.target = 1; + break; + case "DISCARD_PLANS": + case 2: + message.target = 2; + break; + case "DISCARD_SEQUENCES": + case 3: + message.target = 3; + break; + case "DISCARD_TEMP": + case 4: + message.target = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a DiscardStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DiscardStmt + * @static + * @param {pg_query.DiscardStmt} message DiscardStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiscardStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.target = options.enums === String ? "DISCARD_MODE_UNDEFINED" : 0; + if (message.target != null && message.hasOwnProperty("target")) + object.target = options.enums === String ? $root.pg_query.DiscardMode[message.target] === undefined ? message.target : $root.pg_query.DiscardMode[message.target] : message.target; + return object; + }; + + /** + * Converts this DiscardStmt to JSON. + * @function toJSON + * @memberof pg_query.DiscardStmt + * @instance + * @returns {Object.} JSON object + */ + DiscardStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiscardStmt + * @function getTypeUrl + * @memberof pg_query.DiscardStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiscardStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DiscardStmt"; + }; + + return DiscardStmt; + })(); + + pg_query.CreateTrigStmt = (function() { + + /** + * Properties of a CreateTrigStmt. + * @memberof pg_query + * @interface ICreateTrigStmt + * @property {string|null} [trigname] CreateTrigStmt trigname + * @property {pg_query.IRangeVar|null} [relation] CreateTrigStmt relation + * @property {Array.|null} [funcname] CreateTrigStmt funcname + * @property {Array.|null} [args] CreateTrigStmt args + * @property {boolean|null} [row] CreateTrigStmt row + * @property {number|null} [timing] CreateTrigStmt timing + * @property {number|null} [events] CreateTrigStmt events + * @property {Array.|null} [columns] CreateTrigStmt columns + * @property {pg_query.INode|null} [whenClause] CreateTrigStmt whenClause + * @property {boolean|null} [isconstraint] CreateTrigStmt isconstraint + * @property {Array.|null} [transitionRels] CreateTrigStmt transitionRels + * @property {boolean|null} [deferrable] CreateTrigStmt deferrable + * @property {boolean|null} [initdeferred] CreateTrigStmt initdeferred + * @property {pg_query.IRangeVar|null} [constrrel] CreateTrigStmt constrrel + */ + + /** + * Constructs a new CreateTrigStmt. + * @memberof pg_query + * @classdesc Represents a CreateTrigStmt. + * @implements ICreateTrigStmt + * @constructor + * @param {pg_query.ICreateTrigStmt=} [properties] Properties to set + */ + function CreateTrigStmt(properties) { + this.funcname = []; + this.args = []; + this.columns = []; + this.transitionRels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTrigStmt trigname. + * @member {string} trigname + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.trigname = ""; + + /** + * CreateTrigStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.relation = null; + + /** + * CreateTrigStmt funcname. + * @member {Array.} funcname + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.funcname = $util.emptyArray; + + /** + * CreateTrigStmt args. + * @member {Array.} args + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.args = $util.emptyArray; + + /** + * CreateTrigStmt row. + * @member {boolean} row + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.row = false; + + /** + * CreateTrigStmt timing. + * @member {number} timing + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.timing = 0; + + /** + * CreateTrigStmt events. + * @member {number} events + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.events = 0; + + /** + * CreateTrigStmt columns. + * @member {Array.} columns + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.columns = $util.emptyArray; + + /** + * CreateTrigStmt whenClause. + * @member {pg_query.INode|null|undefined} whenClause + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.whenClause = null; + + /** + * CreateTrigStmt isconstraint. + * @member {boolean} isconstraint + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.isconstraint = false; + + /** + * CreateTrigStmt transitionRels. + * @member {Array.} transitionRels + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.transitionRels = $util.emptyArray; + + /** + * CreateTrigStmt deferrable. + * @member {boolean} deferrable + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.deferrable = false; + + /** + * CreateTrigStmt initdeferred. + * @member {boolean} initdeferred + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.initdeferred = false; + + /** + * CreateTrigStmt constrrel. + * @member {pg_query.IRangeVar|null|undefined} constrrel + * @memberof pg_query.CreateTrigStmt + * @instance + */ + CreateTrigStmt.prototype.constrrel = null; + + /** + * Creates a new CreateTrigStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateTrigStmt + * @static + * @param {pg_query.ICreateTrigStmt=} [properties] Properties to set + * @returns {pg_query.CreateTrigStmt} CreateTrigStmt instance + */ + CreateTrigStmt.create = function create(properties) { + return new CreateTrigStmt(properties); + }; + + /** + * Encodes the specified CreateTrigStmt message. Does not implicitly {@link pg_query.CreateTrigStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateTrigStmt + * @static + * @param {pg_query.ICreateTrigStmt} message CreateTrigStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTrigStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trigname != null && Object.hasOwnProperty.call(message, "trigname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.trigname); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.funcname != null && message.funcname.length) + for (var i = 0; i < message.funcname.length; ++i) + $root.pg_query.Node.encode(message.funcname[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.row != null && Object.hasOwnProperty.call(message, "row")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.row); + if (message.timing != null && Object.hasOwnProperty.call(message, "timing")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.timing); + if (message.events != null && Object.hasOwnProperty.call(message, "events")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.events); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.pg_query.Node.encode(message.columns[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.whenClause != null && Object.hasOwnProperty.call(message, "whenClause")) + $root.pg_query.Node.encode(message.whenClause, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.isconstraint != null && Object.hasOwnProperty.call(message, "isconstraint")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.isconstraint); + if (message.transitionRels != null && message.transitionRels.length) + for (var i = 0; i < message.transitionRels.length; ++i) + $root.pg_query.Node.encode(message.transitionRels[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.deferrable != null && Object.hasOwnProperty.call(message, "deferrable")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.deferrable); + if (message.initdeferred != null && Object.hasOwnProperty.call(message, "initdeferred")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.initdeferred); + if (message.constrrel != null && Object.hasOwnProperty.call(message, "constrrel")) + $root.pg_query.RangeVar.encode(message.constrrel, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTrigStmt message, length delimited. Does not implicitly {@link pg_query.CreateTrigStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateTrigStmt + * @static + * @param {pg_query.ICreateTrigStmt} message CreateTrigStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTrigStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTrigStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateTrigStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateTrigStmt} CreateTrigStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTrigStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateTrigStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.trigname = reader.string(); + break; + } + case 2: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.funcname && message.funcname.length)) + message.funcname = []; + message.funcname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.row = reader.bool(); + break; + } + case 6: { + message.timing = reader.int32(); + break; + } + case 7: { + message.events = reader.int32(); + break; + } + case 8: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 9: { + message.whenClause = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 10: { + message.isconstraint = reader.bool(); + break; + } + case 11: { + if (!(message.transitionRels && message.transitionRels.length)) + message.transitionRels = []; + message.transitionRels.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 12: { + message.deferrable = reader.bool(); + break; + } + case 13: { + message.initdeferred = reader.bool(); + break; + } + case 14: { + message.constrrel = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTrigStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateTrigStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateTrigStmt} CreateTrigStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTrigStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTrigStmt message. + * @function verify + * @memberof pg_query.CreateTrigStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTrigStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trigname != null && message.hasOwnProperty("trigname")) + if (!$util.isString(message.trigname)) + return "trigname: string expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.funcname != null && message.hasOwnProperty("funcname")) { + if (!Array.isArray(message.funcname)) + return "funcname: array expected"; + for (var i = 0; i < message.funcname.length; ++i) { + var error = $root.pg_query.Node.verify(message.funcname[i]); + if (error) + return "funcname." + error; + } + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.row != null && message.hasOwnProperty("row")) + if (typeof message.row !== "boolean") + return "row: boolean expected"; + if (message.timing != null && message.hasOwnProperty("timing")) + if (!$util.isInteger(message.timing)) + return "timing: integer expected"; + if (message.events != null && message.hasOwnProperty("events")) + if (!$util.isInteger(message.events)) + return "events: integer expected"; + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.pg_query.Node.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + if (message.whenClause != null && message.hasOwnProperty("whenClause")) { + var error = $root.pg_query.Node.verify(message.whenClause); + if (error) + return "whenClause." + error; + } + if (message.isconstraint != null && message.hasOwnProperty("isconstraint")) + if (typeof message.isconstraint !== "boolean") + return "isconstraint: boolean expected"; + if (message.transitionRels != null && message.hasOwnProperty("transitionRels")) { + if (!Array.isArray(message.transitionRels)) + return "transitionRels: array expected"; + for (var i = 0; i < message.transitionRels.length; ++i) { + var error = $root.pg_query.Node.verify(message.transitionRels[i]); + if (error) + return "transitionRels." + error; + } + } + if (message.deferrable != null && message.hasOwnProperty("deferrable")) + if (typeof message.deferrable !== "boolean") + return "deferrable: boolean expected"; + if (message.initdeferred != null && message.hasOwnProperty("initdeferred")) + if (typeof message.initdeferred !== "boolean") + return "initdeferred: boolean expected"; + if (message.constrrel != null && message.hasOwnProperty("constrrel")) { + var error = $root.pg_query.RangeVar.verify(message.constrrel); + if (error) + return "constrrel." + error; + } + return null; + }; + + /** + * Creates a CreateTrigStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateTrigStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateTrigStmt} CreateTrigStmt + */ + CreateTrigStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateTrigStmt) + return object; + var message = new $root.pg_query.CreateTrigStmt(); + if (object.trigname != null) + message.trigname = String(object.trigname); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.CreateTrigStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.funcname) { + if (!Array.isArray(object.funcname)) + throw TypeError(".pg_query.CreateTrigStmt.funcname: array expected"); + message.funcname = []; + for (var i = 0; i < object.funcname.length; ++i) { + if (typeof object.funcname[i] !== "object") + throw TypeError(".pg_query.CreateTrigStmt.funcname: object expected"); + message.funcname[i] = $root.pg_query.Node.fromObject(object.funcname[i]); + } + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.CreateTrigStmt.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.CreateTrigStmt.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.row != null) + message.row = Boolean(object.row); + if (object.timing != null) + message.timing = object.timing | 0; + if (object.events != null) + message.events = object.events | 0; + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".pg_query.CreateTrigStmt.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".pg_query.CreateTrigStmt.columns: object expected"); + message.columns[i] = $root.pg_query.Node.fromObject(object.columns[i]); + } + } + if (object.whenClause != null) { + if (typeof object.whenClause !== "object") + throw TypeError(".pg_query.CreateTrigStmt.whenClause: object expected"); + message.whenClause = $root.pg_query.Node.fromObject(object.whenClause); + } + if (object.isconstraint != null) + message.isconstraint = Boolean(object.isconstraint); + if (object.transitionRels) { + if (!Array.isArray(object.transitionRels)) + throw TypeError(".pg_query.CreateTrigStmt.transitionRels: array expected"); + message.transitionRels = []; + for (var i = 0; i < object.transitionRels.length; ++i) { + if (typeof object.transitionRels[i] !== "object") + throw TypeError(".pg_query.CreateTrigStmt.transitionRels: object expected"); + message.transitionRels[i] = $root.pg_query.Node.fromObject(object.transitionRels[i]); + } + } + if (object.deferrable != null) + message.deferrable = Boolean(object.deferrable); + if (object.initdeferred != null) + message.initdeferred = Boolean(object.initdeferred); + if (object.constrrel != null) { + if (typeof object.constrrel !== "object") + throw TypeError(".pg_query.CreateTrigStmt.constrrel: object expected"); + message.constrrel = $root.pg_query.RangeVar.fromObject(object.constrrel); + } + return message; + }; + + /** + * Creates a plain object from a CreateTrigStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateTrigStmt + * @static + * @param {pg_query.CreateTrigStmt} message CreateTrigStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTrigStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.funcname = []; + object.args = []; + object.columns = []; + object.transitionRels = []; + } + if (options.defaults) { + object.trigname = ""; + object.relation = null; + object.row = false; + object.timing = 0; + object.events = 0; + object.whenClause = null; + object.isconstraint = false; + object.deferrable = false; + object.initdeferred = false; + object.constrrel = null; + } + if (message.trigname != null && message.hasOwnProperty("trigname")) + object.trigname = message.trigname; + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.funcname && message.funcname.length) { + object.funcname = []; + for (var j = 0; j < message.funcname.length; ++j) + object.funcname[j] = $root.pg_query.Node.toObject(message.funcname[j], options); + } + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.row != null && message.hasOwnProperty("row")) + object.row = message.row; + if (message.timing != null && message.hasOwnProperty("timing")) + object.timing = message.timing; + if (message.events != null && message.hasOwnProperty("events")) + object.events = message.events; + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.pg_query.Node.toObject(message.columns[j], options); + } + if (message.whenClause != null && message.hasOwnProperty("whenClause")) + object.whenClause = $root.pg_query.Node.toObject(message.whenClause, options); + if (message.isconstraint != null && message.hasOwnProperty("isconstraint")) + object.isconstraint = message.isconstraint; + if (message.transitionRels && message.transitionRels.length) { + object.transitionRels = []; + for (var j = 0; j < message.transitionRels.length; ++j) + object.transitionRels[j] = $root.pg_query.Node.toObject(message.transitionRels[j], options); + } + if (message.deferrable != null && message.hasOwnProperty("deferrable")) + object.deferrable = message.deferrable; + if (message.initdeferred != null && message.hasOwnProperty("initdeferred")) + object.initdeferred = message.initdeferred; + if (message.constrrel != null && message.hasOwnProperty("constrrel")) + object.constrrel = $root.pg_query.RangeVar.toObject(message.constrrel, options); + return object; + }; + + /** + * Converts this CreateTrigStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateTrigStmt + * @instance + * @returns {Object.} JSON object + */ + CreateTrigStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTrigStmt + * @function getTypeUrl + * @memberof pg_query.CreateTrigStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTrigStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateTrigStmt"; + }; + + return CreateTrigStmt; + })(); + + pg_query.CreatePLangStmt = (function() { + + /** + * Properties of a CreatePLangStmt. + * @memberof pg_query + * @interface ICreatePLangStmt + * @property {boolean|null} [replace] CreatePLangStmt replace + * @property {string|null} [plname] CreatePLangStmt plname + * @property {Array.|null} [plhandler] CreatePLangStmt plhandler + * @property {Array.|null} [plinline] CreatePLangStmt plinline + * @property {Array.|null} [plvalidator] CreatePLangStmt plvalidator + * @property {boolean|null} [pltrusted] CreatePLangStmt pltrusted + */ + + /** + * Constructs a new CreatePLangStmt. + * @memberof pg_query + * @classdesc Represents a CreatePLangStmt. + * @implements ICreatePLangStmt + * @constructor + * @param {pg_query.ICreatePLangStmt=} [properties] Properties to set + */ + function CreatePLangStmt(properties) { + this.plhandler = []; + this.plinline = []; + this.plvalidator = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePLangStmt replace. + * @member {boolean} replace + * @memberof pg_query.CreatePLangStmt + * @instance + */ + CreatePLangStmt.prototype.replace = false; + + /** + * CreatePLangStmt plname. + * @member {string} plname + * @memberof pg_query.CreatePLangStmt + * @instance + */ + CreatePLangStmt.prototype.plname = ""; + + /** + * CreatePLangStmt plhandler. + * @member {Array.} plhandler + * @memberof pg_query.CreatePLangStmt + * @instance + */ + CreatePLangStmt.prototype.plhandler = $util.emptyArray; + + /** + * CreatePLangStmt plinline. + * @member {Array.} plinline + * @memberof pg_query.CreatePLangStmt + * @instance + */ + CreatePLangStmt.prototype.plinline = $util.emptyArray; + + /** + * CreatePLangStmt plvalidator. + * @member {Array.} plvalidator + * @memberof pg_query.CreatePLangStmt + * @instance + */ + CreatePLangStmt.prototype.plvalidator = $util.emptyArray; + + /** + * CreatePLangStmt pltrusted. + * @member {boolean} pltrusted + * @memberof pg_query.CreatePLangStmt + * @instance + */ + CreatePLangStmt.prototype.pltrusted = false; + + /** + * Creates a new CreatePLangStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreatePLangStmt + * @static + * @param {pg_query.ICreatePLangStmt=} [properties] Properties to set + * @returns {pg_query.CreatePLangStmt} CreatePLangStmt instance + */ + CreatePLangStmt.create = function create(properties) { + return new CreatePLangStmt(properties); + }; + + /** + * Encodes the specified CreatePLangStmt message. Does not implicitly {@link pg_query.CreatePLangStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreatePLangStmt + * @static + * @param {pg_query.ICreatePLangStmt} message CreatePLangStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePLangStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.replace); + if (message.plname != null && Object.hasOwnProperty.call(message, "plname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.plname); + if (message.plhandler != null && message.plhandler.length) + for (var i = 0; i < message.plhandler.length; ++i) + $root.pg_query.Node.encode(message.plhandler[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.plinline != null && message.plinline.length) + for (var i = 0; i < message.plinline.length; ++i) + $root.pg_query.Node.encode(message.plinline[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.plvalidator != null && message.plvalidator.length) + for (var i = 0; i < message.plvalidator.length; ++i) + $root.pg_query.Node.encode(message.plvalidator[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pltrusted != null && Object.hasOwnProperty.call(message, "pltrusted")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.pltrusted); + return writer; + }; + + /** + * Encodes the specified CreatePLangStmt message, length delimited. Does not implicitly {@link pg_query.CreatePLangStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreatePLangStmt + * @static + * @param {pg_query.ICreatePLangStmt} message CreatePLangStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePLangStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePLangStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreatePLangStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreatePLangStmt} CreatePLangStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePLangStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreatePLangStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.replace = reader.bool(); + break; + } + case 2: { + message.plname = reader.string(); + break; + } + case 3: { + if (!(message.plhandler && message.plhandler.length)) + message.plhandler = []; + message.plhandler.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.plinline && message.plinline.length)) + message.plinline = []; + message.plinline.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.plvalidator && message.plvalidator.length)) + message.plvalidator = []; + message.plvalidator.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.pltrusted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePLangStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreatePLangStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreatePLangStmt} CreatePLangStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePLangStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePLangStmt message. + * @function verify + * @memberof pg_query.CreatePLangStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePLangStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replace != null && message.hasOwnProperty("replace")) + if (typeof message.replace !== "boolean") + return "replace: boolean expected"; + if (message.plname != null && message.hasOwnProperty("plname")) + if (!$util.isString(message.plname)) + return "plname: string expected"; + if (message.plhandler != null && message.hasOwnProperty("plhandler")) { + if (!Array.isArray(message.plhandler)) + return "plhandler: array expected"; + for (var i = 0; i < message.plhandler.length; ++i) { + var error = $root.pg_query.Node.verify(message.plhandler[i]); + if (error) + return "plhandler." + error; + } + } + if (message.plinline != null && message.hasOwnProperty("plinline")) { + if (!Array.isArray(message.plinline)) + return "plinline: array expected"; + for (var i = 0; i < message.plinline.length; ++i) { + var error = $root.pg_query.Node.verify(message.plinline[i]); + if (error) + return "plinline." + error; + } + } + if (message.plvalidator != null && message.hasOwnProperty("plvalidator")) { + if (!Array.isArray(message.plvalidator)) + return "plvalidator: array expected"; + for (var i = 0; i < message.plvalidator.length; ++i) { + var error = $root.pg_query.Node.verify(message.plvalidator[i]); + if (error) + return "plvalidator." + error; + } + } + if (message.pltrusted != null && message.hasOwnProperty("pltrusted")) + if (typeof message.pltrusted !== "boolean") + return "pltrusted: boolean expected"; + return null; + }; + + /** + * Creates a CreatePLangStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreatePLangStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreatePLangStmt} CreatePLangStmt + */ + CreatePLangStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreatePLangStmt) + return object; + var message = new $root.pg_query.CreatePLangStmt(); + if (object.replace != null) + message.replace = Boolean(object.replace); + if (object.plname != null) + message.plname = String(object.plname); + if (object.plhandler) { + if (!Array.isArray(object.plhandler)) + throw TypeError(".pg_query.CreatePLangStmt.plhandler: array expected"); + message.plhandler = []; + for (var i = 0; i < object.plhandler.length; ++i) { + if (typeof object.plhandler[i] !== "object") + throw TypeError(".pg_query.CreatePLangStmt.plhandler: object expected"); + message.plhandler[i] = $root.pg_query.Node.fromObject(object.plhandler[i]); + } + } + if (object.plinline) { + if (!Array.isArray(object.plinline)) + throw TypeError(".pg_query.CreatePLangStmt.plinline: array expected"); + message.plinline = []; + for (var i = 0; i < object.plinline.length; ++i) { + if (typeof object.plinline[i] !== "object") + throw TypeError(".pg_query.CreatePLangStmt.plinline: object expected"); + message.plinline[i] = $root.pg_query.Node.fromObject(object.plinline[i]); + } + } + if (object.plvalidator) { + if (!Array.isArray(object.plvalidator)) + throw TypeError(".pg_query.CreatePLangStmt.plvalidator: array expected"); + message.plvalidator = []; + for (var i = 0; i < object.plvalidator.length; ++i) { + if (typeof object.plvalidator[i] !== "object") + throw TypeError(".pg_query.CreatePLangStmt.plvalidator: object expected"); + message.plvalidator[i] = $root.pg_query.Node.fromObject(object.plvalidator[i]); + } + } + if (object.pltrusted != null) + message.pltrusted = Boolean(object.pltrusted); + return message; + }; + + /** + * Creates a plain object from a CreatePLangStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreatePLangStmt + * @static + * @param {pg_query.CreatePLangStmt} message CreatePLangStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePLangStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.plhandler = []; + object.plinline = []; + object.plvalidator = []; + } + if (options.defaults) { + object.replace = false; + object.plname = ""; + object.pltrusted = false; + } + if (message.replace != null && message.hasOwnProperty("replace")) + object.replace = message.replace; + if (message.plname != null && message.hasOwnProperty("plname")) + object.plname = message.plname; + if (message.plhandler && message.plhandler.length) { + object.plhandler = []; + for (var j = 0; j < message.plhandler.length; ++j) + object.plhandler[j] = $root.pg_query.Node.toObject(message.plhandler[j], options); + } + if (message.plinline && message.plinline.length) { + object.plinline = []; + for (var j = 0; j < message.plinline.length; ++j) + object.plinline[j] = $root.pg_query.Node.toObject(message.plinline[j], options); + } + if (message.plvalidator && message.plvalidator.length) { + object.plvalidator = []; + for (var j = 0; j < message.plvalidator.length; ++j) + object.plvalidator[j] = $root.pg_query.Node.toObject(message.plvalidator[j], options); + } + if (message.pltrusted != null && message.hasOwnProperty("pltrusted")) + object.pltrusted = message.pltrusted; + return object; + }; + + /** + * Converts this CreatePLangStmt to JSON. + * @function toJSON + * @memberof pg_query.CreatePLangStmt + * @instance + * @returns {Object.} JSON object + */ + CreatePLangStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePLangStmt + * @function getTypeUrl + * @memberof pg_query.CreatePLangStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePLangStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreatePLangStmt"; + }; + + return CreatePLangStmt; + })(); + + pg_query.CreateRoleStmt = (function() { + + /** + * Properties of a CreateRoleStmt. + * @memberof pg_query + * @interface ICreateRoleStmt + * @property {pg_query.RoleStmtType|null} [stmt_type] CreateRoleStmt stmt_type + * @property {string|null} [role] CreateRoleStmt role + * @property {Array.|null} [options] CreateRoleStmt options + */ + + /** + * Constructs a new CreateRoleStmt. + * @memberof pg_query + * @classdesc Represents a CreateRoleStmt. + * @implements ICreateRoleStmt + * @constructor + * @param {pg_query.ICreateRoleStmt=} [properties] Properties to set + */ + function CreateRoleStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateRoleStmt stmt_type. + * @member {pg_query.RoleStmtType} stmt_type + * @memberof pg_query.CreateRoleStmt + * @instance + */ + CreateRoleStmt.prototype.stmt_type = 0; + + /** + * CreateRoleStmt role. + * @member {string} role + * @memberof pg_query.CreateRoleStmt + * @instance + */ + CreateRoleStmt.prototype.role = ""; + + /** + * CreateRoleStmt options. + * @member {Array.} options + * @memberof pg_query.CreateRoleStmt + * @instance + */ + CreateRoleStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new CreateRoleStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateRoleStmt + * @static + * @param {pg_query.ICreateRoleStmt=} [properties] Properties to set + * @returns {pg_query.CreateRoleStmt} CreateRoleStmt instance + */ + CreateRoleStmt.create = function create(properties) { + return new CreateRoleStmt(properties); + }; + + /** + * Encodes the specified CreateRoleStmt message. Does not implicitly {@link pg_query.CreateRoleStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateRoleStmt + * @static + * @param {pg_query.ICreateRoleStmt} message CreateRoleStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRoleStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stmt_type != null && Object.hasOwnProperty.call(message, "stmt_type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stmt_type); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateRoleStmt message, length delimited. Does not implicitly {@link pg_query.CreateRoleStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateRoleStmt + * @static + * @param {pg_query.ICreateRoleStmt} message CreateRoleStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRoleStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRoleStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateRoleStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateRoleStmt} CreateRoleStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRoleStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateRoleStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.stmt_type = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRoleStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateRoleStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateRoleStmt} CreateRoleStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRoleStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRoleStmt message. + * @function verify + * @memberof pg_query.CreateRoleStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRoleStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stmt_type != null && message.hasOwnProperty("stmt_type")) + switch (message.stmt_type) { + default: + return "stmt_type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates a CreateRoleStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateRoleStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateRoleStmt} CreateRoleStmt + */ + CreateRoleStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateRoleStmt) + return object; + var message = new $root.pg_query.CreateRoleStmt(); + switch (object.stmt_type) { + default: + if (typeof object.stmt_type === "number") { + message.stmt_type = object.stmt_type; + break; + } + break; + case "ROLE_STMT_TYPE_UNDEFINED": + case 0: + message.stmt_type = 0; + break; + case "ROLESTMT_ROLE": + case 1: + message.stmt_type = 1; + break; + case "ROLESTMT_USER": + case 2: + message.stmt_type = 2; + break; + case "ROLESTMT_GROUP": + case 3: + message.stmt_type = 3; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreateRoleStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreateRoleStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateRoleStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateRoleStmt + * @static + * @param {pg_query.CreateRoleStmt} message CreateRoleStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRoleStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.stmt_type = options.enums === String ? "ROLE_STMT_TYPE_UNDEFINED" : 0; + object.role = ""; + } + if (message.stmt_type != null && message.hasOwnProperty("stmt_type")) + object.stmt_type = options.enums === String ? $root.pg_query.RoleStmtType[message.stmt_type] === undefined ? message.stmt_type : $root.pg_query.RoleStmtType[message.stmt_type] : message.stmt_type; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this CreateRoleStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateRoleStmt + * @instance + * @returns {Object.} JSON object + */ + CreateRoleStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRoleStmt + * @function getTypeUrl + * @memberof pg_query.CreateRoleStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRoleStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateRoleStmt"; + }; + + return CreateRoleStmt; + })(); + + pg_query.AlterRoleStmt = (function() { + + /** + * Properties of an AlterRoleStmt. + * @memberof pg_query + * @interface IAlterRoleStmt + * @property {pg_query.IRoleSpec|null} [role] AlterRoleStmt role + * @property {Array.|null} [options] AlterRoleStmt options + * @property {number|null} [action] AlterRoleStmt action + */ + + /** + * Constructs a new AlterRoleStmt. + * @memberof pg_query + * @classdesc Represents an AlterRoleStmt. + * @implements IAlterRoleStmt + * @constructor + * @param {pg_query.IAlterRoleStmt=} [properties] Properties to set + */ + function AlterRoleStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterRoleStmt role. + * @member {pg_query.IRoleSpec|null|undefined} role + * @memberof pg_query.AlterRoleStmt + * @instance + */ + AlterRoleStmt.prototype.role = null; + + /** + * AlterRoleStmt options. + * @member {Array.} options + * @memberof pg_query.AlterRoleStmt + * @instance + */ + AlterRoleStmt.prototype.options = $util.emptyArray; + + /** + * AlterRoleStmt action. + * @member {number} action + * @memberof pg_query.AlterRoleStmt + * @instance + */ + AlterRoleStmt.prototype.action = 0; + + /** + * Creates a new AlterRoleStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterRoleStmt + * @static + * @param {pg_query.IAlterRoleStmt=} [properties] Properties to set + * @returns {pg_query.AlterRoleStmt} AlterRoleStmt instance + */ + AlterRoleStmt.create = function create(properties) { + return new AlterRoleStmt(properties); + }; + + /** + * Encodes the specified AlterRoleStmt message. Does not implicitly {@link pg_query.AlterRoleStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterRoleStmt + * @static + * @param {pg_query.IAlterRoleStmt} message AlterRoleStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterRoleStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + $root.pg_query.RoleSpec.encode(message.role, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.action); + return writer; + }; + + /** + * Encodes the specified AlterRoleStmt message, length delimited. Does not implicitly {@link pg_query.AlterRoleStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterRoleStmt + * @static + * @param {pg_query.IAlterRoleStmt} message AlterRoleStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterRoleStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterRoleStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterRoleStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterRoleStmt} AlterRoleStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterRoleStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterRoleStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = $root.pg_query.RoleSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.action = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterRoleStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterRoleStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterRoleStmt} AlterRoleStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterRoleStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterRoleStmt message. + * @function verify + * @memberof pg_query.AlterRoleStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterRoleStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) { + var error = $root.pg_query.RoleSpec.verify(message.role); + if (error) + return "role." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isInteger(message.action)) + return "action: integer expected"; + return null; + }; + + /** + * Creates an AlterRoleStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterRoleStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterRoleStmt} AlterRoleStmt + */ + AlterRoleStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterRoleStmt) + return object; + var message = new $root.pg_query.AlterRoleStmt(); + if (object.role != null) { + if (typeof object.role !== "object") + throw TypeError(".pg_query.AlterRoleStmt.role: object expected"); + message.role = $root.pg_query.RoleSpec.fromObject(object.role); + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterRoleStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterRoleStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.action != null) + message.action = object.action | 0; + return message; + }; + + /** + * Creates a plain object from an AlterRoleStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterRoleStmt + * @static + * @param {pg_query.AlterRoleStmt} message AlterRoleStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterRoleStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.role = null; + object.action = 0; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = $root.pg_query.RoleSpec.toObject(message.role, options); + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + return object; + }; + + /** + * Converts this AlterRoleStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterRoleStmt + * @instance + * @returns {Object.} JSON object + */ + AlterRoleStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterRoleStmt + * @function getTypeUrl + * @memberof pg_query.AlterRoleStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterRoleStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterRoleStmt"; + }; + + return AlterRoleStmt; + })(); + + pg_query.DropRoleStmt = (function() { + + /** + * Properties of a DropRoleStmt. + * @memberof pg_query + * @interface IDropRoleStmt + * @property {Array.|null} [roles] DropRoleStmt roles + * @property {boolean|null} [missing_ok] DropRoleStmt missing_ok + */ + + /** + * Constructs a new DropRoleStmt. + * @memberof pg_query + * @classdesc Represents a DropRoleStmt. + * @implements IDropRoleStmt + * @constructor + * @param {pg_query.IDropRoleStmt=} [properties] Properties to set + */ + function DropRoleStmt(properties) { + this.roles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DropRoleStmt roles. + * @member {Array.} roles + * @memberof pg_query.DropRoleStmt + * @instance + */ + DropRoleStmt.prototype.roles = $util.emptyArray; + + /** + * DropRoleStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.DropRoleStmt + * @instance + */ + DropRoleStmt.prototype.missing_ok = false; + + /** + * Creates a new DropRoleStmt instance using the specified properties. + * @function create + * @memberof pg_query.DropRoleStmt + * @static + * @param {pg_query.IDropRoleStmt=} [properties] Properties to set + * @returns {pg_query.DropRoleStmt} DropRoleStmt instance + */ + DropRoleStmt.create = function create(properties) { + return new DropRoleStmt(properties); + }; + + /** + * Encodes the specified DropRoleStmt message. Does not implicitly {@link pg_query.DropRoleStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DropRoleStmt + * @static + * @param {pg_query.IDropRoleStmt} message DropRoleStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropRoleStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + $root.pg_query.Node.encode(message.roles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.missing_ok); + return writer; + }; + + /** + * Encodes the specified DropRoleStmt message, length delimited. Does not implicitly {@link pg_query.DropRoleStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DropRoleStmt + * @static + * @param {pg_query.IDropRoleStmt} message DropRoleStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropRoleStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DropRoleStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DropRoleStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DropRoleStmt} DropRoleStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropRoleStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DropRoleStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.missing_ok = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DropRoleStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DropRoleStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DropRoleStmt} DropRoleStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropRoleStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DropRoleStmt message. + * @function verify + * @memberof pg_query.DropRoleStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DropRoleStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) { + var error = $root.pg_query.Node.verify(message.roles[i]); + if (error) + return "roles." + error; + } + } + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + return null; + }; + + /** + * Creates a DropRoleStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DropRoleStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DropRoleStmt} DropRoleStmt + */ + DropRoleStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DropRoleStmt) + return object; + var message = new $root.pg_query.DropRoleStmt(); + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".pg_query.DropRoleStmt.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) { + if (typeof object.roles[i] !== "object") + throw TypeError(".pg_query.DropRoleStmt.roles: object expected"); + message.roles[i] = $root.pg_query.Node.fromObject(object.roles[i]); + } + } + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + return message; + }; + + /** + * Creates a plain object from a DropRoleStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DropRoleStmt + * @static + * @param {pg_query.DropRoleStmt} message DropRoleStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DropRoleStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.roles = []; + if (options.defaults) + object.missing_ok = false; + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = $root.pg_query.Node.toObject(message.roles[j], options); + } + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + return object; + }; + + /** + * Converts this DropRoleStmt to JSON. + * @function toJSON + * @memberof pg_query.DropRoleStmt + * @instance + * @returns {Object.} JSON object + */ + DropRoleStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DropRoleStmt + * @function getTypeUrl + * @memberof pg_query.DropRoleStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DropRoleStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DropRoleStmt"; + }; + + return DropRoleStmt; + })(); + + pg_query.LockStmt = (function() { + + /** + * Properties of a LockStmt. + * @memberof pg_query + * @interface ILockStmt + * @property {Array.|null} [relations] LockStmt relations + * @property {number|null} [mode] LockStmt mode + * @property {boolean|null} [nowait] LockStmt nowait + */ + + /** + * Constructs a new LockStmt. + * @memberof pg_query + * @classdesc Represents a LockStmt. + * @implements ILockStmt + * @constructor + * @param {pg_query.ILockStmt=} [properties] Properties to set + */ + function LockStmt(properties) { + this.relations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LockStmt relations. + * @member {Array.} relations + * @memberof pg_query.LockStmt + * @instance + */ + LockStmt.prototype.relations = $util.emptyArray; + + /** + * LockStmt mode. + * @member {number} mode + * @memberof pg_query.LockStmt + * @instance + */ + LockStmt.prototype.mode = 0; + + /** + * LockStmt nowait. + * @member {boolean} nowait + * @memberof pg_query.LockStmt + * @instance + */ + LockStmt.prototype.nowait = false; + + /** + * Creates a new LockStmt instance using the specified properties. + * @function create + * @memberof pg_query.LockStmt + * @static + * @param {pg_query.ILockStmt=} [properties] Properties to set + * @returns {pg_query.LockStmt} LockStmt instance + */ + LockStmt.create = function create(properties) { + return new LockStmt(properties); + }; + + /** + * Encodes the specified LockStmt message. Does not implicitly {@link pg_query.LockStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.LockStmt + * @static + * @param {pg_query.ILockStmt} message LockStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LockStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relations != null && message.relations.length) + for (var i = 0; i < message.relations.length; ++i) + $root.pg_query.Node.encode(message.relations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mode); + if (message.nowait != null && Object.hasOwnProperty.call(message, "nowait")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.nowait); + return writer; + }; + + /** + * Encodes the specified LockStmt message, length delimited. Does not implicitly {@link pg_query.LockStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.LockStmt + * @static + * @param {pg_query.ILockStmt} message LockStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LockStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LockStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.LockStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.LockStmt} LockStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LockStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.LockStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.relations && message.relations.length)) + message.relations = []; + message.relations.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.mode = reader.int32(); + break; + } + case 3: { + message.nowait = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LockStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.LockStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.LockStmt} LockStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LockStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LockStmt message. + * @function verify + * @memberof pg_query.LockStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LockStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relations != null && message.hasOwnProperty("relations")) { + if (!Array.isArray(message.relations)) + return "relations: array expected"; + for (var i = 0; i < message.relations.length; ++i) { + var error = $root.pg_query.Node.verify(message.relations[i]); + if (error) + return "relations." + error; + } + } + if (message.mode != null && message.hasOwnProperty("mode")) + if (!$util.isInteger(message.mode)) + return "mode: integer expected"; + if (message.nowait != null && message.hasOwnProperty("nowait")) + if (typeof message.nowait !== "boolean") + return "nowait: boolean expected"; + return null; + }; + + /** + * Creates a LockStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.LockStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.LockStmt} LockStmt + */ + LockStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.LockStmt) + return object; + var message = new $root.pg_query.LockStmt(); + if (object.relations) { + if (!Array.isArray(object.relations)) + throw TypeError(".pg_query.LockStmt.relations: array expected"); + message.relations = []; + for (var i = 0; i < object.relations.length; ++i) { + if (typeof object.relations[i] !== "object") + throw TypeError(".pg_query.LockStmt.relations: object expected"); + message.relations[i] = $root.pg_query.Node.fromObject(object.relations[i]); + } + } + if (object.mode != null) + message.mode = object.mode | 0; + if (object.nowait != null) + message.nowait = Boolean(object.nowait); + return message; + }; + + /** + * Creates a plain object from a LockStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.LockStmt + * @static + * @param {pg_query.LockStmt} message LockStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LockStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relations = []; + if (options.defaults) { + object.mode = 0; + object.nowait = false; + } + if (message.relations && message.relations.length) { + object.relations = []; + for (var j = 0; j < message.relations.length; ++j) + object.relations[j] = $root.pg_query.Node.toObject(message.relations[j], options); + } + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = message.mode; + if (message.nowait != null && message.hasOwnProperty("nowait")) + object.nowait = message.nowait; + return object; + }; + + /** + * Converts this LockStmt to JSON. + * @function toJSON + * @memberof pg_query.LockStmt + * @instance + * @returns {Object.} JSON object + */ + LockStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LockStmt + * @function getTypeUrl + * @memberof pg_query.LockStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LockStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.LockStmt"; + }; + + return LockStmt; + })(); + + pg_query.ConstraintsSetStmt = (function() { + + /** + * Properties of a ConstraintsSetStmt. + * @memberof pg_query + * @interface IConstraintsSetStmt + * @property {Array.|null} [constraints] ConstraintsSetStmt constraints + * @property {boolean|null} [deferred] ConstraintsSetStmt deferred + */ + + /** + * Constructs a new ConstraintsSetStmt. + * @memberof pg_query + * @classdesc Represents a ConstraintsSetStmt. + * @implements IConstraintsSetStmt + * @constructor + * @param {pg_query.IConstraintsSetStmt=} [properties] Properties to set + */ + function ConstraintsSetStmt(properties) { + this.constraints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConstraintsSetStmt constraints. + * @member {Array.} constraints + * @memberof pg_query.ConstraintsSetStmt + * @instance + */ + ConstraintsSetStmt.prototype.constraints = $util.emptyArray; + + /** + * ConstraintsSetStmt deferred. + * @member {boolean} deferred + * @memberof pg_query.ConstraintsSetStmt + * @instance + */ + ConstraintsSetStmt.prototype.deferred = false; + + /** + * Creates a new ConstraintsSetStmt instance using the specified properties. + * @function create + * @memberof pg_query.ConstraintsSetStmt + * @static + * @param {pg_query.IConstraintsSetStmt=} [properties] Properties to set + * @returns {pg_query.ConstraintsSetStmt} ConstraintsSetStmt instance + */ + ConstraintsSetStmt.create = function create(properties) { + return new ConstraintsSetStmt(properties); + }; + + /** + * Encodes the specified ConstraintsSetStmt message. Does not implicitly {@link pg_query.ConstraintsSetStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.ConstraintsSetStmt + * @static + * @param {pg_query.IConstraintsSetStmt} message ConstraintsSetStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConstraintsSetStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.constraints != null && message.constraints.length) + for (var i = 0; i < message.constraints.length; ++i) + $root.pg_query.Node.encode(message.constraints[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deferred != null && Object.hasOwnProperty.call(message, "deferred")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deferred); + return writer; + }; + + /** + * Encodes the specified ConstraintsSetStmt message, length delimited. Does not implicitly {@link pg_query.ConstraintsSetStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ConstraintsSetStmt + * @static + * @param {pg_query.IConstraintsSetStmt} message ConstraintsSetStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConstraintsSetStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConstraintsSetStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ConstraintsSetStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ConstraintsSetStmt} ConstraintsSetStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConstraintsSetStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ConstraintsSetStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.constraints && message.constraints.length)) + message.constraints = []; + message.constraints.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.deferred = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConstraintsSetStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ConstraintsSetStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ConstraintsSetStmt} ConstraintsSetStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConstraintsSetStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConstraintsSetStmt message. + * @function verify + * @memberof pg_query.ConstraintsSetStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConstraintsSetStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.constraints != null && message.hasOwnProperty("constraints")) { + if (!Array.isArray(message.constraints)) + return "constraints: array expected"; + for (var i = 0; i < message.constraints.length; ++i) { + var error = $root.pg_query.Node.verify(message.constraints[i]); + if (error) + return "constraints." + error; + } + } + if (message.deferred != null && message.hasOwnProperty("deferred")) + if (typeof message.deferred !== "boolean") + return "deferred: boolean expected"; + return null; + }; + + /** + * Creates a ConstraintsSetStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ConstraintsSetStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ConstraintsSetStmt} ConstraintsSetStmt + */ + ConstraintsSetStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ConstraintsSetStmt) + return object; + var message = new $root.pg_query.ConstraintsSetStmt(); + if (object.constraints) { + if (!Array.isArray(object.constraints)) + throw TypeError(".pg_query.ConstraintsSetStmt.constraints: array expected"); + message.constraints = []; + for (var i = 0; i < object.constraints.length; ++i) { + if (typeof object.constraints[i] !== "object") + throw TypeError(".pg_query.ConstraintsSetStmt.constraints: object expected"); + message.constraints[i] = $root.pg_query.Node.fromObject(object.constraints[i]); + } + } + if (object.deferred != null) + message.deferred = Boolean(object.deferred); + return message; + }; + + /** + * Creates a plain object from a ConstraintsSetStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ConstraintsSetStmt + * @static + * @param {pg_query.ConstraintsSetStmt} message ConstraintsSetStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConstraintsSetStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.constraints = []; + if (options.defaults) + object.deferred = false; + if (message.constraints && message.constraints.length) { + object.constraints = []; + for (var j = 0; j < message.constraints.length; ++j) + object.constraints[j] = $root.pg_query.Node.toObject(message.constraints[j], options); + } + if (message.deferred != null && message.hasOwnProperty("deferred")) + object.deferred = message.deferred; + return object; + }; + + /** + * Converts this ConstraintsSetStmt to JSON. + * @function toJSON + * @memberof pg_query.ConstraintsSetStmt + * @instance + * @returns {Object.} JSON object + */ + ConstraintsSetStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConstraintsSetStmt + * @function getTypeUrl + * @memberof pg_query.ConstraintsSetStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConstraintsSetStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ConstraintsSetStmt"; + }; + + return ConstraintsSetStmt; + })(); + + pg_query.ReindexStmt = (function() { + + /** + * Properties of a ReindexStmt. + * @memberof pg_query + * @interface IReindexStmt + * @property {pg_query.ReindexObjectType|null} [kind] ReindexStmt kind + * @property {pg_query.IRangeVar|null} [relation] ReindexStmt relation + * @property {string|null} [name] ReindexStmt name + * @property {number|null} [options] ReindexStmt options + * @property {boolean|null} [concurrent] ReindexStmt concurrent + */ + + /** + * Constructs a new ReindexStmt. + * @memberof pg_query + * @classdesc Represents a ReindexStmt. + * @implements IReindexStmt + * @constructor + * @param {pg_query.IReindexStmt=} [properties] Properties to set + */ + function ReindexStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReindexStmt kind. + * @member {pg_query.ReindexObjectType} kind + * @memberof pg_query.ReindexStmt + * @instance + */ + ReindexStmt.prototype.kind = 0; + + /** + * ReindexStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.ReindexStmt + * @instance + */ + ReindexStmt.prototype.relation = null; + + /** + * ReindexStmt name. + * @member {string} name + * @memberof pg_query.ReindexStmt + * @instance + */ + ReindexStmt.prototype.name = ""; + + /** + * ReindexStmt options. + * @member {number} options + * @memberof pg_query.ReindexStmt + * @instance + */ + ReindexStmt.prototype.options = 0; + + /** + * ReindexStmt concurrent. + * @member {boolean} concurrent + * @memberof pg_query.ReindexStmt + * @instance + */ + ReindexStmt.prototype.concurrent = false; + + /** + * Creates a new ReindexStmt instance using the specified properties. + * @function create + * @memberof pg_query.ReindexStmt + * @static + * @param {pg_query.IReindexStmt=} [properties] Properties to set + * @returns {pg_query.ReindexStmt} ReindexStmt instance + */ + ReindexStmt.create = function create(properties) { + return new ReindexStmt(properties); + }; + + /** + * Encodes the specified ReindexStmt message. Does not implicitly {@link pg_query.ReindexStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.ReindexStmt + * @static + * @param {pg_query.IReindexStmt} message ReindexStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReindexStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.options); + if (message.concurrent != null && Object.hasOwnProperty.call(message, "concurrent")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.concurrent); + return writer; + }; + + /** + * Encodes the specified ReindexStmt message, length delimited. Does not implicitly {@link pg_query.ReindexStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ReindexStmt + * @static + * @param {pg_query.IReindexStmt} message ReindexStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReindexStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReindexStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ReindexStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ReindexStmt} ReindexStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReindexStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ReindexStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 3: { + message.name = reader.string(); + break; + } + case 4: { + message.options = reader.int32(); + break; + } + case 5: { + message.concurrent = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReindexStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ReindexStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ReindexStmt} ReindexStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReindexStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReindexStmt message. + * @function verify + * @memberof pg_query.ReindexStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReindexStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) + if (!$util.isInteger(message.options)) + return "options: integer expected"; + if (message.concurrent != null && message.hasOwnProperty("concurrent")) + if (typeof message.concurrent !== "boolean") + return "concurrent: boolean expected"; + return null; + }; + + /** + * Creates a ReindexStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ReindexStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ReindexStmt} ReindexStmt + */ + ReindexStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ReindexStmt) + return object; + var message = new $root.pg_query.ReindexStmt(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "REINDEX_OBJECT_TYPE_UNDEFINED": + case 0: + message.kind = 0; + break; + case "REINDEX_OBJECT_INDEX": + case 1: + message.kind = 1; + break; + case "REINDEX_OBJECT_TABLE": + case 2: + message.kind = 2; + break; + case "REINDEX_OBJECT_SCHEMA": + case 3: + message.kind = 3; + break; + case "REINDEX_OBJECT_SYSTEM": + case 4: + message.kind = 4; + break; + case "REINDEX_OBJECT_DATABASE": + case 5: + message.kind = 5; + break; + } + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.ReindexStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.name != null) + message.name = String(object.name); + if (object.options != null) + message.options = object.options | 0; + if (object.concurrent != null) + message.concurrent = Boolean(object.concurrent); + return message; + }; + + /** + * Creates a plain object from a ReindexStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ReindexStmt + * @static + * @param {pg_query.ReindexStmt} message ReindexStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReindexStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = options.enums === String ? "REINDEX_OBJECT_TYPE_UNDEFINED" : 0; + object.relation = null; + object.name = ""; + object.options = 0; + object.concurrent = false; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.pg_query.ReindexObjectType[message.kind] === undefined ? message.kind : $root.pg_query.ReindexObjectType[message.kind] : message.kind; + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = message.options; + if (message.concurrent != null && message.hasOwnProperty("concurrent")) + object.concurrent = message.concurrent; + return object; + }; + + /** + * Converts this ReindexStmt to JSON. + * @function toJSON + * @memberof pg_query.ReindexStmt + * @instance + * @returns {Object.} JSON object + */ + ReindexStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReindexStmt + * @function getTypeUrl + * @memberof pg_query.ReindexStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReindexStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ReindexStmt"; + }; + + return ReindexStmt; + })(); + + pg_query.CheckPointStmt = (function() { + + /** + * Properties of a CheckPointStmt. + * @memberof pg_query + * @interface ICheckPointStmt + */ + + /** + * Constructs a new CheckPointStmt. + * @memberof pg_query + * @classdesc Represents a CheckPointStmt. + * @implements ICheckPointStmt + * @constructor + * @param {pg_query.ICheckPointStmt=} [properties] Properties to set + */ + function CheckPointStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new CheckPointStmt instance using the specified properties. + * @function create + * @memberof pg_query.CheckPointStmt + * @static + * @param {pg_query.ICheckPointStmt=} [properties] Properties to set + * @returns {pg_query.CheckPointStmt} CheckPointStmt instance + */ + CheckPointStmt.create = function create(properties) { + return new CheckPointStmt(properties); + }; + + /** + * Encodes the specified CheckPointStmt message. Does not implicitly {@link pg_query.CheckPointStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CheckPointStmt + * @static + * @param {pg_query.ICheckPointStmt} message CheckPointStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckPointStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CheckPointStmt message, length delimited. Does not implicitly {@link pg_query.CheckPointStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CheckPointStmt + * @static + * @param {pg_query.ICheckPointStmt} message CheckPointStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckPointStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckPointStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CheckPointStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CheckPointStmt} CheckPointStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckPointStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CheckPointStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckPointStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CheckPointStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CheckPointStmt} CheckPointStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckPointStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckPointStmt message. + * @function verify + * @memberof pg_query.CheckPointStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckPointStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CheckPointStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CheckPointStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CheckPointStmt} CheckPointStmt + */ + CheckPointStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CheckPointStmt) + return object; + return new $root.pg_query.CheckPointStmt(); + }; + + /** + * Creates a plain object from a CheckPointStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CheckPointStmt + * @static + * @param {pg_query.CheckPointStmt} message CheckPointStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckPointStmt.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CheckPointStmt to JSON. + * @function toJSON + * @memberof pg_query.CheckPointStmt + * @instance + * @returns {Object.} JSON object + */ + CheckPointStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckPointStmt + * @function getTypeUrl + * @memberof pg_query.CheckPointStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckPointStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CheckPointStmt"; + }; + + return CheckPointStmt; + })(); + + pg_query.CreateSchemaStmt = (function() { + + /** + * Properties of a CreateSchemaStmt. + * @memberof pg_query + * @interface ICreateSchemaStmt + * @property {string|null} [schemaname] CreateSchemaStmt schemaname + * @property {pg_query.IRoleSpec|null} [authrole] CreateSchemaStmt authrole + * @property {Array.|null} [schemaElts] CreateSchemaStmt schemaElts + * @property {boolean|null} [if_not_exists] CreateSchemaStmt if_not_exists + */ + + /** + * Constructs a new CreateSchemaStmt. + * @memberof pg_query + * @classdesc Represents a CreateSchemaStmt. + * @implements ICreateSchemaStmt + * @constructor + * @param {pg_query.ICreateSchemaStmt=} [properties] Properties to set + */ + function CreateSchemaStmt(properties) { + this.schemaElts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSchemaStmt schemaname. + * @member {string} schemaname + * @memberof pg_query.CreateSchemaStmt + * @instance + */ + CreateSchemaStmt.prototype.schemaname = ""; + + /** + * CreateSchemaStmt authrole. + * @member {pg_query.IRoleSpec|null|undefined} authrole + * @memberof pg_query.CreateSchemaStmt + * @instance + */ + CreateSchemaStmt.prototype.authrole = null; + + /** + * CreateSchemaStmt schemaElts. + * @member {Array.} schemaElts + * @memberof pg_query.CreateSchemaStmt + * @instance + */ + CreateSchemaStmt.prototype.schemaElts = $util.emptyArray; + + /** + * CreateSchemaStmt if_not_exists. + * @member {boolean} if_not_exists + * @memberof pg_query.CreateSchemaStmt + * @instance + */ + CreateSchemaStmt.prototype.if_not_exists = false; + + /** + * Creates a new CreateSchemaStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateSchemaStmt + * @static + * @param {pg_query.ICreateSchemaStmt=} [properties] Properties to set + * @returns {pg_query.CreateSchemaStmt} CreateSchemaStmt instance + */ + CreateSchemaStmt.create = function create(properties) { + return new CreateSchemaStmt(properties); + }; + + /** + * Encodes the specified CreateSchemaStmt message. Does not implicitly {@link pg_query.CreateSchemaStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateSchemaStmt + * @static + * @param {pg_query.ICreateSchemaStmt} message CreateSchemaStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schemaname != null && Object.hasOwnProperty.call(message, "schemaname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.schemaname); + if (message.authrole != null && Object.hasOwnProperty.call(message, "authrole")) + $root.pg_query.RoleSpec.encode(message.authrole, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.schemaElts != null && message.schemaElts.length) + for (var i = 0; i < message.schemaElts.length; ++i) + $root.pg_query.Node.encode(message.schemaElts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.if_not_exists != null && Object.hasOwnProperty.call(message, "if_not_exists")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.if_not_exists); + return writer; + }; + + /** + * Encodes the specified CreateSchemaStmt message, length delimited. Does not implicitly {@link pg_query.CreateSchemaStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateSchemaStmt + * @static + * @param {pg_query.ICreateSchemaStmt} message CreateSchemaStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSchemaStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSchemaStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateSchemaStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateSchemaStmt} CreateSchemaStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateSchemaStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.schemaname = reader.string(); + break; + } + case 2: { + message.authrole = $root.pg_query.RoleSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.schemaElts && message.schemaElts.length)) + message.schemaElts = []; + message.schemaElts.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.if_not_exists = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSchemaStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateSchemaStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateSchemaStmt} CreateSchemaStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSchemaStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSchemaStmt message. + * @function verify + * @memberof pg_query.CreateSchemaStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSchemaStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schemaname != null && message.hasOwnProperty("schemaname")) + if (!$util.isString(message.schemaname)) + return "schemaname: string expected"; + if (message.authrole != null && message.hasOwnProperty("authrole")) { + var error = $root.pg_query.RoleSpec.verify(message.authrole); + if (error) + return "authrole." + error; + } + if (message.schemaElts != null && message.hasOwnProperty("schemaElts")) { + if (!Array.isArray(message.schemaElts)) + return "schemaElts: array expected"; + for (var i = 0; i < message.schemaElts.length; ++i) { + var error = $root.pg_query.Node.verify(message.schemaElts[i]); + if (error) + return "schemaElts." + error; + } + } + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + if (typeof message.if_not_exists !== "boolean") + return "if_not_exists: boolean expected"; + return null; + }; + + /** + * Creates a CreateSchemaStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateSchemaStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateSchemaStmt} CreateSchemaStmt + */ + CreateSchemaStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateSchemaStmt) + return object; + var message = new $root.pg_query.CreateSchemaStmt(); + if (object.schemaname != null) + message.schemaname = String(object.schemaname); + if (object.authrole != null) { + if (typeof object.authrole !== "object") + throw TypeError(".pg_query.CreateSchemaStmt.authrole: object expected"); + message.authrole = $root.pg_query.RoleSpec.fromObject(object.authrole); + } + if (object.schemaElts) { + if (!Array.isArray(object.schemaElts)) + throw TypeError(".pg_query.CreateSchemaStmt.schemaElts: array expected"); + message.schemaElts = []; + for (var i = 0; i < object.schemaElts.length; ++i) { + if (typeof object.schemaElts[i] !== "object") + throw TypeError(".pg_query.CreateSchemaStmt.schemaElts: object expected"); + message.schemaElts[i] = $root.pg_query.Node.fromObject(object.schemaElts[i]); + } + } + if (object.if_not_exists != null) + message.if_not_exists = Boolean(object.if_not_exists); + return message; + }; + + /** + * Creates a plain object from a CreateSchemaStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateSchemaStmt + * @static + * @param {pg_query.CreateSchemaStmt} message CreateSchemaStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSchemaStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schemaElts = []; + if (options.defaults) { + object.schemaname = ""; + object.authrole = null; + object.if_not_exists = false; + } + if (message.schemaname != null && message.hasOwnProperty("schemaname")) + object.schemaname = message.schemaname; + if (message.authrole != null && message.hasOwnProperty("authrole")) + object.authrole = $root.pg_query.RoleSpec.toObject(message.authrole, options); + if (message.schemaElts && message.schemaElts.length) { + object.schemaElts = []; + for (var j = 0; j < message.schemaElts.length; ++j) + object.schemaElts[j] = $root.pg_query.Node.toObject(message.schemaElts[j], options); + } + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + object.if_not_exists = message.if_not_exists; + return object; + }; + + /** + * Converts this CreateSchemaStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateSchemaStmt + * @instance + * @returns {Object.} JSON object + */ + CreateSchemaStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSchemaStmt + * @function getTypeUrl + * @memberof pg_query.CreateSchemaStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSchemaStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateSchemaStmt"; + }; + + return CreateSchemaStmt; + })(); + + pg_query.AlterDatabaseStmt = (function() { + + /** + * Properties of an AlterDatabaseStmt. + * @memberof pg_query + * @interface IAlterDatabaseStmt + * @property {string|null} [dbname] AlterDatabaseStmt dbname + * @property {Array.|null} [options] AlterDatabaseStmt options + */ + + /** + * Constructs a new AlterDatabaseStmt. + * @memberof pg_query + * @classdesc Represents an AlterDatabaseStmt. + * @implements IAlterDatabaseStmt + * @constructor + * @param {pg_query.IAlterDatabaseStmt=} [properties] Properties to set + */ + function AlterDatabaseStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterDatabaseStmt dbname. + * @member {string} dbname + * @memberof pg_query.AlterDatabaseStmt + * @instance + */ + AlterDatabaseStmt.prototype.dbname = ""; + + /** + * AlterDatabaseStmt options. + * @member {Array.} options + * @memberof pg_query.AlterDatabaseStmt + * @instance + */ + AlterDatabaseStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new AlterDatabaseStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterDatabaseStmt + * @static + * @param {pg_query.IAlterDatabaseStmt=} [properties] Properties to set + * @returns {pg_query.AlterDatabaseStmt} AlterDatabaseStmt instance + */ + AlterDatabaseStmt.create = function create(properties) { + return new AlterDatabaseStmt(properties); + }; + + /** + * Encodes the specified AlterDatabaseStmt message. Does not implicitly {@link pg_query.AlterDatabaseStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterDatabaseStmt + * @static + * @param {pg_query.IAlterDatabaseStmt} message AlterDatabaseStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterDatabaseStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dbname != null && Object.hasOwnProperty.call(message, "dbname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dbname); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterDatabaseStmt message, length delimited. Does not implicitly {@link pg_query.AlterDatabaseStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterDatabaseStmt + * @static + * @param {pg_query.IAlterDatabaseStmt} message AlterDatabaseStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterDatabaseStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterDatabaseStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterDatabaseStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterDatabaseStmt} AlterDatabaseStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterDatabaseStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterDatabaseStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dbname = reader.string(); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterDatabaseStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterDatabaseStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterDatabaseStmt} AlterDatabaseStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterDatabaseStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterDatabaseStmt message. + * @function verify + * @memberof pg_query.AlterDatabaseStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterDatabaseStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dbname != null && message.hasOwnProperty("dbname")) + if (!$util.isString(message.dbname)) + return "dbname: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates an AlterDatabaseStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterDatabaseStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterDatabaseStmt} AlterDatabaseStmt + */ + AlterDatabaseStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterDatabaseStmt) + return object; + var message = new $root.pg_query.AlterDatabaseStmt(); + if (object.dbname != null) + message.dbname = String(object.dbname); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterDatabaseStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterDatabaseStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlterDatabaseStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterDatabaseStmt + * @static + * @param {pg_query.AlterDatabaseStmt} message AlterDatabaseStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterDatabaseStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) + object.dbname = ""; + if (message.dbname != null && message.hasOwnProperty("dbname")) + object.dbname = message.dbname; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this AlterDatabaseStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterDatabaseStmt + * @instance + * @returns {Object.} JSON object + */ + AlterDatabaseStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterDatabaseStmt + * @function getTypeUrl + * @memberof pg_query.AlterDatabaseStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterDatabaseStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterDatabaseStmt"; + }; + + return AlterDatabaseStmt; + })(); + + pg_query.AlterDatabaseSetStmt = (function() { + + /** + * Properties of an AlterDatabaseSetStmt. + * @memberof pg_query + * @interface IAlterDatabaseSetStmt + * @property {string|null} [dbname] AlterDatabaseSetStmt dbname + * @property {pg_query.IVariableSetStmt|null} [setstmt] AlterDatabaseSetStmt setstmt + */ + + /** + * Constructs a new AlterDatabaseSetStmt. + * @memberof pg_query + * @classdesc Represents an AlterDatabaseSetStmt. + * @implements IAlterDatabaseSetStmt + * @constructor + * @param {pg_query.IAlterDatabaseSetStmt=} [properties] Properties to set + */ + function AlterDatabaseSetStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterDatabaseSetStmt dbname. + * @member {string} dbname + * @memberof pg_query.AlterDatabaseSetStmt + * @instance + */ + AlterDatabaseSetStmt.prototype.dbname = ""; + + /** + * AlterDatabaseSetStmt setstmt. + * @member {pg_query.IVariableSetStmt|null|undefined} setstmt + * @memberof pg_query.AlterDatabaseSetStmt + * @instance + */ + AlterDatabaseSetStmt.prototype.setstmt = null; + + /** + * Creates a new AlterDatabaseSetStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterDatabaseSetStmt + * @static + * @param {pg_query.IAlterDatabaseSetStmt=} [properties] Properties to set + * @returns {pg_query.AlterDatabaseSetStmt} AlterDatabaseSetStmt instance + */ + AlterDatabaseSetStmt.create = function create(properties) { + return new AlterDatabaseSetStmt(properties); + }; + + /** + * Encodes the specified AlterDatabaseSetStmt message. Does not implicitly {@link pg_query.AlterDatabaseSetStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterDatabaseSetStmt + * @static + * @param {pg_query.IAlterDatabaseSetStmt} message AlterDatabaseSetStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterDatabaseSetStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dbname != null && Object.hasOwnProperty.call(message, "dbname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dbname); + if (message.setstmt != null && Object.hasOwnProperty.call(message, "setstmt")) + $root.pg_query.VariableSetStmt.encode(message.setstmt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterDatabaseSetStmt message, length delimited. Does not implicitly {@link pg_query.AlterDatabaseSetStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterDatabaseSetStmt + * @static + * @param {pg_query.IAlterDatabaseSetStmt} message AlterDatabaseSetStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterDatabaseSetStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterDatabaseSetStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterDatabaseSetStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterDatabaseSetStmt} AlterDatabaseSetStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterDatabaseSetStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterDatabaseSetStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dbname = reader.string(); + break; + } + case 2: { + message.setstmt = $root.pg_query.VariableSetStmt.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterDatabaseSetStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterDatabaseSetStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterDatabaseSetStmt} AlterDatabaseSetStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterDatabaseSetStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterDatabaseSetStmt message. + * @function verify + * @memberof pg_query.AlterDatabaseSetStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterDatabaseSetStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dbname != null && message.hasOwnProperty("dbname")) + if (!$util.isString(message.dbname)) + return "dbname: string expected"; + if (message.setstmt != null && message.hasOwnProperty("setstmt")) { + var error = $root.pg_query.VariableSetStmt.verify(message.setstmt); + if (error) + return "setstmt." + error; + } + return null; + }; + + /** + * Creates an AlterDatabaseSetStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterDatabaseSetStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterDatabaseSetStmt} AlterDatabaseSetStmt + */ + AlterDatabaseSetStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterDatabaseSetStmt) + return object; + var message = new $root.pg_query.AlterDatabaseSetStmt(); + if (object.dbname != null) + message.dbname = String(object.dbname); + if (object.setstmt != null) { + if (typeof object.setstmt !== "object") + throw TypeError(".pg_query.AlterDatabaseSetStmt.setstmt: object expected"); + message.setstmt = $root.pg_query.VariableSetStmt.fromObject(object.setstmt); + } + return message; + }; + + /** + * Creates a plain object from an AlterDatabaseSetStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterDatabaseSetStmt + * @static + * @param {pg_query.AlterDatabaseSetStmt} message AlterDatabaseSetStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterDatabaseSetStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dbname = ""; + object.setstmt = null; + } + if (message.dbname != null && message.hasOwnProperty("dbname")) + object.dbname = message.dbname; + if (message.setstmt != null && message.hasOwnProperty("setstmt")) + object.setstmt = $root.pg_query.VariableSetStmt.toObject(message.setstmt, options); + return object; + }; + + /** + * Converts this AlterDatabaseSetStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterDatabaseSetStmt + * @instance + * @returns {Object.} JSON object + */ + AlterDatabaseSetStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterDatabaseSetStmt + * @function getTypeUrl + * @memberof pg_query.AlterDatabaseSetStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterDatabaseSetStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterDatabaseSetStmt"; + }; + + return AlterDatabaseSetStmt; + })(); + + pg_query.AlterRoleSetStmt = (function() { + + /** + * Properties of an AlterRoleSetStmt. + * @memberof pg_query + * @interface IAlterRoleSetStmt + * @property {pg_query.IRoleSpec|null} [role] AlterRoleSetStmt role + * @property {string|null} [database] AlterRoleSetStmt database + * @property {pg_query.IVariableSetStmt|null} [setstmt] AlterRoleSetStmt setstmt + */ + + /** + * Constructs a new AlterRoleSetStmt. + * @memberof pg_query + * @classdesc Represents an AlterRoleSetStmt. + * @implements IAlterRoleSetStmt + * @constructor + * @param {pg_query.IAlterRoleSetStmt=} [properties] Properties to set + */ + function AlterRoleSetStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterRoleSetStmt role. + * @member {pg_query.IRoleSpec|null|undefined} role + * @memberof pg_query.AlterRoleSetStmt + * @instance + */ + AlterRoleSetStmt.prototype.role = null; + + /** + * AlterRoleSetStmt database. + * @member {string} database + * @memberof pg_query.AlterRoleSetStmt + * @instance + */ + AlterRoleSetStmt.prototype.database = ""; + + /** + * AlterRoleSetStmt setstmt. + * @member {pg_query.IVariableSetStmt|null|undefined} setstmt + * @memberof pg_query.AlterRoleSetStmt + * @instance + */ + AlterRoleSetStmt.prototype.setstmt = null; + + /** + * Creates a new AlterRoleSetStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterRoleSetStmt + * @static + * @param {pg_query.IAlterRoleSetStmt=} [properties] Properties to set + * @returns {pg_query.AlterRoleSetStmt} AlterRoleSetStmt instance + */ + AlterRoleSetStmt.create = function create(properties) { + return new AlterRoleSetStmt(properties); + }; + + /** + * Encodes the specified AlterRoleSetStmt message. Does not implicitly {@link pg_query.AlterRoleSetStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterRoleSetStmt + * @static + * @param {pg_query.IAlterRoleSetStmt} message AlterRoleSetStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterRoleSetStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + $root.pg_query.RoleSpec.encode(message.role, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.database != null && Object.hasOwnProperty.call(message, "database")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.database); + if (message.setstmt != null && Object.hasOwnProperty.call(message, "setstmt")) + $root.pg_query.VariableSetStmt.encode(message.setstmt, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterRoleSetStmt message, length delimited. Does not implicitly {@link pg_query.AlterRoleSetStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterRoleSetStmt + * @static + * @param {pg_query.IAlterRoleSetStmt} message AlterRoleSetStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterRoleSetStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterRoleSetStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterRoleSetStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterRoleSetStmt} AlterRoleSetStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterRoleSetStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterRoleSetStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = $root.pg_query.RoleSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.database = reader.string(); + break; + } + case 3: { + message.setstmt = $root.pg_query.VariableSetStmt.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterRoleSetStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterRoleSetStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterRoleSetStmt} AlterRoleSetStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterRoleSetStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterRoleSetStmt message. + * @function verify + * @memberof pg_query.AlterRoleSetStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterRoleSetStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) { + var error = $root.pg_query.RoleSpec.verify(message.role); + if (error) + return "role." + error; + } + if (message.database != null && message.hasOwnProperty("database")) + if (!$util.isString(message.database)) + return "database: string expected"; + if (message.setstmt != null && message.hasOwnProperty("setstmt")) { + var error = $root.pg_query.VariableSetStmt.verify(message.setstmt); + if (error) + return "setstmt." + error; + } + return null; + }; + + /** + * Creates an AlterRoleSetStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterRoleSetStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterRoleSetStmt} AlterRoleSetStmt + */ + AlterRoleSetStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterRoleSetStmt) + return object; + var message = new $root.pg_query.AlterRoleSetStmt(); + if (object.role != null) { + if (typeof object.role !== "object") + throw TypeError(".pg_query.AlterRoleSetStmt.role: object expected"); + message.role = $root.pg_query.RoleSpec.fromObject(object.role); + } + if (object.database != null) + message.database = String(object.database); + if (object.setstmt != null) { + if (typeof object.setstmt !== "object") + throw TypeError(".pg_query.AlterRoleSetStmt.setstmt: object expected"); + message.setstmt = $root.pg_query.VariableSetStmt.fromObject(object.setstmt); + } + return message; + }; + + /** + * Creates a plain object from an AlterRoleSetStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterRoleSetStmt + * @static + * @param {pg_query.AlterRoleSetStmt} message AlterRoleSetStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterRoleSetStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.role = null; + object.database = ""; + object.setstmt = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = $root.pg_query.RoleSpec.toObject(message.role, options); + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.setstmt != null && message.hasOwnProperty("setstmt")) + object.setstmt = $root.pg_query.VariableSetStmt.toObject(message.setstmt, options); + return object; + }; + + /** + * Converts this AlterRoleSetStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterRoleSetStmt + * @instance + * @returns {Object.} JSON object + */ + AlterRoleSetStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterRoleSetStmt + * @function getTypeUrl + * @memberof pg_query.AlterRoleSetStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterRoleSetStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterRoleSetStmt"; + }; + + return AlterRoleSetStmt; + })(); + + pg_query.CreateConversionStmt = (function() { + + /** + * Properties of a CreateConversionStmt. + * @memberof pg_query + * @interface ICreateConversionStmt + * @property {Array.|null} [conversion_name] CreateConversionStmt conversion_name + * @property {string|null} [for_encoding_name] CreateConversionStmt for_encoding_name + * @property {string|null} [to_encoding_name] CreateConversionStmt to_encoding_name + * @property {Array.|null} [func_name] CreateConversionStmt func_name + * @property {boolean|null} [def] CreateConversionStmt def + */ + + /** + * Constructs a new CreateConversionStmt. + * @memberof pg_query + * @classdesc Represents a CreateConversionStmt. + * @implements ICreateConversionStmt + * @constructor + * @param {pg_query.ICreateConversionStmt=} [properties] Properties to set + */ + function CreateConversionStmt(properties) { + this.conversion_name = []; + this.func_name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateConversionStmt conversion_name. + * @member {Array.} conversion_name + * @memberof pg_query.CreateConversionStmt + * @instance + */ + CreateConversionStmt.prototype.conversion_name = $util.emptyArray; + + /** + * CreateConversionStmt for_encoding_name. + * @member {string} for_encoding_name + * @memberof pg_query.CreateConversionStmt + * @instance + */ + CreateConversionStmt.prototype.for_encoding_name = ""; + + /** + * CreateConversionStmt to_encoding_name. + * @member {string} to_encoding_name + * @memberof pg_query.CreateConversionStmt + * @instance + */ + CreateConversionStmt.prototype.to_encoding_name = ""; + + /** + * CreateConversionStmt func_name. + * @member {Array.} func_name + * @memberof pg_query.CreateConversionStmt + * @instance + */ + CreateConversionStmt.prototype.func_name = $util.emptyArray; + + /** + * CreateConversionStmt def. + * @member {boolean} def + * @memberof pg_query.CreateConversionStmt + * @instance + */ + CreateConversionStmt.prototype.def = false; + + /** + * Creates a new CreateConversionStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateConversionStmt + * @static + * @param {pg_query.ICreateConversionStmt=} [properties] Properties to set + * @returns {pg_query.CreateConversionStmt} CreateConversionStmt instance + */ + CreateConversionStmt.create = function create(properties) { + return new CreateConversionStmt(properties); + }; + + /** + * Encodes the specified CreateConversionStmt message. Does not implicitly {@link pg_query.CreateConversionStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateConversionStmt + * @static + * @param {pg_query.ICreateConversionStmt} message CreateConversionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateConversionStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversion_name != null && message.conversion_name.length) + for (var i = 0; i < message.conversion_name.length; ++i) + $root.pg_query.Node.encode(message.conversion_name[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.for_encoding_name != null && Object.hasOwnProperty.call(message, "for_encoding_name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.for_encoding_name); + if (message.to_encoding_name != null && Object.hasOwnProperty.call(message, "to_encoding_name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.to_encoding_name); + if (message.func_name != null && message.func_name.length) + for (var i = 0; i < message.func_name.length; ++i) + $root.pg_query.Node.encode(message.func_name[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.def != null && Object.hasOwnProperty.call(message, "def")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.def); + return writer; + }; + + /** + * Encodes the specified CreateConversionStmt message, length delimited. Does not implicitly {@link pg_query.CreateConversionStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateConversionStmt + * @static + * @param {pg_query.ICreateConversionStmt} message CreateConversionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateConversionStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateConversionStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateConversionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateConversionStmt} CreateConversionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateConversionStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateConversionStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.conversion_name && message.conversion_name.length)) + message.conversion_name = []; + message.conversion_name.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.for_encoding_name = reader.string(); + break; + } + case 3: { + message.to_encoding_name = reader.string(); + break; + } + case 4: { + if (!(message.func_name && message.func_name.length)) + message.func_name = []; + message.func_name.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.def = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateConversionStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateConversionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateConversionStmt} CreateConversionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateConversionStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateConversionStmt message. + * @function verify + * @memberof pg_query.CreateConversionStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateConversionStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversion_name != null && message.hasOwnProperty("conversion_name")) { + if (!Array.isArray(message.conversion_name)) + return "conversion_name: array expected"; + for (var i = 0; i < message.conversion_name.length; ++i) { + var error = $root.pg_query.Node.verify(message.conversion_name[i]); + if (error) + return "conversion_name." + error; + } + } + if (message.for_encoding_name != null && message.hasOwnProperty("for_encoding_name")) + if (!$util.isString(message.for_encoding_name)) + return "for_encoding_name: string expected"; + if (message.to_encoding_name != null && message.hasOwnProperty("to_encoding_name")) + if (!$util.isString(message.to_encoding_name)) + return "to_encoding_name: string expected"; + if (message.func_name != null && message.hasOwnProperty("func_name")) { + if (!Array.isArray(message.func_name)) + return "func_name: array expected"; + for (var i = 0; i < message.func_name.length; ++i) { + var error = $root.pg_query.Node.verify(message.func_name[i]); + if (error) + return "func_name." + error; + } + } + if (message.def != null && message.hasOwnProperty("def")) + if (typeof message.def !== "boolean") + return "def: boolean expected"; + return null; + }; + + /** + * Creates a CreateConversionStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateConversionStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateConversionStmt} CreateConversionStmt + */ + CreateConversionStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateConversionStmt) + return object; + var message = new $root.pg_query.CreateConversionStmt(); + if (object.conversion_name) { + if (!Array.isArray(object.conversion_name)) + throw TypeError(".pg_query.CreateConversionStmt.conversion_name: array expected"); + message.conversion_name = []; + for (var i = 0; i < object.conversion_name.length; ++i) { + if (typeof object.conversion_name[i] !== "object") + throw TypeError(".pg_query.CreateConversionStmt.conversion_name: object expected"); + message.conversion_name[i] = $root.pg_query.Node.fromObject(object.conversion_name[i]); + } + } + if (object.for_encoding_name != null) + message.for_encoding_name = String(object.for_encoding_name); + if (object.to_encoding_name != null) + message.to_encoding_name = String(object.to_encoding_name); + if (object.func_name) { + if (!Array.isArray(object.func_name)) + throw TypeError(".pg_query.CreateConversionStmt.func_name: array expected"); + message.func_name = []; + for (var i = 0; i < object.func_name.length; ++i) { + if (typeof object.func_name[i] !== "object") + throw TypeError(".pg_query.CreateConversionStmt.func_name: object expected"); + message.func_name[i] = $root.pg_query.Node.fromObject(object.func_name[i]); + } + } + if (object.def != null) + message.def = Boolean(object.def); + return message; + }; + + /** + * Creates a plain object from a CreateConversionStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateConversionStmt + * @static + * @param {pg_query.CreateConversionStmt} message CreateConversionStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateConversionStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.conversion_name = []; + object.func_name = []; + } + if (options.defaults) { + object.for_encoding_name = ""; + object.to_encoding_name = ""; + object.def = false; + } + if (message.conversion_name && message.conversion_name.length) { + object.conversion_name = []; + for (var j = 0; j < message.conversion_name.length; ++j) + object.conversion_name[j] = $root.pg_query.Node.toObject(message.conversion_name[j], options); + } + if (message.for_encoding_name != null && message.hasOwnProperty("for_encoding_name")) + object.for_encoding_name = message.for_encoding_name; + if (message.to_encoding_name != null && message.hasOwnProperty("to_encoding_name")) + object.to_encoding_name = message.to_encoding_name; + if (message.func_name && message.func_name.length) { + object.func_name = []; + for (var j = 0; j < message.func_name.length; ++j) + object.func_name[j] = $root.pg_query.Node.toObject(message.func_name[j], options); + } + if (message.def != null && message.hasOwnProperty("def")) + object.def = message.def; + return object; + }; + + /** + * Converts this CreateConversionStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateConversionStmt + * @instance + * @returns {Object.} JSON object + */ + CreateConversionStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateConversionStmt + * @function getTypeUrl + * @memberof pg_query.CreateConversionStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateConversionStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateConversionStmt"; + }; + + return CreateConversionStmt; + })(); + + pg_query.CreateCastStmt = (function() { + + /** + * Properties of a CreateCastStmt. + * @memberof pg_query + * @interface ICreateCastStmt + * @property {pg_query.ITypeName|null} [sourcetype] CreateCastStmt sourcetype + * @property {pg_query.ITypeName|null} [targettype] CreateCastStmt targettype + * @property {pg_query.IObjectWithArgs|null} [func] CreateCastStmt func + * @property {pg_query.CoercionContext|null} [context] CreateCastStmt context + * @property {boolean|null} [inout] CreateCastStmt inout + */ + + /** + * Constructs a new CreateCastStmt. + * @memberof pg_query + * @classdesc Represents a CreateCastStmt. + * @implements ICreateCastStmt + * @constructor + * @param {pg_query.ICreateCastStmt=} [properties] Properties to set + */ + function CreateCastStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCastStmt sourcetype. + * @member {pg_query.ITypeName|null|undefined} sourcetype + * @memberof pg_query.CreateCastStmt + * @instance + */ + CreateCastStmt.prototype.sourcetype = null; + + /** + * CreateCastStmt targettype. + * @member {pg_query.ITypeName|null|undefined} targettype + * @memberof pg_query.CreateCastStmt + * @instance + */ + CreateCastStmt.prototype.targettype = null; + + /** + * CreateCastStmt func. + * @member {pg_query.IObjectWithArgs|null|undefined} func + * @memberof pg_query.CreateCastStmt + * @instance + */ + CreateCastStmt.prototype.func = null; + + /** + * CreateCastStmt context. + * @member {pg_query.CoercionContext} context + * @memberof pg_query.CreateCastStmt + * @instance + */ + CreateCastStmt.prototype.context = 0; + + /** + * CreateCastStmt inout. + * @member {boolean} inout + * @memberof pg_query.CreateCastStmt + * @instance + */ + CreateCastStmt.prototype.inout = false; + + /** + * Creates a new CreateCastStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateCastStmt + * @static + * @param {pg_query.ICreateCastStmt=} [properties] Properties to set + * @returns {pg_query.CreateCastStmt} CreateCastStmt instance + */ + CreateCastStmt.create = function create(properties) { + return new CreateCastStmt(properties); + }; + + /** + * Encodes the specified CreateCastStmt message. Does not implicitly {@link pg_query.CreateCastStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateCastStmt + * @static + * @param {pg_query.ICreateCastStmt} message CreateCastStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCastStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourcetype != null && Object.hasOwnProperty.call(message, "sourcetype")) + $root.pg_query.TypeName.encode(message.sourcetype, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.targettype != null && Object.hasOwnProperty.call(message, "targettype")) + $root.pg_query.TypeName.encode(message.targettype, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.func != null && Object.hasOwnProperty.call(message, "func")) + $root.pg_query.ObjectWithArgs.encode(message.func, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.context); + if (message.inout != null && Object.hasOwnProperty.call(message, "inout")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.inout); + return writer; + }; + + /** + * Encodes the specified CreateCastStmt message, length delimited. Does not implicitly {@link pg_query.CreateCastStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateCastStmt + * @static + * @param {pg_query.ICreateCastStmt} message CreateCastStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCastStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCastStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateCastStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateCastStmt} CreateCastStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCastStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateCastStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourcetype = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 2: { + message.targettype = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 3: { + message.func = $root.pg_query.ObjectWithArgs.decode(reader, reader.uint32()); + break; + } + case 4: { + message.context = reader.int32(); + break; + } + case 5: { + message.inout = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCastStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateCastStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateCastStmt} CreateCastStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCastStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCastStmt message. + * @function verify + * @memberof pg_query.CreateCastStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCastStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sourcetype != null && message.hasOwnProperty("sourcetype")) { + var error = $root.pg_query.TypeName.verify(message.sourcetype); + if (error) + return "sourcetype." + error; + } + if (message.targettype != null && message.hasOwnProperty("targettype")) { + var error = $root.pg_query.TypeName.verify(message.targettype); + if (error) + return "targettype." + error; + } + if (message.func != null && message.hasOwnProperty("func")) { + var error = $root.pg_query.ObjectWithArgs.verify(message.func); + if (error) + return "func." + error; + } + if (message.context != null && message.hasOwnProperty("context")) + switch (message.context) { + default: + return "context: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.inout != null && message.hasOwnProperty("inout")) + if (typeof message.inout !== "boolean") + return "inout: boolean expected"; + return null; + }; + + /** + * Creates a CreateCastStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateCastStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateCastStmt} CreateCastStmt + */ + CreateCastStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateCastStmt) + return object; + var message = new $root.pg_query.CreateCastStmt(); + if (object.sourcetype != null) { + if (typeof object.sourcetype !== "object") + throw TypeError(".pg_query.CreateCastStmt.sourcetype: object expected"); + message.sourcetype = $root.pg_query.TypeName.fromObject(object.sourcetype); + } + if (object.targettype != null) { + if (typeof object.targettype !== "object") + throw TypeError(".pg_query.CreateCastStmt.targettype: object expected"); + message.targettype = $root.pg_query.TypeName.fromObject(object.targettype); + } + if (object.func != null) { + if (typeof object.func !== "object") + throw TypeError(".pg_query.CreateCastStmt.func: object expected"); + message.func = $root.pg_query.ObjectWithArgs.fromObject(object.func); + } + switch (object.context) { + default: + if (typeof object.context === "number") { + message.context = object.context; + break; + } + break; + case "COERCION_CONTEXT_UNDEFINED": + case 0: + message.context = 0; + break; + case "COERCION_IMPLICIT": + case 1: + message.context = 1; + break; + case "COERCION_ASSIGNMENT": + case 2: + message.context = 2; + break; + case "COERCION_EXPLICIT": + case 3: + message.context = 3; + break; + } + if (object.inout != null) + message.inout = Boolean(object.inout); + return message; + }; + + /** + * Creates a plain object from a CreateCastStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateCastStmt + * @static + * @param {pg_query.CreateCastStmt} message CreateCastStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCastStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourcetype = null; + object.targettype = null; + object.func = null; + object.context = options.enums === String ? "COERCION_CONTEXT_UNDEFINED" : 0; + object.inout = false; + } + if (message.sourcetype != null && message.hasOwnProperty("sourcetype")) + object.sourcetype = $root.pg_query.TypeName.toObject(message.sourcetype, options); + if (message.targettype != null && message.hasOwnProperty("targettype")) + object.targettype = $root.pg_query.TypeName.toObject(message.targettype, options); + if (message.func != null && message.hasOwnProperty("func")) + object.func = $root.pg_query.ObjectWithArgs.toObject(message.func, options); + if (message.context != null && message.hasOwnProperty("context")) + object.context = options.enums === String ? $root.pg_query.CoercionContext[message.context] === undefined ? message.context : $root.pg_query.CoercionContext[message.context] : message.context; + if (message.inout != null && message.hasOwnProperty("inout")) + object.inout = message.inout; + return object; + }; + + /** + * Converts this CreateCastStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateCastStmt + * @instance + * @returns {Object.} JSON object + */ + CreateCastStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCastStmt + * @function getTypeUrl + * @memberof pg_query.CreateCastStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCastStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateCastStmt"; + }; + + return CreateCastStmt; + })(); + + pg_query.CreateOpClassStmt = (function() { + + /** + * Properties of a CreateOpClassStmt. + * @memberof pg_query + * @interface ICreateOpClassStmt + * @property {Array.|null} [opclassname] CreateOpClassStmt opclassname + * @property {Array.|null} [opfamilyname] CreateOpClassStmt opfamilyname + * @property {string|null} [amname] CreateOpClassStmt amname + * @property {pg_query.ITypeName|null} [datatype] CreateOpClassStmt datatype + * @property {Array.|null} [items] CreateOpClassStmt items + * @property {boolean|null} [isDefault] CreateOpClassStmt isDefault + */ + + /** + * Constructs a new CreateOpClassStmt. + * @memberof pg_query + * @classdesc Represents a CreateOpClassStmt. + * @implements ICreateOpClassStmt + * @constructor + * @param {pg_query.ICreateOpClassStmt=} [properties] Properties to set + */ + function CreateOpClassStmt(properties) { + this.opclassname = []; + this.opfamilyname = []; + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateOpClassStmt opclassname. + * @member {Array.} opclassname + * @memberof pg_query.CreateOpClassStmt + * @instance + */ + CreateOpClassStmt.prototype.opclassname = $util.emptyArray; + + /** + * CreateOpClassStmt opfamilyname. + * @member {Array.} opfamilyname + * @memberof pg_query.CreateOpClassStmt + * @instance + */ + CreateOpClassStmt.prototype.opfamilyname = $util.emptyArray; + + /** + * CreateOpClassStmt amname. + * @member {string} amname + * @memberof pg_query.CreateOpClassStmt + * @instance + */ + CreateOpClassStmt.prototype.amname = ""; + + /** + * CreateOpClassStmt datatype. + * @member {pg_query.ITypeName|null|undefined} datatype + * @memberof pg_query.CreateOpClassStmt + * @instance + */ + CreateOpClassStmt.prototype.datatype = null; + + /** + * CreateOpClassStmt items. + * @member {Array.} items + * @memberof pg_query.CreateOpClassStmt + * @instance + */ + CreateOpClassStmt.prototype.items = $util.emptyArray; + + /** + * CreateOpClassStmt isDefault. + * @member {boolean} isDefault + * @memberof pg_query.CreateOpClassStmt + * @instance + */ + CreateOpClassStmt.prototype.isDefault = false; + + /** + * Creates a new CreateOpClassStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateOpClassStmt + * @static + * @param {pg_query.ICreateOpClassStmt=} [properties] Properties to set + * @returns {pg_query.CreateOpClassStmt} CreateOpClassStmt instance + */ + CreateOpClassStmt.create = function create(properties) { + return new CreateOpClassStmt(properties); + }; + + /** + * Encodes the specified CreateOpClassStmt message. Does not implicitly {@link pg_query.CreateOpClassStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateOpClassStmt + * @static + * @param {pg_query.ICreateOpClassStmt} message CreateOpClassStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateOpClassStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.opclassname != null && message.opclassname.length) + for (var i = 0; i < message.opclassname.length; ++i) + $root.pg_query.Node.encode(message.opclassname[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.opfamilyname != null && message.opfamilyname.length) + for (var i = 0; i < message.opfamilyname.length; ++i) + $root.pg_query.Node.encode(message.opfamilyname[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.amname != null && Object.hasOwnProperty.call(message, "amname")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.amname); + if (message.datatype != null && Object.hasOwnProperty.call(message, "datatype")) + $root.pg_query.TypeName.encode(message.datatype, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.pg_query.Node.encode(message.items[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.isDefault != null && Object.hasOwnProperty.call(message, "isDefault")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isDefault); + return writer; + }; + + /** + * Encodes the specified CreateOpClassStmt message, length delimited. Does not implicitly {@link pg_query.CreateOpClassStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateOpClassStmt + * @static + * @param {pg_query.ICreateOpClassStmt} message CreateOpClassStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateOpClassStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateOpClassStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateOpClassStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateOpClassStmt} CreateOpClassStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateOpClassStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateOpClassStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.opclassname && message.opclassname.length)) + message.opclassname = []; + message.opclassname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.opfamilyname && message.opfamilyname.length)) + message.opfamilyname = []; + message.opfamilyname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.amname = reader.string(); + break; + } + case 4: { + message.datatype = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.isDefault = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateOpClassStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateOpClassStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateOpClassStmt} CreateOpClassStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateOpClassStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateOpClassStmt message. + * @function verify + * @memberof pg_query.CreateOpClassStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateOpClassStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.opclassname != null && message.hasOwnProperty("opclassname")) { + if (!Array.isArray(message.opclassname)) + return "opclassname: array expected"; + for (var i = 0; i < message.opclassname.length; ++i) { + var error = $root.pg_query.Node.verify(message.opclassname[i]); + if (error) + return "opclassname." + error; + } + } + if (message.opfamilyname != null && message.hasOwnProperty("opfamilyname")) { + if (!Array.isArray(message.opfamilyname)) + return "opfamilyname: array expected"; + for (var i = 0; i < message.opfamilyname.length; ++i) { + var error = $root.pg_query.Node.verify(message.opfamilyname[i]); + if (error) + return "opfamilyname." + error; + } + } + if (message.amname != null && message.hasOwnProperty("amname")) + if (!$util.isString(message.amname)) + return "amname: string expected"; + if (message.datatype != null && message.hasOwnProperty("datatype")) { + var error = $root.pg_query.TypeName.verify(message.datatype); + if (error) + return "datatype." + error; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.pg_query.Node.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.isDefault != null && message.hasOwnProperty("isDefault")) + if (typeof message.isDefault !== "boolean") + return "isDefault: boolean expected"; + return null; + }; + + /** + * Creates a CreateOpClassStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateOpClassStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateOpClassStmt} CreateOpClassStmt + */ + CreateOpClassStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateOpClassStmt) + return object; + var message = new $root.pg_query.CreateOpClassStmt(); + if (object.opclassname) { + if (!Array.isArray(object.opclassname)) + throw TypeError(".pg_query.CreateOpClassStmt.opclassname: array expected"); + message.opclassname = []; + for (var i = 0; i < object.opclassname.length; ++i) { + if (typeof object.opclassname[i] !== "object") + throw TypeError(".pg_query.CreateOpClassStmt.opclassname: object expected"); + message.opclassname[i] = $root.pg_query.Node.fromObject(object.opclassname[i]); + } + } + if (object.opfamilyname) { + if (!Array.isArray(object.opfamilyname)) + throw TypeError(".pg_query.CreateOpClassStmt.opfamilyname: array expected"); + message.opfamilyname = []; + for (var i = 0; i < object.opfamilyname.length; ++i) { + if (typeof object.opfamilyname[i] !== "object") + throw TypeError(".pg_query.CreateOpClassStmt.opfamilyname: object expected"); + message.opfamilyname[i] = $root.pg_query.Node.fromObject(object.opfamilyname[i]); + } + } + if (object.amname != null) + message.amname = String(object.amname); + if (object.datatype != null) { + if (typeof object.datatype !== "object") + throw TypeError(".pg_query.CreateOpClassStmt.datatype: object expected"); + message.datatype = $root.pg_query.TypeName.fromObject(object.datatype); + } + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".pg_query.CreateOpClassStmt.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".pg_query.CreateOpClassStmt.items: object expected"); + message.items[i] = $root.pg_query.Node.fromObject(object.items[i]); + } + } + if (object.isDefault != null) + message.isDefault = Boolean(object.isDefault); + return message; + }; + + /** + * Creates a plain object from a CreateOpClassStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateOpClassStmt + * @static + * @param {pg_query.CreateOpClassStmt} message CreateOpClassStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateOpClassStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.opclassname = []; + object.opfamilyname = []; + object.items = []; + } + if (options.defaults) { + object.amname = ""; + object.datatype = null; + object.isDefault = false; + } + if (message.opclassname && message.opclassname.length) { + object.opclassname = []; + for (var j = 0; j < message.opclassname.length; ++j) + object.opclassname[j] = $root.pg_query.Node.toObject(message.opclassname[j], options); + } + if (message.opfamilyname && message.opfamilyname.length) { + object.opfamilyname = []; + for (var j = 0; j < message.opfamilyname.length; ++j) + object.opfamilyname[j] = $root.pg_query.Node.toObject(message.opfamilyname[j], options); + } + if (message.amname != null && message.hasOwnProperty("amname")) + object.amname = message.amname; + if (message.datatype != null && message.hasOwnProperty("datatype")) + object.datatype = $root.pg_query.TypeName.toObject(message.datatype, options); + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.pg_query.Node.toObject(message.items[j], options); + } + if (message.isDefault != null && message.hasOwnProperty("isDefault")) + object.isDefault = message.isDefault; + return object; + }; + + /** + * Converts this CreateOpClassStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateOpClassStmt + * @instance + * @returns {Object.} JSON object + */ + CreateOpClassStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateOpClassStmt + * @function getTypeUrl + * @memberof pg_query.CreateOpClassStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateOpClassStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateOpClassStmt"; + }; + + return CreateOpClassStmt; + })(); + + pg_query.CreateOpFamilyStmt = (function() { + + /** + * Properties of a CreateOpFamilyStmt. + * @memberof pg_query + * @interface ICreateOpFamilyStmt + * @property {Array.|null} [opfamilyname] CreateOpFamilyStmt opfamilyname + * @property {string|null} [amname] CreateOpFamilyStmt amname + */ + + /** + * Constructs a new CreateOpFamilyStmt. + * @memberof pg_query + * @classdesc Represents a CreateOpFamilyStmt. + * @implements ICreateOpFamilyStmt + * @constructor + * @param {pg_query.ICreateOpFamilyStmt=} [properties] Properties to set + */ + function CreateOpFamilyStmt(properties) { + this.opfamilyname = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateOpFamilyStmt opfamilyname. + * @member {Array.} opfamilyname + * @memberof pg_query.CreateOpFamilyStmt + * @instance + */ + CreateOpFamilyStmt.prototype.opfamilyname = $util.emptyArray; + + /** + * CreateOpFamilyStmt amname. + * @member {string} amname + * @memberof pg_query.CreateOpFamilyStmt + * @instance + */ + CreateOpFamilyStmt.prototype.amname = ""; + + /** + * Creates a new CreateOpFamilyStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateOpFamilyStmt + * @static + * @param {pg_query.ICreateOpFamilyStmt=} [properties] Properties to set + * @returns {pg_query.CreateOpFamilyStmt} CreateOpFamilyStmt instance + */ + CreateOpFamilyStmt.create = function create(properties) { + return new CreateOpFamilyStmt(properties); + }; + + /** + * Encodes the specified CreateOpFamilyStmt message. Does not implicitly {@link pg_query.CreateOpFamilyStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateOpFamilyStmt + * @static + * @param {pg_query.ICreateOpFamilyStmt} message CreateOpFamilyStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateOpFamilyStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.opfamilyname != null && message.opfamilyname.length) + for (var i = 0; i < message.opfamilyname.length; ++i) + $root.pg_query.Node.encode(message.opfamilyname[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.amname != null && Object.hasOwnProperty.call(message, "amname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.amname); + return writer; + }; + + /** + * Encodes the specified CreateOpFamilyStmt message, length delimited. Does not implicitly {@link pg_query.CreateOpFamilyStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateOpFamilyStmt + * @static + * @param {pg_query.ICreateOpFamilyStmt} message CreateOpFamilyStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateOpFamilyStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateOpFamilyStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateOpFamilyStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateOpFamilyStmt} CreateOpFamilyStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateOpFamilyStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateOpFamilyStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.opfamilyname && message.opfamilyname.length)) + message.opfamilyname = []; + message.opfamilyname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.amname = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateOpFamilyStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateOpFamilyStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateOpFamilyStmt} CreateOpFamilyStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateOpFamilyStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateOpFamilyStmt message. + * @function verify + * @memberof pg_query.CreateOpFamilyStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateOpFamilyStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.opfamilyname != null && message.hasOwnProperty("opfamilyname")) { + if (!Array.isArray(message.opfamilyname)) + return "opfamilyname: array expected"; + for (var i = 0; i < message.opfamilyname.length; ++i) { + var error = $root.pg_query.Node.verify(message.opfamilyname[i]); + if (error) + return "opfamilyname." + error; + } + } + if (message.amname != null && message.hasOwnProperty("amname")) + if (!$util.isString(message.amname)) + return "amname: string expected"; + return null; + }; + + /** + * Creates a CreateOpFamilyStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateOpFamilyStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateOpFamilyStmt} CreateOpFamilyStmt + */ + CreateOpFamilyStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateOpFamilyStmt) + return object; + var message = new $root.pg_query.CreateOpFamilyStmt(); + if (object.opfamilyname) { + if (!Array.isArray(object.opfamilyname)) + throw TypeError(".pg_query.CreateOpFamilyStmt.opfamilyname: array expected"); + message.opfamilyname = []; + for (var i = 0; i < object.opfamilyname.length; ++i) { + if (typeof object.opfamilyname[i] !== "object") + throw TypeError(".pg_query.CreateOpFamilyStmt.opfamilyname: object expected"); + message.opfamilyname[i] = $root.pg_query.Node.fromObject(object.opfamilyname[i]); + } + } + if (object.amname != null) + message.amname = String(object.amname); + return message; + }; + + /** + * Creates a plain object from a CreateOpFamilyStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateOpFamilyStmt + * @static + * @param {pg_query.CreateOpFamilyStmt} message CreateOpFamilyStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateOpFamilyStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.opfamilyname = []; + if (options.defaults) + object.amname = ""; + if (message.opfamilyname && message.opfamilyname.length) { + object.opfamilyname = []; + for (var j = 0; j < message.opfamilyname.length; ++j) + object.opfamilyname[j] = $root.pg_query.Node.toObject(message.opfamilyname[j], options); + } + if (message.amname != null && message.hasOwnProperty("amname")) + object.amname = message.amname; + return object; + }; + + /** + * Converts this CreateOpFamilyStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateOpFamilyStmt + * @instance + * @returns {Object.} JSON object + */ + CreateOpFamilyStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateOpFamilyStmt + * @function getTypeUrl + * @memberof pg_query.CreateOpFamilyStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateOpFamilyStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateOpFamilyStmt"; + }; + + return CreateOpFamilyStmt; + })(); + + pg_query.AlterOpFamilyStmt = (function() { + + /** + * Properties of an AlterOpFamilyStmt. + * @memberof pg_query + * @interface IAlterOpFamilyStmt + * @property {Array.|null} [opfamilyname] AlterOpFamilyStmt opfamilyname + * @property {string|null} [amname] AlterOpFamilyStmt amname + * @property {boolean|null} [isDrop] AlterOpFamilyStmt isDrop + * @property {Array.|null} [items] AlterOpFamilyStmt items + */ + + /** + * Constructs a new AlterOpFamilyStmt. + * @memberof pg_query + * @classdesc Represents an AlterOpFamilyStmt. + * @implements IAlterOpFamilyStmt + * @constructor + * @param {pg_query.IAlterOpFamilyStmt=} [properties] Properties to set + */ + function AlterOpFamilyStmt(properties) { + this.opfamilyname = []; + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterOpFamilyStmt opfamilyname. + * @member {Array.} opfamilyname + * @memberof pg_query.AlterOpFamilyStmt + * @instance + */ + AlterOpFamilyStmt.prototype.opfamilyname = $util.emptyArray; + + /** + * AlterOpFamilyStmt amname. + * @member {string} amname + * @memberof pg_query.AlterOpFamilyStmt + * @instance + */ + AlterOpFamilyStmt.prototype.amname = ""; + + /** + * AlterOpFamilyStmt isDrop. + * @member {boolean} isDrop + * @memberof pg_query.AlterOpFamilyStmt + * @instance + */ + AlterOpFamilyStmt.prototype.isDrop = false; + + /** + * AlterOpFamilyStmt items. + * @member {Array.} items + * @memberof pg_query.AlterOpFamilyStmt + * @instance + */ + AlterOpFamilyStmt.prototype.items = $util.emptyArray; + + /** + * Creates a new AlterOpFamilyStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterOpFamilyStmt + * @static + * @param {pg_query.IAlterOpFamilyStmt=} [properties] Properties to set + * @returns {pg_query.AlterOpFamilyStmt} AlterOpFamilyStmt instance + */ + AlterOpFamilyStmt.create = function create(properties) { + return new AlterOpFamilyStmt(properties); + }; + + /** + * Encodes the specified AlterOpFamilyStmt message. Does not implicitly {@link pg_query.AlterOpFamilyStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterOpFamilyStmt + * @static + * @param {pg_query.IAlterOpFamilyStmt} message AlterOpFamilyStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterOpFamilyStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.opfamilyname != null && message.opfamilyname.length) + for (var i = 0; i < message.opfamilyname.length; ++i) + $root.pg_query.Node.encode(message.opfamilyname[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.amname != null && Object.hasOwnProperty.call(message, "amname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.amname); + if (message.isDrop != null && Object.hasOwnProperty.call(message, "isDrop")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isDrop); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.pg_query.Node.encode(message.items[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterOpFamilyStmt message, length delimited. Does not implicitly {@link pg_query.AlterOpFamilyStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterOpFamilyStmt + * @static + * @param {pg_query.IAlterOpFamilyStmt} message AlterOpFamilyStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterOpFamilyStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterOpFamilyStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterOpFamilyStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterOpFamilyStmt} AlterOpFamilyStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterOpFamilyStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterOpFamilyStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.opfamilyname && message.opfamilyname.length)) + message.opfamilyname = []; + message.opfamilyname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.amname = reader.string(); + break; + } + case 3: { + message.isDrop = reader.bool(); + break; + } + case 4: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterOpFamilyStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterOpFamilyStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterOpFamilyStmt} AlterOpFamilyStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterOpFamilyStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterOpFamilyStmt message. + * @function verify + * @memberof pg_query.AlterOpFamilyStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterOpFamilyStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.opfamilyname != null && message.hasOwnProperty("opfamilyname")) { + if (!Array.isArray(message.opfamilyname)) + return "opfamilyname: array expected"; + for (var i = 0; i < message.opfamilyname.length; ++i) { + var error = $root.pg_query.Node.verify(message.opfamilyname[i]); + if (error) + return "opfamilyname." + error; + } + } + if (message.amname != null && message.hasOwnProperty("amname")) + if (!$util.isString(message.amname)) + return "amname: string expected"; + if (message.isDrop != null && message.hasOwnProperty("isDrop")) + if (typeof message.isDrop !== "boolean") + return "isDrop: boolean expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.pg_query.Node.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates an AlterOpFamilyStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterOpFamilyStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterOpFamilyStmt} AlterOpFamilyStmt + */ + AlterOpFamilyStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterOpFamilyStmt) + return object; + var message = new $root.pg_query.AlterOpFamilyStmt(); + if (object.opfamilyname) { + if (!Array.isArray(object.opfamilyname)) + throw TypeError(".pg_query.AlterOpFamilyStmt.opfamilyname: array expected"); + message.opfamilyname = []; + for (var i = 0; i < object.opfamilyname.length; ++i) { + if (typeof object.opfamilyname[i] !== "object") + throw TypeError(".pg_query.AlterOpFamilyStmt.opfamilyname: object expected"); + message.opfamilyname[i] = $root.pg_query.Node.fromObject(object.opfamilyname[i]); + } + } + if (object.amname != null) + message.amname = String(object.amname); + if (object.isDrop != null) + message.isDrop = Boolean(object.isDrop); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".pg_query.AlterOpFamilyStmt.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".pg_query.AlterOpFamilyStmt.items: object expected"); + message.items[i] = $root.pg_query.Node.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlterOpFamilyStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterOpFamilyStmt + * @static + * @param {pg_query.AlterOpFamilyStmt} message AlterOpFamilyStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterOpFamilyStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.opfamilyname = []; + object.items = []; + } + if (options.defaults) { + object.amname = ""; + object.isDrop = false; + } + if (message.opfamilyname && message.opfamilyname.length) { + object.opfamilyname = []; + for (var j = 0; j < message.opfamilyname.length; ++j) + object.opfamilyname[j] = $root.pg_query.Node.toObject(message.opfamilyname[j], options); + } + if (message.amname != null && message.hasOwnProperty("amname")) + object.amname = message.amname; + if (message.isDrop != null && message.hasOwnProperty("isDrop")) + object.isDrop = message.isDrop; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.pg_query.Node.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this AlterOpFamilyStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterOpFamilyStmt + * @instance + * @returns {Object.} JSON object + */ + AlterOpFamilyStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterOpFamilyStmt + * @function getTypeUrl + * @memberof pg_query.AlterOpFamilyStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterOpFamilyStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterOpFamilyStmt"; + }; + + return AlterOpFamilyStmt; + })(); + + pg_query.PrepareStmt = (function() { + + /** + * Properties of a PrepareStmt. + * @memberof pg_query + * @interface IPrepareStmt + * @property {string|null} [name] PrepareStmt name + * @property {Array.|null} [argtypes] PrepareStmt argtypes + * @property {pg_query.INode|null} [query] PrepareStmt query + */ + + /** + * Constructs a new PrepareStmt. + * @memberof pg_query + * @classdesc Represents a PrepareStmt. + * @implements IPrepareStmt + * @constructor + * @param {pg_query.IPrepareStmt=} [properties] Properties to set + */ + function PrepareStmt(properties) { + this.argtypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrepareStmt name. + * @member {string} name + * @memberof pg_query.PrepareStmt + * @instance + */ + PrepareStmt.prototype.name = ""; + + /** + * PrepareStmt argtypes. + * @member {Array.} argtypes + * @memberof pg_query.PrepareStmt + * @instance + */ + PrepareStmt.prototype.argtypes = $util.emptyArray; + + /** + * PrepareStmt query. + * @member {pg_query.INode|null|undefined} query + * @memberof pg_query.PrepareStmt + * @instance + */ + PrepareStmt.prototype.query = null; + + /** + * Creates a new PrepareStmt instance using the specified properties. + * @function create + * @memberof pg_query.PrepareStmt + * @static + * @param {pg_query.IPrepareStmt=} [properties] Properties to set + * @returns {pg_query.PrepareStmt} PrepareStmt instance + */ + PrepareStmt.create = function create(properties) { + return new PrepareStmt(properties); + }; + + /** + * Encodes the specified PrepareStmt message. Does not implicitly {@link pg_query.PrepareStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.PrepareStmt + * @static + * @param {pg_query.IPrepareStmt} message PrepareStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.argtypes != null && message.argtypes.length) + for (var i = 0; i < message.argtypes.length; ++i) + $root.pg_query.Node.encode(message.argtypes[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.pg_query.Node.encode(message.query, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrepareStmt message, length delimited. Does not implicitly {@link pg_query.PrepareStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.PrepareStmt + * @static + * @param {pg_query.IPrepareStmt} message PrepareStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrepareStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.PrepareStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.PrepareStmt} PrepareStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.PrepareStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.argtypes && message.argtypes.length)) + message.argtypes = []; + message.argtypes.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.query = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrepareStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.PrepareStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.PrepareStmt} PrepareStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrepareStmt message. + * @function verify + * @memberof pg_query.PrepareStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrepareStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.argtypes != null && message.hasOwnProperty("argtypes")) { + if (!Array.isArray(message.argtypes)) + return "argtypes: array expected"; + for (var i = 0; i < message.argtypes.length; ++i) { + var error = $root.pg_query.Node.verify(message.argtypes[i]); + if (error) + return "argtypes." + error; + } + } + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.pg_query.Node.verify(message.query); + if (error) + return "query." + error; + } + return null; + }; + + /** + * Creates a PrepareStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.PrepareStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.PrepareStmt} PrepareStmt + */ + PrepareStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.PrepareStmt) + return object; + var message = new $root.pg_query.PrepareStmt(); + if (object.name != null) + message.name = String(object.name); + if (object.argtypes) { + if (!Array.isArray(object.argtypes)) + throw TypeError(".pg_query.PrepareStmt.argtypes: array expected"); + message.argtypes = []; + for (var i = 0; i < object.argtypes.length; ++i) { + if (typeof object.argtypes[i] !== "object") + throw TypeError(".pg_query.PrepareStmt.argtypes: object expected"); + message.argtypes[i] = $root.pg_query.Node.fromObject(object.argtypes[i]); + } + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".pg_query.PrepareStmt.query: object expected"); + message.query = $root.pg_query.Node.fromObject(object.query); + } + return message; + }; + + /** + * Creates a plain object from a PrepareStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.PrepareStmt + * @static + * @param {pg_query.PrepareStmt} message PrepareStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrepareStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.argtypes = []; + if (options.defaults) { + object.name = ""; + object.query = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.argtypes && message.argtypes.length) { + object.argtypes = []; + for (var j = 0; j < message.argtypes.length; ++j) + object.argtypes[j] = $root.pg_query.Node.toObject(message.argtypes[j], options); + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.pg_query.Node.toObject(message.query, options); + return object; + }; + + /** + * Converts this PrepareStmt to JSON. + * @function toJSON + * @memberof pg_query.PrepareStmt + * @instance + * @returns {Object.} JSON object + */ + PrepareStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrepareStmt + * @function getTypeUrl + * @memberof pg_query.PrepareStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrepareStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.PrepareStmt"; + }; + + return PrepareStmt; + })(); + + pg_query.ExecuteStmt = (function() { + + /** + * Properties of an ExecuteStmt. + * @memberof pg_query + * @interface IExecuteStmt + * @property {string|null} [name] ExecuteStmt name + * @property {Array.|null} [params] ExecuteStmt params + */ + + /** + * Constructs a new ExecuteStmt. + * @memberof pg_query + * @classdesc Represents an ExecuteStmt. + * @implements IExecuteStmt + * @constructor + * @param {pg_query.IExecuteStmt=} [properties] Properties to set + */ + function ExecuteStmt(properties) { + this.params = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecuteStmt name. + * @member {string} name + * @memberof pg_query.ExecuteStmt + * @instance + */ + ExecuteStmt.prototype.name = ""; + + /** + * ExecuteStmt params. + * @member {Array.} params + * @memberof pg_query.ExecuteStmt + * @instance + */ + ExecuteStmt.prototype.params = $util.emptyArray; + + /** + * Creates a new ExecuteStmt instance using the specified properties. + * @function create + * @memberof pg_query.ExecuteStmt + * @static + * @param {pg_query.IExecuteStmt=} [properties] Properties to set + * @returns {pg_query.ExecuteStmt} ExecuteStmt instance + */ + ExecuteStmt.create = function create(properties) { + return new ExecuteStmt(properties); + }; + + /** + * Encodes the specified ExecuteStmt message. Does not implicitly {@link pg_query.ExecuteStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.ExecuteStmt + * @static + * @param {pg_query.IExecuteStmt} message ExecuteStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.params != null && message.params.length) + for (var i = 0; i < message.params.length; ++i) + $root.pg_query.Node.encode(message.params[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecuteStmt message, length delimited. Does not implicitly {@link pg_query.ExecuteStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ExecuteStmt + * @static + * @param {pg_query.IExecuteStmt} message ExecuteStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecuteStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecuteStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ExecuteStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ExecuteStmt} ExecuteStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ExecuteStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.params && message.params.length)) + message.params = []; + message.params.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecuteStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ExecuteStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ExecuteStmt} ExecuteStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecuteStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecuteStmt message. + * @function verify + * @memberof pg_query.ExecuteStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecuteStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!Array.isArray(message.params)) + return "params: array expected"; + for (var i = 0; i < message.params.length; ++i) { + var error = $root.pg_query.Node.verify(message.params[i]); + if (error) + return "params." + error; + } + } + return null; + }; + + /** + * Creates an ExecuteStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ExecuteStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ExecuteStmt} ExecuteStmt + */ + ExecuteStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ExecuteStmt) + return object; + var message = new $root.pg_query.ExecuteStmt(); + if (object.name != null) + message.name = String(object.name); + if (object.params) { + if (!Array.isArray(object.params)) + throw TypeError(".pg_query.ExecuteStmt.params: array expected"); + message.params = []; + for (var i = 0; i < object.params.length; ++i) { + if (typeof object.params[i] !== "object") + throw TypeError(".pg_query.ExecuteStmt.params: object expected"); + message.params[i] = $root.pg_query.Node.fromObject(object.params[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExecuteStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ExecuteStmt + * @static + * @param {pg_query.ExecuteStmt} message ExecuteStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecuteStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.params = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.params && message.params.length) { + object.params = []; + for (var j = 0; j < message.params.length; ++j) + object.params[j] = $root.pg_query.Node.toObject(message.params[j], options); + } + return object; + }; + + /** + * Converts this ExecuteStmt to JSON. + * @function toJSON + * @memberof pg_query.ExecuteStmt + * @instance + * @returns {Object.} JSON object + */ + ExecuteStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecuteStmt + * @function getTypeUrl + * @memberof pg_query.ExecuteStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecuteStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ExecuteStmt"; + }; + + return ExecuteStmt; + })(); + + pg_query.DeallocateStmt = (function() { + + /** + * Properties of a DeallocateStmt. + * @memberof pg_query + * @interface IDeallocateStmt + * @property {string|null} [name] DeallocateStmt name + */ + + /** + * Constructs a new DeallocateStmt. + * @memberof pg_query + * @classdesc Represents a DeallocateStmt. + * @implements IDeallocateStmt + * @constructor + * @param {pg_query.IDeallocateStmt=} [properties] Properties to set + */ + function DeallocateStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeallocateStmt name. + * @member {string} name + * @memberof pg_query.DeallocateStmt + * @instance + */ + DeallocateStmt.prototype.name = ""; + + /** + * Creates a new DeallocateStmt instance using the specified properties. + * @function create + * @memberof pg_query.DeallocateStmt + * @static + * @param {pg_query.IDeallocateStmt=} [properties] Properties to set + * @returns {pg_query.DeallocateStmt} DeallocateStmt instance + */ + DeallocateStmt.create = function create(properties) { + return new DeallocateStmt(properties); + }; + + /** + * Encodes the specified DeallocateStmt message. Does not implicitly {@link pg_query.DeallocateStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DeallocateStmt + * @static + * @param {pg_query.IDeallocateStmt} message DeallocateStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeallocateStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeallocateStmt message, length delimited. Does not implicitly {@link pg_query.DeallocateStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DeallocateStmt + * @static + * @param {pg_query.IDeallocateStmt} message DeallocateStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeallocateStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeallocateStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DeallocateStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DeallocateStmt} DeallocateStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeallocateStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DeallocateStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeallocateStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DeallocateStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DeallocateStmt} DeallocateStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeallocateStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeallocateStmt message. + * @function verify + * @memberof pg_query.DeallocateStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeallocateStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeallocateStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DeallocateStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DeallocateStmt} DeallocateStmt + */ + DeallocateStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DeallocateStmt) + return object; + var message = new $root.pg_query.DeallocateStmt(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeallocateStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DeallocateStmt + * @static + * @param {pg_query.DeallocateStmt} message DeallocateStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeallocateStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeallocateStmt to JSON. + * @function toJSON + * @memberof pg_query.DeallocateStmt + * @instance + * @returns {Object.} JSON object + */ + DeallocateStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeallocateStmt + * @function getTypeUrl + * @memberof pg_query.DeallocateStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeallocateStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DeallocateStmt"; + }; + + return DeallocateStmt; + })(); + + pg_query.DeclareCursorStmt = (function() { + + /** + * Properties of a DeclareCursorStmt. + * @memberof pg_query + * @interface IDeclareCursorStmt + * @property {string|null} [portalname] DeclareCursorStmt portalname + * @property {number|null} [options] DeclareCursorStmt options + * @property {pg_query.INode|null} [query] DeclareCursorStmt query + */ + + /** + * Constructs a new DeclareCursorStmt. + * @memberof pg_query + * @classdesc Represents a DeclareCursorStmt. + * @implements IDeclareCursorStmt + * @constructor + * @param {pg_query.IDeclareCursorStmt=} [properties] Properties to set + */ + function DeclareCursorStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeclareCursorStmt portalname. + * @member {string} portalname + * @memberof pg_query.DeclareCursorStmt + * @instance + */ + DeclareCursorStmt.prototype.portalname = ""; + + /** + * DeclareCursorStmt options. + * @member {number} options + * @memberof pg_query.DeclareCursorStmt + * @instance + */ + DeclareCursorStmt.prototype.options = 0; + + /** + * DeclareCursorStmt query. + * @member {pg_query.INode|null|undefined} query + * @memberof pg_query.DeclareCursorStmt + * @instance + */ + DeclareCursorStmt.prototype.query = null; + + /** + * Creates a new DeclareCursorStmt instance using the specified properties. + * @function create + * @memberof pg_query.DeclareCursorStmt + * @static + * @param {pg_query.IDeclareCursorStmt=} [properties] Properties to set + * @returns {pg_query.DeclareCursorStmt} DeclareCursorStmt instance + */ + DeclareCursorStmt.create = function create(properties) { + return new DeclareCursorStmt(properties); + }; + + /** + * Encodes the specified DeclareCursorStmt message. Does not implicitly {@link pg_query.DeclareCursorStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DeclareCursorStmt + * @static + * @param {pg_query.IDeclareCursorStmt} message DeclareCursorStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeclareCursorStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.portalname != null && Object.hasOwnProperty.call(message, "portalname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.portalname); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.options); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.pg_query.Node.encode(message.query, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeclareCursorStmt message, length delimited. Does not implicitly {@link pg_query.DeclareCursorStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DeclareCursorStmt + * @static + * @param {pg_query.IDeclareCursorStmt} message DeclareCursorStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeclareCursorStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeclareCursorStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DeclareCursorStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DeclareCursorStmt} DeclareCursorStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeclareCursorStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DeclareCursorStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.portalname = reader.string(); + break; + } + case 2: { + message.options = reader.int32(); + break; + } + case 3: { + message.query = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeclareCursorStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DeclareCursorStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DeclareCursorStmt} DeclareCursorStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeclareCursorStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeclareCursorStmt message. + * @function verify + * @memberof pg_query.DeclareCursorStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeclareCursorStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.portalname != null && message.hasOwnProperty("portalname")) + if (!$util.isString(message.portalname)) + return "portalname: string expected"; + if (message.options != null && message.hasOwnProperty("options")) + if (!$util.isInteger(message.options)) + return "options: integer expected"; + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.pg_query.Node.verify(message.query); + if (error) + return "query." + error; + } + return null; + }; + + /** + * Creates a DeclareCursorStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DeclareCursorStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DeclareCursorStmt} DeclareCursorStmt + */ + DeclareCursorStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DeclareCursorStmt) + return object; + var message = new $root.pg_query.DeclareCursorStmt(); + if (object.portalname != null) + message.portalname = String(object.portalname); + if (object.options != null) + message.options = object.options | 0; + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".pg_query.DeclareCursorStmt.query: object expected"); + message.query = $root.pg_query.Node.fromObject(object.query); + } + return message; + }; + + /** + * Creates a plain object from a DeclareCursorStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DeclareCursorStmt + * @static + * @param {pg_query.DeclareCursorStmt} message DeclareCursorStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeclareCursorStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.portalname = ""; + object.options = 0; + object.query = null; + } + if (message.portalname != null && message.hasOwnProperty("portalname")) + object.portalname = message.portalname; + if (message.options != null && message.hasOwnProperty("options")) + object.options = message.options; + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.pg_query.Node.toObject(message.query, options); + return object; + }; + + /** + * Converts this DeclareCursorStmt to JSON. + * @function toJSON + * @memberof pg_query.DeclareCursorStmt + * @instance + * @returns {Object.} JSON object + */ + DeclareCursorStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeclareCursorStmt + * @function getTypeUrl + * @memberof pg_query.DeclareCursorStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeclareCursorStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DeclareCursorStmt"; + }; + + return DeclareCursorStmt; + })(); + + pg_query.CreateTableSpaceStmt = (function() { + + /** + * Properties of a CreateTableSpaceStmt. + * @memberof pg_query + * @interface ICreateTableSpaceStmt + * @property {string|null} [tablespacename] CreateTableSpaceStmt tablespacename + * @property {pg_query.IRoleSpec|null} [owner] CreateTableSpaceStmt owner + * @property {string|null} [location] CreateTableSpaceStmt location + * @property {Array.|null} [options] CreateTableSpaceStmt options + */ + + /** + * Constructs a new CreateTableSpaceStmt. + * @memberof pg_query + * @classdesc Represents a CreateTableSpaceStmt. + * @implements ICreateTableSpaceStmt + * @constructor + * @param {pg_query.ICreateTableSpaceStmt=} [properties] Properties to set + */ + function CreateTableSpaceStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTableSpaceStmt tablespacename. + * @member {string} tablespacename + * @memberof pg_query.CreateTableSpaceStmt + * @instance + */ + CreateTableSpaceStmt.prototype.tablespacename = ""; + + /** + * CreateTableSpaceStmt owner. + * @member {pg_query.IRoleSpec|null|undefined} owner + * @memberof pg_query.CreateTableSpaceStmt + * @instance + */ + CreateTableSpaceStmt.prototype.owner = null; + + /** + * CreateTableSpaceStmt location. + * @member {string} location + * @memberof pg_query.CreateTableSpaceStmt + * @instance + */ + CreateTableSpaceStmt.prototype.location = ""; + + /** + * CreateTableSpaceStmt options. + * @member {Array.} options + * @memberof pg_query.CreateTableSpaceStmt + * @instance + */ + CreateTableSpaceStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new CreateTableSpaceStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateTableSpaceStmt + * @static + * @param {pg_query.ICreateTableSpaceStmt=} [properties] Properties to set + * @returns {pg_query.CreateTableSpaceStmt} CreateTableSpaceStmt instance + */ + CreateTableSpaceStmt.create = function create(properties) { + return new CreateTableSpaceStmt(properties); + }; + + /** + * Encodes the specified CreateTableSpaceStmt message. Does not implicitly {@link pg_query.CreateTableSpaceStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateTableSpaceStmt + * @static + * @param {pg_query.ICreateTableSpaceStmt} message CreateTableSpaceStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableSpaceStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tablespacename != null && Object.hasOwnProperty.call(message, "tablespacename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tablespacename); + if (message.owner != null && Object.hasOwnProperty.call(message, "owner")) + $root.pg_query.RoleSpec.encode(message.owner, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTableSpaceStmt message, length delimited. Does not implicitly {@link pg_query.CreateTableSpaceStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateTableSpaceStmt + * @static + * @param {pg_query.ICreateTableSpaceStmt} message CreateTableSpaceStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTableSpaceStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTableSpaceStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateTableSpaceStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateTableSpaceStmt} CreateTableSpaceStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableSpaceStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateTableSpaceStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tablespacename = reader.string(); + break; + } + case 2: { + message.owner = $root.pg_query.RoleSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + message.location = reader.string(); + break; + } + case 4: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTableSpaceStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateTableSpaceStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateTableSpaceStmt} CreateTableSpaceStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTableSpaceStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTableSpaceStmt message. + * @function verify + * @memberof pg_query.CreateTableSpaceStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTableSpaceStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tablespacename != null && message.hasOwnProperty("tablespacename")) + if (!$util.isString(message.tablespacename)) + return "tablespacename: string expected"; + if (message.owner != null && message.hasOwnProperty("owner")) { + var error = $root.pg_query.RoleSpec.verify(message.owner); + if (error) + return "owner." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates a CreateTableSpaceStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateTableSpaceStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateTableSpaceStmt} CreateTableSpaceStmt + */ + CreateTableSpaceStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateTableSpaceStmt) + return object; + var message = new $root.pg_query.CreateTableSpaceStmt(); + if (object.tablespacename != null) + message.tablespacename = String(object.tablespacename); + if (object.owner != null) { + if (typeof object.owner !== "object") + throw TypeError(".pg_query.CreateTableSpaceStmt.owner: object expected"); + message.owner = $root.pg_query.RoleSpec.fromObject(object.owner); + } + if (object.location != null) + message.location = String(object.location); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreateTableSpaceStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreateTableSpaceStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateTableSpaceStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateTableSpaceStmt + * @static + * @param {pg_query.CreateTableSpaceStmt} message CreateTableSpaceStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTableSpaceStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.tablespacename = ""; + object.owner = null; + object.location = ""; + } + if (message.tablespacename != null && message.hasOwnProperty("tablespacename")) + object.tablespacename = message.tablespacename; + if (message.owner != null && message.hasOwnProperty("owner")) + object.owner = $root.pg_query.RoleSpec.toObject(message.owner, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this CreateTableSpaceStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateTableSpaceStmt + * @instance + * @returns {Object.} JSON object + */ + CreateTableSpaceStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTableSpaceStmt + * @function getTypeUrl + * @memberof pg_query.CreateTableSpaceStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTableSpaceStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateTableSpaceStmt"; + }; + + return CreateTableSpaceStmt; + })(); + + pg_query.DropTableSpaceStmt = (function() { + + /** + * Properties of a DropTableSpaceStmt. + * @memberof pg_query + * @interface IDropTableSpaceStmt + * @property {string|null} [tablespacename] DropTableSpaceStmt tablespacename + * @property {boolean|null} [missing_ok] DropTableSpaceStmt missing_ok + */ + + /** + * Constructs a new DropTableSpaceStmt. + * @memberof pg_query + * @classdesc Represents a DropTableSpaceStmt. + * @implements IDropTableSpaceStmt + * @constructor + * @param {pg_query.IDropTableSpaceStmt=} [properties] Properties to set + */ + function DropTableSpaceStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DropTableSpaceStmt tablespacename. + * @member {string} tablespacename + * @memberof pg_query.DropTableSpaceStmt + * @instance + */ + DropTableSpaceStmt.prototype.tablespacename = ""; + + /** + * DropTableSpaceStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.DropTableSpaceStmt + * @instance + */ + DropTableSpaceStmt.prototype.missing_ok = false; + + /** + * Creates a new DropTableSpaceStmt instance using the specified properties. + * @function create + * @memberof pg_query.DropTableSpaceStmt + * @static + * @param {pg_query.IDropTableSpaceStmt=} [properties] Properties to set + * @returns {pg_query.DropTableSpaceStmt} DropTableSpaceStmt instance + */ + DropTableSpaceStmt.create = function create(properties) { + return new DropTableSpaceStmt(properties); + }; + + /** + * Encodes the specified DropTableSpaceStmt message. Does not implicitly {@link pg_query.DropTableSpaceStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DropTableSpaceStmt + * @static + * @param {pg_query.IDropTableSpaceStmt} message DropTableSpaceStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropTableSpaceStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tablespacename != null && Object.hasOwnProperty.call(message, "tablespacename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tablespacename); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.missing_ok); + return writer; + }; + + /** + * Encodes the specified DropTableSpaceStmt message, length delimited. Does not implicitly {@link pg_query.DropTableSpaceStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DropTableSpaceStmt + * @static + * @param {pg_query.IDropTableSpaceStmt} message DropTableSpaceStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropTableSpaceStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DropTableSpaceStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DropTableSpaceStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DropTableSpaceStmt} DropTableSpaceStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropTableSpaceStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DropTableSpaceStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tablespacename = reader.string(); + break; + } + case 2: { + message.missing_ok = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DropTableSpaceStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DropTableSpaceStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DropTableSpaceStmt} DropTableSpaceStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropTableSpaceStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DropTableSpaceStmt message. + * @function verify + * @memberof pg_query.DropTableSpaceStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DropTableSpaceStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tablespacename != null && message.hasOwnProperty("tablespacename")) + if (!$util.isString(message.tablespacename)) + return "tablespacename: string expected"; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + return null; + }; + + /** + * Creates a DropTableSpaceStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DropTableSpaceStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DropTableSpaceStmt} DropTableSpaceStmt + */ + DropTableSpaceStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DropTableSpaceStmt) + return object; + var message = new $root.pg_query.DropTableSpaceStmt(); + if (object.tablespacename != null) + message.tablespacename = String(object.tablespacename); + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + return message; + }; + + /** + * Creates a plain object from a DropTableSpaceStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DropTableSpaceStmt + * @static + * @param {pg_query.DropTableSpaceStmt} message DropTableSpaceStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DropTableSpaceStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tablespacename = ""; + object.missing_ok = false; + } + if (message.tablespacename != null && message.hasOwnProperty("tablespacename")) + object.tablespacename = message.tablespacename; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + return object; + }; + + /** + * Converts this DropTableSpaceStmt to JSON. + * @function toJSON + * @memberof pg_query.DropTableSpaceStmt + * @instance + * @returns {Object.} JSON object + */ + DropTableSpaceStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DropTableSpaceStmt + * @function getTypeUrl + * @memberof pg_query.DropTableSpaceStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DropTableSpaceStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DropTableSpaceStmt"; + }; + + return DropTableSpaceStmt; + })(); + + pg_query.AlterObjectDependsStmt = (function() { + + /** + * Properties of an AlterObjectDependsStmt. + * @memberof pg_query + * @interface IAlterObjectDependsStmt + * @property {pg_query.ObjectType|null} [objectType] AlterObjectDependsStmt objectType + * @property {pg_query.IRangeVar|null} [relation] AlterObjectDependsStmt relation + * @property {pg_query.INode|null} [object] AlterObjectDependsStmt object + * @property {pg_query.INode|null} [extname] AlterObjectDependsStmt extname + * @property {boolean|null} [remove] AlterObjectDependsStmt remove + */ + + /** + * Constructs a new AlterObjectDependsStmt. + * @memberof pg_query + * @classdesc Represents an AlterObjectDependsStmt. + * @implements IAlterObjectDependsStmt + * @constructor + * @param {pg_query.IAlterObjectDependsStmt=} [properties] Properties to set + */ + function AlterObjectDependsStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterObjectDependsStmt objectType. + * @member {pg_query.ObjectType} objectType + * @memberof pg_query.AlterObjectDependsStmt + * @instance + */ + AlterObjectDependsStmt.prototype.objectType = 0; + + /** + * AlterObjectDependsStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.AlterObjectDependsStmt + * @instance + */ + AlterObjectDependsStmt.prototype.relation = null; + + /** + * AlterObjectDependsStmt object. + * @member {pg_query.INode|null|undefined} object + * @memberof pg_query.AlterObjectDependsStmt + * @instance + */ + AlterObjectDependsStmt.prototype.object = null; + + /** + * AlterObjectDependsStmt extname. + * @member {pg_query.INode|null|undefined} extname + * @memberof pg_query.AlterObjectDependsStmt + * @instance + */ + AlterObjectDependsStmt.prototype.extname = null; + + /** + * AlterObjectDependsStmt remove. + * @member {boolean} remove + * @memberof pg_query.AlterObjectDependsStmt + * @instance + */ + AlterObjectDependsStmt.prototype.remove = false; + + /** + * Creates a new AlterObjectDependsStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterObjectDependsStmt + * @static + * @param {pg_query.IAlterObjectDependsStmt=} [properties] Properties to set + * @returns {pg_query.AlterObjectDependsStmt} AlterObjectDependsStmt instance + */ + AlterObjectDependsStmt.create = function create(properties) { + return new AlterObjectDependsStmt(properties); + }; + + /** + * Encodes the specified AlterObjectDependsStmt message. Does not implicitly {@link pg_query.AlterObjectDependsStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterObjectDependsStmt + * @static + * @param {pg_query.IAlterObjectDependsStmt} message AlterObjectDependsStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterObjectDependsStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objectType != null && Object.hasOwnProperty.call(message, "objectType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.objectType); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + $root.pg_query.Node.encode(message.object, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.extname != null && Object.hasOwnProperty.call(message, "extname")) + $root.pg_query.Node.encode(message.extname, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.remove != null && Object.hasOwnProperty.call(message, "remove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.remove); + return writer; + }; + + /** + * Encodes the specified AlterObjectDependsStmt message, length delimited. Does not implicitly {@link pg_query.AlterObjectDependsStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterObjectDependsStmt + * @static + * @param {pg_query.IAlterObjectDependsStmt} message AlterObjectDependsStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterObjectDependsStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterObjectDependsStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterObjectDependsStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterObjectDependsStmt} AlterObjectDependsStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterObjectDependsStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterObjectDependsStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.objectType = reader.int32(); + break; + } + case 2: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 3: { + message.object = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.extname = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + message.remove = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterObjectDependsStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterObjectDependsStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterObjectDependsStmt} AlterObjectDependsStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterObjectDependsStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterObjectDependsStmt message. + * @function verify + * @memberof pg_query.AlterObjectDependsStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterObjectDependsStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objectType != null && message.hasOwnProperty("objectType")) + switch (message.objectType) { + default: + return "objectType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.object != null && message.hasOwnProperty("object")) { + var error = $root.pg_query.Node.verify(message.object); + if (error) + return "object." + error; + } + if (message.extname != null && message.hasOwnProperty("extname")) { + var error = $root.pg_query.Node.verify(message.extname); + if (error) + return "extname." + error; + } + if (message.remove != null && message.hasOwnProperty("remove")) + if (typeof message.remove !== "boolean") + return "remove: boolean expected"; + return null; + }; + + /** + * Creates an AlterObjectDependsStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterObjectDependsStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterObjectDependsStmt} AlterObjectDependsStmt + */ + AlterObjectDependsStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterObjectDependsStmt) + return object; + var message = new $root.pg_query.AlterObjectDependsStmt(); + switch (object.objectType) { + default: + if (typeof object.objectType === "number") { + message.objectType = object.objectType; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.objectType = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.objectType = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.objectType = 2; + break; + case "OBJECT_AMOP": + case 3: + message.objectType = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.objectType = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.objectType = 5; + break; + case "OBJECT_CAST": + case 6: + message.objectType = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.objectType = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.objectType = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.objectType = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.objectType = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.objectType = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.objectType = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.objectType = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.objectType = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.objectType = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.objectType = 16; + break; + case "OBJECT_FDW": + case 17: + message.objectType = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.objectType = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.objectType = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.objectType = 20; + break; + case "OBJECT_INDEX": + case 21: + message.objectType = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.objectType = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.objectType = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.objectType = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.objectType = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.objectType = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.objectType = 27; + break; + case "OBJECT_POLICY": + case 28: + message.objectType = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.objectType = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.objectType = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.objectType = 31; + break; + case "OBJECT_ROLE": + case 32: + message.objectType = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.objectType = 33; + break; + case "OBJECT_RULE": + case 34: + message.objectType = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.objectType = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.objectType = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.objectType = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.objectType = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.objectType = 39; + break; + case "OBJECT_TABLE": + case 40: + message.objectType = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.objectType = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.objectType = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.objectType = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.objectType = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.objectType = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.objectType = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.objectType = 47; + break; + case "OBJECT_TYPE": + case 48: + message.objectType = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.objectType = 49; + break; + case "OBJECT_VIEW": + case 50: + message.objectType = 50; + break; + } + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.AlterObjectDependsStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.object != null) { + if (typeof object.object !== "object") + throw TypeError(".pg_query.AlterObjectDependsStmt.object: object expected"); + message.object = $root.pg_query.Node.fromObject(object.object); + } + if (object.extname != null) { + if (typeof object.extname !== "object") + throw TypeError(".pg_query.AlterObjectDependsStmt.extname: object expected"); + message.extname = $root.pg_query.Node.fromObject(object.extname); + } + if (object.remove != null) + message.remove = Boolean(object.remove); + return message; + }; + + /** + * Creates a plain object from an AlterObjectDependsStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterObjectDependsStmt + * @static + * @param {pg_query.AlterObjectDependsStmt} message AlterObjectDependsStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterObjectDependsStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.objectType = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.relation = null; + object.object = null; + object.extname = null; + object.remove = false; + } + if (message.objectType != null && message.hasOwnProperty("objectType")) + object.objectType = options.enums === String ? $root.pg_query.ObjectType[message.objectType] === undefined ? message.objectType : $root.pg_query.ObjectType[message.objectType] : message.objectType; + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.object != null && message.hasOwnProperty("object")) + object.object = $root.pg_query.Node.toObject(message.object, options); + if (message.extname != null && message.hasOwnProperty("extname")) + object.extname = $root.pg_query.Node.toObject(message.extname, options); + if (message.remove != null && message.hasOwnProperty("remove")) + object.remove = message.remove; + return object; + }; + + /** + * Converts this AlterObjectDependsStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterObjectDependsStmt + * @instance + * @returns {Object.} JSON object + */ + AlterObjectDependsStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterObjectDependsStmt + * @function getTypeUrl + * @memberof pg_query.AlterObjectDependsStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterObjectDependsStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterObjectDependsStmt"; + }; + + return AlterObjectDependsStmt; + })(); + + pg_query.AlterObjectSchemaStmt = (function() { + + /** + * Properties of an AlterObjectSchemaStmt. + * @memberof pg_query + * @interface IAlterObjectSchemaStmt + * @property {pg_query.ObjectType|null} [objectType] AlterObjectSchemaStmt objectType + * @property {pg_query.IRangeVar|null} [relation] AlterObjectSchemaStmt relation + * @property {pg_query.INode|null} [object] AlterObjectSchemaStmt object + * @property {string|null} [newschema] AlterObjectSchemaStmt newschema + * @property {boolean|null} [missing_ok] AlterObjectSchemaStmt missing_ok + */ + + /** + * Constructs a new AlterObjectSchemaStmt. + * @memberof pg_query + * @classdesc Represents an AlterObjectSchemaStmt. + * @implements IAlterObjectSchemaStmt + * @constructor + * @param {pg_query.IAlterObjectSchemaStmt=} [properties] Properties to set + */ + function AlterObjectSchemaStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterObjectSchemaStmt objectType. + * @member {pg_query.ObjectType} objectType + * @memberof pg_query.AlterObjectSchemaStmt + * @instance + */ + AlterObjectSchemaStmt.prototype.objectType = 0; + + /** + * AlterObjectSchemaStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.AlterObjectSchemaStmt + * @instance + */ + AlterObjectSchemaStmt.prototype.relation = null; + + /** + * AlterObjectSchemaStmt object. + * @member {pg_query.INode|null|undefined} object + * @memberof pg_query.AlterObjectSchemaStmt + * @instance + */ + AlterObjectSchemaStmt.prototype.object = null; + + /** + * AlterObjectSchemaStmt newschema. + * @member {string} newschema + * @memberof pg_query.AlterObjectSchemaStmt + * @instance + */ + AlterObjectSchemaStmt.prototype.newschema = ""; + + /** + * AlterObjectSchemaStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.AlterObjectSchemaStmt + * @instance + */ + AlterObjectSchemaStmt.prototype.missing_ok = false; + + /** + * Creates a new AlterObjectSchemaStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterObjectSchemaStmt + * @static + * @param {pg_query.IAlterObjectSchemaStmt=} [properties] Properties to set + * @returns {pg_query.AlterObjectSchemaStmt} AlterObjectSchemaStmt instance + */ + AlterObjectSchemaStmt.create = function create(properties) { + return new AlterObjectSchemaStmt(properties); + }; + + /** + * Encodes the specified AlterObjectSchemaStmt message. Does not implicitly {@link pg_query.AlterObjectSchemaStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterObjectSchemaStmt + * @static + * @param {pg_query.IAlterObjectSchemaStmt} message AlterObjectSchemaStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterObjectSchemaStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objectType != null && Object.hasOwnProperty.call(message, "objectType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.objectType); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + $root.pg_query.Node.encode(message.object, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.newschema != null && Object.hasOwnProperty.call(message, "newschema")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.newschema); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.missing_ok); + return writer; + }; + + /** + * Encodes the specified AlterObjectSchemaStmt message, length delimited. Does not implicitly {@link pg_query.AlterObjectSchemaStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterObjectSchemaStmt + * @static + * @param {pg_query.IAlterObjectSchemaStmt} message AlterObjectSchemaStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterObjectSchemaStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterObjectSchemaStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterObjectSchemaStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterObjectSchemaStmt} AlterObjectSchemaStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterObjectSchemaStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterObjectSchemaStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.objectType = reader.int32(); + break; + } + case 2: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 3: { + message.object = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.newschema = reader.string(); + break; + } + case 5: { + message.missing_ok = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterObjectSchemaStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterObjectSchemaStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterObjectSchemaStmt} AlterObjectSchemaStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterObjectSchemaStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterObjectSchemaStmt message. + * @function verify + * @memberof pg_query.AlterObjectSchemaStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterObjectSchemaStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objectType != null && message.hasOwnProperty("objectType")) + switch (message.objectType) { + default: + return "objectType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.object != null && message.hasOwnProperty("object")) { + var error = $root.pg_query.Node.verify(message.object); + if (error) + return "object." + error; + } + if (message.newschema != null && message.hasOwnProperty("newschema")) + if (!$util.isString(message.newschema)) + return "newschema: string expected"; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + return null; + }; + + /** + * Creates an AlterObjectSchemaStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterObjectSchemaStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterObjectSchemaStmt} AlterObjectSchemaStmt + */ + AlterObjectSchemaStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterObjectSchemaStmt) + return object; + var message = new $root.pg_query.AlterObjectSchemaStmt(); + switch (object.objectType) { + default: + if (typeof object.objectType === "number") { + message.objectType = object.objectType; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.objectType = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.objectType = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.objectType = 2; + break; + case "OBJECT_AMOP": + case 3: + message.objectType = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.objectType = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.objectType = 5; + break; + case "OBJECT_CAST": + case 6: + message.objectType = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.objectType = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.objectType = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.objectType = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.objectType = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.objectType = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.objectType = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.objectType = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.objectType = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.objectType = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.objectType = 16; + break; + case "OBJECT_FDW": + case 17: + message.objectType = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.objectType = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.objectType = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.objectType = 20; + break; + case "OBJECT_INDEX": + case 21: + message.objectType = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.objectType = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.objectType = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.objectType = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.objectType = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.objectType = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.objectType = 27; + break; + case "OBJECT_POLICY": + case 28: + message.objectType = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.objectType = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.objectType = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.objectType = 31; + break; + case "OBJECT_ROLE": + case 32: + message.objectType = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.objectType = 33; + break; + case "OBJECT_RULE": + case 34: + message.objectType = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.objectType = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.objectType = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.objectType = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.objectType = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.objectType = 39; + break; + case "OBJECT_TABLE": + case 40: + message.objectType = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.objectType = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.objectType = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.objectType = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.objectType = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.objectType = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.objectType = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.objectType = 47; + break; + case "OBJECT_TYPE": + case 48: + message.objectType = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.objectType = 49; + break; + case "OBJECT_VIEW": + case 50: + message.objectType = 50; + break; + } + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.AlterObjectSchemaStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.object != null) { + if (typeof object.object !== "object") + throw TypeError(".pg_query.AlterObjectSchemaStmt.object: object expected"); + message.object = $root.pg_query.Node.fromObject(object.object); + } + if (object.newschema != null) + message.newschema = String(object.newschema); + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + return message; + }; + + /** + * Creates a plain object from an AlterObjectSchemaStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterObjectSchemaStmt + * @static + * @param {pg_query.AlterObjectSchemaStmt} message AlterObjectSchemaStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterObjectSchemaStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.objectType = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.relation = null; + object.object = null; + object.newschema = ""; + object.missing_ok = false; + } + if (message.objectType != null && message.hasOwnProperty("objectType")) + object.objectType = options.enums === String ? $root.pg_query.ObjectType[message.objectType] === undefined ? message.objectType : $root.pg_query.ObjectType[message.objectType] : message.objectType; + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.object != null && message.hasOwnProperty("object")) + object.object = $root.pg_query.Node.toObject(message.object, options); + if (message.newschema != null && message.hasOwnProperty("newschema")) + object.newschema = message.newschema; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + return object; + }; + + /** + * Converts this AlterObjectSchemaStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterObjectSchemaStmt + * @instance + * @returns {Object.} JSON object + */ + AlterObjectSchemaStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterObjectSchemaStmt + * @function getTypeUrl + * @memberof pg_query.AlterObjectSchemaStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterObjectSchemaStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterObjectSchemaStmt"; + }; + + return AlterObjectSchemaStmt; + })(); + + pg_query.AlterOwnerStmt = (function() { + + /** + * Properties of an AlterOwnerStmt. + * @memberof pg_query + * @interface IAlterOwnerStmt + * @property {pg_query.ObjectType|null} [objectType] AlterOwnerStmt objectType + * @property {pg_query.IRangeVar|null} [relation] AlterOwnerStmt relation + * @property {pg_query.INode|null} [object] AlterOwnerStmt object + * @property {pg_query.IRoleSpec|null} [newowner] AlterOwnerStmt newowner + */ + + /** + * Constructs a new AlterOwnerStmt. + * @memberof pg_query + * @classdesc Represents an AlterOwnerStmt. + * @implements IAlterOwnerStmt + * @constructor + * @param {pg_query.IAlterOwnerStmt=} [properties] Properties to set + */ + function AlterOwnerStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterOwnerStmt objectType. + * @member {pg_query.ObjectType} objectType + * @memberof pg_query.AlterOwnerStmt + * @instance + */ + AlterOwnerStmt.prototype.objectType = 0; + + /** + * AlterOwnerStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.AlterOwnerStmt + * @instance + */ + AlterOwnerStmt.prototype.relation = null; + + /** + * AlterOwnerStmt object. + * @member {pg_query.INode|null|undefined} object + * @memberof pg_query.AlterOwnerStmt + * @instance + */ + AlterOwnerStmt.prototype.object = null; + + /** + * AlterOwnerStmt newowner. + * @member {pg_query.IRoleSpec|null|undefined} newowner + * @memberof pg_query.AlterOwnerStmt + * @instance + */ + AlterOwnerStmt.prototype.newowner = null; + + /** + * Creates a new AlterOwnerStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterOwnerStmt + * @static + * @param {pg_query.IAlterOwnerStmt=} [properties] Properties to set + * @returns {pg_query.AlterOwnerStmt} AlterOwnerStmt instance + */ + AlterOwnerStmt.create = function create(properties) { + return new AlterOwnerStmt(properties); + }; + + /** + * Encodes the specified AlterOwnerStmt message. Does not implicitly {@link pg_query.AlterOwnerStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterOwnerStmt + * @static + * @param {pg_query.IAlterOwnerStmt} message AlterOwnerStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterOwnerStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objectType != null && Object.hasOwnProperty.call(message, "objectType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.objectType); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + $root.pg_query.Node.encode(message.object, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.newowner != null && Object.hasOwnProperty.call(message, "newowner")) + $root.pg_query.RoleSpec.encode(message.newowner, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterOwnerStmt message, length delimited. Does not implicitly {@link pg_query.AlterOwnerStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterOwnerStmt + * @static + * @param {pg_query.IAlterOwnerStmt} message AlterOwnerStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterOwnerStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterOwnerStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterOwnerStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterOwnerStmt} AlterOwnerStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterOwnerStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterOwnerStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.objectType = reader.int32(); + break; + } + case 2: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 3: { + message.object = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.newowner = $root.pg_query.RoleSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterOwnerStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterOwnerStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterOwnerStmt} AlterOwnerStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterOwnerStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterOwnerStmt message. + * @function verify + * @memberof pg_query.AlterOwnerStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterOwnerStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objectType != null && message.hasOwnProperty("objectType")) + switch (message.objectType) { + default: + return "objectType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.object != null && message.hasOwnProperty("object")) { + var error = $root.pg_query.Node.verify(message.object); + if (error) + return "object." + error; + } + if (message.newowner != null && message.hasOwnProperty("newowner")) { + var error = $root.pg_query.RoleSpec.verify(message.newowner); + if (error) + return "newowner." + error; + } + return null; + }; + + /** + * Creates an AlterOwnerStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterOwnerStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterOwnerStmt} AlterOwnerStmt + */ + AlterOwnerStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterOwnerStmt) + return object; + var message = new $root.pg_query.AlterOwnerStmt(); + switch (object.objectType) { + default: + if (typeof object.objectType === "number") { + message.objectType = object.objectType; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.objectType = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.objectType = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.objectType = 2; + break; + case "OBJECT_AMOP": + case 3: + message.objectType = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.objectType = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.objectType = 5; + break; + case "OBJECT_CAST": + case 6: + message.objectType = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.objectType = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.objectType = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.objectType = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.objectType = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.objectType = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.objectType = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.objectType = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.objectType = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.objectType = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.objectType = 16; + break; + case "OBJECT_FDW": + case 17: + message.objectType = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.objectType = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.objectType = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.objectType = 20; + break; + case "OBJECT_INDEX": + case 21: + message.objectType = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.objectType = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.objectType = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.objectType = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.objectType = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.objectType = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.objectType = 27; + break; + case "OBJECT_POLICY": + case 28: + message.objectType = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.objectType = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.objectType = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.objectType = 31; + break; + case "OBJECT_ROLE": + case 32: + message.objectType = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.objectType = 33; + break; + case "OBJECT_RULE": + case 34: + message.objectType = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.objectType = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.objectType = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.objectType = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.objectType = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.objectType = 39; + break; + case "OBJECT_TABLE": + case 40: + message.objectType = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.objectType = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.objectType = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.objectType = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.objectType = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.objectType = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.objectType = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.objectType = 47; + break; + case "OBJECT_TYPE": + case 48: + message.objectType = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.objectType = 49; + break; + case "OBJECT_VIEW": + case 50: + message.objectType = 50; + break; + } + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.AlterOwnerStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.object != null) { + if (typeof object.object !== "object") + throw TypeError(".pg_query.AlterOwnerStmt.object: object expected"); + message.object = $root.pg_query.Node.fromObject(object.object); + } + if (object.newowner != null) { + if (typeof object.newowner !== "object") + throw TypeError(".pg_query.AlterOwnerStmt.newowner: object expected"); + message.newowner = $root.pg_query.RoleSpec.fromObject(object.newowner); + } + return message; + }; + + /** + * Creates a plain object from an AlterOwnerStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterOwnerStmt + * @static + * @param {pg_query.AlterOwnerStmt} message AlterOwnerStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterOwnerStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.objectType = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.relation = null; + object.object = null; + object.newowner = null; + } + if (message.objectType != null && message.hasOwnProperty("objectType")) + object.objectType = options.enums === String ? $root.pg_query.ObjectType[message.objectType] === undefined ? message.objectType : $root.pg_query.ObjectType[message.objectType] : message.objectType; + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.object != null && message.hasOwnProperty("object")) + object.object = $root.pg_query.Node.toObject(message.object, options); + if (message.newowner != null && message.hasOwnProperty("newowner")) + object.newowner = $root.pg_query.RoleSpec.toObject(message.newowner, options); + return object; + }; + + /** + * Converts this AlterOwnerStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterOwnerStmt + * @instance + * @returns {Object.} JSON object + */ + AlterOwnerStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterOwnerStmt + * @function getTypeUrl + * @memberof pg_query.AlterOwnerStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterOwnerStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterOwnerStmt"; + }; + + return AlterOwnerStmt; + })(); + + pg_query.AlterOperatorStmt = (function() { + + /** + * Properties of an AlterOperatorStmt. + * @memberof pg_query + * @interface IAlterOperatorStmt + * @property {pg_query.IObjectWithArgs|null} [opername] AlterOperatorStmt opername + * @property {Array.|null} [options] AlterOperatorStmt options + */ + + /** + * Constructs a new AlterOperatorStmt. + * @memberof pg_query + * @classdesc Represents an AlterOperatorStmt. + * @implements IAlterOperatorStmt + * @constructor + * @param {pg_query.IAlterOperatorStmt=} [properties] Properties to set + */ + function AlterOperatorStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterOperatorStmt opername. + * @member {pg_query.IObjectWithArgs|null|undefined} opername + * @memberof pg_query.AlterOperatorStmt + * @instance + */ + AlterOperatorStmt.prototype.opername = null; + + /** + * AlterOperatorStmt options. + * @member {Array.} options + * @memberof pg_query.AlterOperatorStmt + * @instance + */ + AlterOperatorStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new AlterOperatorStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterOperatorStmt + * @static + * @param {pg_query.IAlterOperatorStmt=} [properties] Properties to set + * @returns {pg_query.AlterOperatorStmt} AlterOperatorStmt instance + */ + AlterOperatorStmt.create = function create(properties) { + return new AlterOperatorStmt(properties); + }; + + /** + * Encodes the specified AlterOperatorStmt message. Does not implicitly {@link pg_query.AlterOperatorStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterOperatorStmt + * @static + * @param {pg_query.IAlterOperatorStmt} message AlterOperatorStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterOperatorStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.opername != null && Object.hasOwnProperty.call(message, "opername")) + $root.pg_query.ObjectWithArgs.encode(message.opername, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterOperatorStmt message, length delimited. Does not implicitly {@link pg_query.AlterOperatorStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterOperatorStmt + * @static + * @param {pg_query.IAlterOperatorStmt} message AlterOperatorStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterOperatorStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterOperatorStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterOperatorStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterOperatorStmt} AlterOperatorStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterOperatorStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterOperatorStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.opername = $root.pg_query.ObjectWithArgs.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterOperatorStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterOperatorStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterOperatorStmt} AlterOperatorStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterOperatorStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterOperatorStmt message. + * @function verify + * @memberof pg_query.AlterOperatorStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterOperatorStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.opername != null && message.hasOwnProperty("opername")) { + var error = $root.pg_query.ObjectWithArgs.verify(message.opername); + if (error) + return "opername." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates an AlterOperatorStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterOperatorStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterOperatorStmt} AlterOperatorStmt + */ + AlterOperatorStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterOperatorStmt) + return object; + var message = new $root.pg_query.AlterOperatorStmt(); + if (object.opername != null) { + if (typeof object.opername !== "object") + throw TypeError(".pg_query.AlterOperatorStmt.opername: object expected"); + message.opername = $root.pg_query.ObjectWithArgs.fromObject(object.opername); + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterOperatorStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterOperatorStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlterOperatorStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterOperatorStmt + * @static + * @param {pg_query.AlterOperatorStmt} message AlterOperatorStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterOperatorStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) + object.opername = null; + if (message.opername != null && message.hasOwnProperty("opername")) + object.opername = $root.pg_query.ObjectWithArgs.toObject(message.opername, options); + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this AlterOperatorStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterOperatorStmt + * @instance + * @returns {Object.} JSON object + */ + AlterOperatorStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterOperatorStmt + * @function getTypeUrl + * @memberof pg_query.AlterOperatorStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterOperatorStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterOperatorStmt"; + }; + + return AlterOperatorStmt; + })(); + + pg_query.AlterTypeStmt = (function() { + + /** + * Properties of an AlterTypeStmt. + * @memberof pg_query + * @interface IAlterTypeStmt + * @property {Array.|null} [typeName] AlterTypeStmt typeName + * @property {Array.|null} [options] AlterTypeStmt options + */ + + /** + * Constructs a new AlterTypeStmt. + * @memberof pg_query + * @classdesc Represents an AlterTypeStmt. + * @implements IAlterTypeStmt + * @constructor + * @param {pg_query.IAlterTypeStmt=} [properties] Properties to set + */ + function AlterTypeStmt(properties) { + this.typeName = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterTypeStmt typeName. + * @member {Array.} typeName + * @memberof pg_query.AlterTypeStmt + * @instance + */ + AlterTypeStmt.prototype.typeName = $util.emptyArray; + + /** + * AlterTypeStmt options. + * @member {Array.} options + * @memberof pg_query.AlterTypeStmt + * @instance + */ + AlterTypeStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new AlterTypeStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterTypeStmt + * @static + * @param {pg_query.IAlterTypeStmt=} [properties] Properties to set + * @returns {pg_query.AlterTypeStmt} AlterTypeStmt instance + */ + AlterTypeStmt.create = function create(properties) { + return new AlterTypeStmt(properties); + }; + + /** + * Encodes the specified AlterTypeStmt message. Does not implicitly {@link pg_query.AlterTypeStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterTypeStmt + * @static + * @param {pg_query.IAlterTypeStmt} message AlterTypeStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTypeStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.typeName != null && message.typeName.length) + for (var i = 0; i < message.typeName.length; ++i) + $root.pg_query.Node.encode(message.typeName[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterTypeStmt message, length delimited. Does not implicitly {@link pg_query.AlterTypeStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterTypeStmt + * @static + * @param {pg_query.IAlterTypeStmt} message AlterTypeStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTypeStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterTypeStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterTypeStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterTypeStmt} AlterTypeStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTypeStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterTypeStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.typeName && message.typeName.length)) + message.typeName = []; + message.typeName.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterTypeStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterTypeStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterTypeStmt} AlterTypeStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTypeStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterTypeStmt message. + * @function verify + * @memberof pg_query.AlterTypeStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterTypeStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.typeName != null && message.hasOwnProperty("typeName")) { + if (!Array.isArray(message.typeName)) + return "typeName: array expected"; + for (var i = 0; i < message.typeName.length; ++i) { + var error = $root.pg_query.Node.verify(message.typeName[i]); + if (error) + return "typeName." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates an AlterTypeStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterTypeStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterTypeStmt} AlterTypeStmt + */ + AlterTypeStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterTypeStmt) + return object; + var message = new $root.pg_query.AlterTypeStmt(); + if (object.typeName) { + if (!Array.isArray(object.typeName)) + throw TypeError(".pg_query.AlterTypeStmt.typeName: array expected"); + message.typeName = []; + for (var i = 0; i < object.typeName.length; ++i) { + if (typeof object.typeName[i] !== "object") + throw TypeError(".pg_query.AlterTypeStmt.typeName: object expected"); + message.typeName[i] = $root.pg_query.Node.fromObject(object.typeName[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterTypeStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterTypeStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlterTypeStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterTypeStmt + * @static + * @param {pg_query.AlterTypeStmt} message AlterTypeStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterTypeStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.typeName = []; + object.options = []; + } + if (message.typeName && message.typeName.length) { + object.typeName = []; + for (var j = 0; j < message.typeName.length; ++j) + object.typeName[j] = $root.pg_query.Node.toObject(message.typeName[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this AlterTypeStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterTypeStmt + * @instance + * @returns {Object.} JSON object + */ + AlterTypeStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterTypeStmt + * @function getTypeUrl + * @memberof pg_query.AlterTypeStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterTypeStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterTypeStmt"; + }; + + return AlterTypeStmt; + })(); + + pg_query.DropOwnedStmt = (function() { + + /** + * Properties of a DropOwnedStmt. + * @memberof pg_query + * @interface IDropOwnedStmt + * @property {Array.|null} [roles] DropOwnedStmt roles + * @property {pg_query.DropBehavior|null} [behavior] DropOwnedStmt behavior + */ + + /** + * Constructs a new DropOwnedStmt. + * @memberof pg_query + * @classdesc Represents a DropOwnedStmt. + * @implements IDropOwnedStmt + * @constructor + * @param {pg_query.IDropOwnedStmt=} [properties] Properties to set + */ + function DropOwnedStmt(properties) { + this.roles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DropOwnedStmt roles. + * @member {Array.} roles + * @memberof pg_query.DropOwnedStmt + * @instance + */ + DropOwnedStmt.prototype.roles = $util.emptyArray; + + /** + * DropOwnedStmt behavior. + * @member {pg_query.DropBehavior} behavior + * @memberof pg_query.DropOwnedStmt + * @instance + */ + DropOwnedStmt.prototype.behavior = 0; + + /** + * Creates a new DropOwnedStmt instance using the specified properties. + * @function create + * @memberof pg_query.DropOwnedStmt + * @static + * @param {pg_query.IDropOwnedStmt=} [properties] Properties to set + * @returns {pg_query.DropOwnedStmt} DropOwnedStmt instance + */ + DropOwnedStmt.create = function create(properties) { + return new DropOwnedStmt(properties); + }; + + /** + * Encodes the specified DropOwnedStmt message. Does not implicitly {@link pg_query.DropOwnedStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DropOwnedStmt + * @static + * @param {pg_query.IDropOwnedStmt} message DropOwnedStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropOwnedStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + $root.pg_query.Node.encode(message.roles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.behavior != null && Object.hasOwnProperty.call(message, "behavior")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.behavior); + return writer; + }; + + /** + * Encodes the specified DropOwnedStmt message, length delimited. Does not implicitly {@link pg_query.DropOwnedStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DropOwnedStmt + * @static + * @param {pg_query.IDropOwnedStmt} message DropOwnedStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropOwnedStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DropOwnedStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DropOwnedStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DropOwnedStmt} DropOwnedStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropOwnedStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DropOwnedStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.behavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DropOwnedStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DropOwnedStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DropOwnedStmt} DropOwnedStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropOwnedStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DropOwnedStmt message. + * @function verify + * @memberof pg_query.DropOwnedStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DropOwnedStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) { + var error = $root.pg_query.Node.verify(message.roles[i]); + if (error) + return "roles." + error; + } + } + if (message.behavior != null && message.hasOwnProperty("behavior")) + switch (message.behavior) { + default: + return "behavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DropOwnedStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DropOwnedStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DropOwnedStmt} DropOwnedStmt + */ + DropOwnedStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DropOwnedStmt) + return object; + var message = new $root.pg_query.DropOwnedStmt(); + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".pg_query.DropOwnedStmt.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) { + if (typeof object.roles[i] !== "object") + throw TypeError(".pg_query.DropOwnedStmt.roles: object expected"); + message.roles[i] = $root.pg_query.Node.fromObject(object.roles[i]); + } + } + switch (object.behavior) { + default: + if (typeof object.behavior === "number") { + message.behavior = object.behavior; + break; + } + break; + case "DROP_BEHAVIOR_UNDEFINED": + case 0: + message.behavior = 0; + break; + case "DROP_RESTRICT": + case 1: + message.behavior = 1; + break; + case "DROP_CASCADE": + case 2: + message.behavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DropOwnedStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DropOwnedStmt + * @static + * @param {pg_query.DropOwnedStmt} message DropOwnedStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DropOwnedStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.roles = []; + if (options.defaults) + object.behavior = options.enums === String ? "DROP_BEHAVIOR_UNDEFINED" : 0; + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = $root.pg_query.Node.toObject(message.roles[j], options); + } + if (message.behavior != null && message.hasOwnProperty("behavior")) + object.behavior = options.enums === String ? $root.pg_query.DropBehavior[message.behavior] === undefined ? message.behavior : $root.pg_query.DropBehavior[message.behavior] : message.behavior; + return object; + }; + + /** + * Converts this DropOwnedStmt to JSON. + * @function toJSON + * @memberof pg_query.DropOwnedStmt + * @instance + * @returns {Object.} JSON object + */ + DropOwnedStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DropOwnedStmt + * @function getTypeUrl + * @memberof pg_query.DropOwnedStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DropOwnedStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DropOwnedStmt"; + }; + + return DropOwnedStmt; + })(); + + pg_query.ReassignOwnedStmt = (function() { + + /** + * Properties of a ReassignOwnedStmt. + * @memberof pg_query + * @interface IReassignOwnedStmt + * @property {Array.|null} [roles] ReassignOwnedStmt roles + * @property {pg_query.IRoleSpec|null} [newrole] ReassignOwnedStmt newrole + */ + + /** + * Constructs a new ReassignOwnedStmt. + * @memberof pg_query + * @classdesc Represents a ReassignOwnedStmt. + * @implements IReassignOwnedStmt + * @constructor + * @param {pg_query.IReassignOwnedStmt=} [properties] Properties to set + */ + function ReassignOwnedStmt(properties) { + this.roles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReassignOwnedStmt roles. + * @member {Array.} roles + * @memberof pg_query.ReassignOwnedStmt + * @instance + */ + ReassignOwnedStmt.prototype.roles = $util.emptyArray; + + /** + * ReassignOwnedStmt newrole. + * @member {pg_query.IRoleSpec|null|undefined} newrole + * @memberof pg_query.ReassignOwnedStmt + * @instance + */ + ReassignOwnedStmt.prototype.newrole = null; + + /** + * Creates a new ReassignOwnedStmt instance using the specified properties. + * @function create + * @memberof pg_query.ReassignOwnedStmt + * @static + * @param {pg_query.IReassignOwnedStmt=} [properties] Properties to set + * @returns {pg_query.ReassignOwnedStmt} ReassignOwnedStmt instance + */ + ReassignOwnedStmt.create = function create(properties) { + return new ReassignOwnedStmt(properties); + }; + + /** + * Encodes the specified ReassignOwnedStmt message. Does not implicitly {@link pg_query.ReassignOwnedStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.ReassignOwnedStmt + * @static + * @param {pg_query.IReassignOwnedStmt} message ReassignOwnedStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReassignOwnedStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + $root.pg_query.Node.encode(message.roles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.newrole != null && Object.hasOwnProperty.call(message, "newrole")) + $root.pg_query.RoleSpec.encode(message.newrole, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReassignOwnedStmt message, length delimited. Does not implicitly {@link pg_query.ReassignOwnedStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ReassignOwnedStmt + * @static + * @param {pg_query.IReassignOwnedStmt} message ReassignOwnedStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReassignOwnedStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReassignOwnedStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ReassignOwnedStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ReassignOwnedStmt} ReassignOwnedStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReassignOwnedStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ReassignOwnedStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.newrole = $root.pg_query.RoleSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReassignOwnedStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ReassignOwnedStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ReassignOwnedStmt} ReassignOwnedStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReassignOwnedStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReassignOwnedStmt message. + * @function verify + * @memberof pg_query.ReassignOwnedStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReassignOwnedStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) { + var error = $root.pg_query.Node.verify(message.roles[i]); + if (error) + return "roles." + error; + } + } + if (message.newrole != null && message.hasOwnProperty("newrole")) { + var error = $root.pg_query.RoleSpec.verify(message.newrole); + if (error) + return "newrole." + error; + } + return null; + }; + + /** + * Creates a ReassignOwnedStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ReassignOwnedStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ReassignOwnedStmt} ReassignOwnedStmt + */ + ReassignOwnedStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ReassignOwnedStmt) + return object; + var message = new $root.pg_query.ReassignOwnedStmt(); + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".pg_query.ReassignOwnedStmt.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) { + if (typeof object.roles[i] !== "object") + throw TypeError(".pg_query.ReassignOwnedStmt.roles: object expected"); + message.roles[i] = $root.pg_query.Node.fromObject(object.roles[i]); + } + } + if (object.newrole != null) { + if (typeof object.newrole !== "object") + throw TypeError(".pg_query.ReassignOwnedStmt.newrole: object expected"); + message.newrole = $root.pg_query.RoleSpec.fromObject(object.newrole); + } + return message; + }; + + /** + * Creates a plain object from a ReassignOwnedStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ReassignOwnedStmt + * @static + * @param {pg_query.ReassignOwnedStmt} message ReassignOwnedStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReassignOwnedStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.roles = []; + if (options.defaults) + object.newrole = null; + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = $root.pg_query.Node.toObject(message.roles[j], options); + } + if (message.newrole != null && message.hasOwnProperty("newrole")) + object.newrole = $root.pg_query.RoleSpec.toObject(message.newrole, options); + return object; + }; + + /** + * Converts this ReassignOwnedStmt to JSON. + * @function toJSON + * @memberof pg_query.ReassignOwnedStmt + * @instance + * @returns {Object.} JSON object + */ + ReassignOwnedStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReassignOwnedStmt + * @function getTypeUrl + * @memberof pg_query.ReassignOwnedStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReassignOwnedStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ReassignOwnedStmt"; + }; + + return ReassignOwnedStmt; + })(); + + pg_query.CompositeTypeStmt = (function() { + + /** + * Properties of a CompositeTypeStmt. + * @memberof pg_query + * @interface ICompositeTypeStmt + * @property {pg_query.IRangeVar|null} [typevar] CompositeTypeStmt typevar + * @property {Array.|null} [coldeflist] CompositeTypeStmt coldeflist + */ + + /** + * Constructs a new CompositeTypeStmt. + * @memberof pg_query + * @classdesc Represents a CompositeTypeStmt. + * @implements ICompositeTypeStmt + * @constructor + * @param {pg_query.ICompositeTypeStmt=} [properties] Properties to set + */ + function CompositeTypeStmt(properties) { + this.coldeflist = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompositeTypeStmt typevar. + * @member {pg_query.IRangeVar|null|undefined} typevar + * @memberof pg_query.CompositeTypeStmt + * @instance + */ + CompositeTypeStmt.prototype.typevar = null; + + /** + * CompositeTypeStmt coldeflist. + * @member {Array.} coldeflist + * @memberof pg_query.CompositeTypeStmt + * @instance + */ + CompositeTypeStmt.prototype.coldeflist = $util.emptyArray; + + /** + * Creates a new CompositeTypeStmt instance using the specified properties. + * @function create + * @memberof pg_query.CompositeTypeStmt + * @static + * @param {pg_query.ICompositeTypeStmt=} [properties] Properties to set + * @returns {pg_query.CompositeTypeStmt} CompositeTypeStmt instance + */ + CompositeTypeStmt.create = function create(properties) { + return new CompositeTypeStmt(properties); + }; + + /** + * Encodes the specified CompositeTypeStmt message. Does not implicitly {@link pg_query.CompositeTypeStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CompositeTypeStmt + * @static + * @param {pg_query.ICompositeTypeStmt} message CompositeTypeStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompositeTypeStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.typevar != null && Object.hasOwnProperty.call(message, "typevar")) + $root.pg_query.RangeVar.encode(message.typevar, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.coldeflist != null && message.coldeflist.length) + for (var i = 0; i < message.coldeflist.length; ++i) + $root.pg_query.Node.encode(message.coldeflist[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CompositeTypeStmt message, length delimited. Does not implicitly {@link pg_query.CompositeTypeStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CompositeTypeStmt + * @static + * @param {pg_query.ICompositeTypeStmt} message CompositeTypeStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompositeTypeStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompositeTypeStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CompositeTypeStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CompositeTypeStmt} CompositeTypeStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompositeTypeStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CompositeTypeStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.typevar = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.coldeflist && message.coldeflist.length)) + message.coldeflist = []; + message.coldeflist.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompositeTypeStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CompositeTypeStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CompositeTypeStmt} CompositeTypeStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompositeTypeStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompositeTypeStmt message. + * @function verify + * @memberof pg_query.CompositeTypeStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompositeTypeStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.typevar != null && message.hasOwnProperty("typevar")) { + var error = $root.pg_query.RangeVar.verify(message.typevar); + if (error) + return "typevar." + error; + } + if (message.coldeflist != null && message.hasOwnProperty("coldeflist")) { + if (!Array.isArray(message.coldeflist)) + return "coldeflist: array expected"; + for (var i = 0; i < message.coldeflist.length; ++i) { + var error = $root.pg_query.Node.verify(message.coldeflist[i]); + if (error) + return "coldeflist." + error; + } + } + return null; + }; + + /** + * Creates a CompositeTypeStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CompositeTypeStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CompositeTypeStmt} CompositeTypeStmt + */ + CompositeTypeStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CompositeTypeStmt) + return object; + var message = new $root.pg_query.CompositeTypeStmt(); + if (object.typevar != null) { + if (typeof object.typevar !== "object") + throw TypeError(".pg_query.CompositeTypeStmt.typevar: object expected"); + message.typevar = $root.pg_query.RangeVar.fromObject(object.typevar); + } + if (object.coldeflist) { + if (!Array.isArray(object.coldeflist)) + throw TypeError(".pg_query.CompositeTypeStmt.coldeflist: array expected"); + message.coldeflist = []; + for (var i = 0; i < object.coldeflist.length; ++i) { + if (typeof object.coldeflist[i] !== "object") + throw TypeError(".pg_query.CompositeTypeStmt.coldeflist: object expected"); + message.coldeflist[i] = $root.pg_query.Node.fromObject(object.coldeflist[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CompositeTypeStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CompositeTypeStmt + * @static + * @param {pg_query.CompositeTypeStmt} message CompositeTypeStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompositeTypeStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.coldeflist = []; + if (options.defaults) + object.typevar = null; + if (message.typevar != null && message.hasOwnProperty("typevar")) + object.typevar = $root.pg_query.RangeVar.toObject(message.typevar, options); + if (message.coldeflist && message.coldeflist.length) { + object.coldeflist = []; + for (var j = 0; j < message.coldeflist.length; ++j) + object.coldeflist[j] = $root.pg_query.Node.toObject(message.coldeflist[j], options); + } + return object; + }; + + /** + * Converts this CompositeTypeStmt to JSON. + * @function toJSON + * @memberof pg_query.CompositeTypeStmt + * @instance + * @returns {Object.} JSON object + */ + CompositeTypeStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CompositeTypeStmt + * @function getTypeUrl + * @memberof pg_query.CompositeTypeStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CompositeTypeStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CompositeTypeStmt"; + }; + + return CompositeTypeStmt; + })(); + + pg_query.CreateEnumStmt = (function() { + + /** + * Properties of a CreateEnumStmt. + * @memberof pg_query + * @interface ICreateEnumStmt + * @property {Array.|null} [typeName] CreateEnumStmt typeName + * @property {Array.|null} [vals] CreateEnumStmt vals + */ + + /** + * Constructs a new CreateEnumStmt. + * @memberof pg_query + * @classdesc Represents a CreateEnumStmt. + * @implements ICreateEnumStmt + * @constructor + * @param {pg_query.ICreateEnumStmt=} [properties] Properties to set + */ + function CreateEnumStmt(properties) { + this.typeName = []; + this.vals = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEnumStmt typeName. + * @member {Array.} typeName + * @memberof pg_query.CreateEnumStmt + * @instance + */ + CreateEnumStmt.prototype.typeName = $util.emptyArray; + + /** + * CreateEnumStmt vals. + * @member {Array.} vals + * @memberof pg_query.CreateEnumStmt + * @instance + */ + CreateEnumStmt.prototype.vals = $util.emptyArray; + + /** + * Creates a new CreateEnumStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateEnumStmt + * @static + * @param {pg_query.ICreateEnumStmt=} [properties] Properties to set + * @returns {pg_query.CreateEnumStmt} CreateEnumStmt instance + */ + CreateEnumStmt.create = function create(properties) { + return new CreateEnumStmt(properties); + }; + + /** + * Encodes the specified CreateEnumStmt message. Does not implicitly {@link pg_query.CreateEnumStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateEnumStmt + * @static + * @param {pg_query.ICreateEnumStmt} message CreateEnumStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEnumStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.typeName != null && message.typeName.length) + for (var i = 0; i < message.typeName.length; ++i) + $root.pg_query.Node.encode(message.typeName[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.vals != null && message.vals.length) + for (var i = 0; i < message.vals.length; ++i) + $root.pg_query.Node.encode(message.vals[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEnumStmt message, length delimited. Does not implicitly {@link pg_query.CreateEnumStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateEnumStmt + * @static + * @param {pg_query.ICreateEnumStmt} message CreateEnumStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEnumStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEnumStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateEnumStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateEnumStmt} CreateEnumStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEnumStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateEnumStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.typeName && message.typeName.length)) + message.typeName = []; + message.typeName.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.vals && message.vals.length)) + message.vals = []; + message.vals.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEnumStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateEnumStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateEnumStmt} CreateEnumStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEnumStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEnumStmt message. + * @function verify + * @memberof pg_query.CreateEnumStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEnumStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.typeName != null && message.hasOwnProperty("typeName")) { + if (!Array.isArray(message.typeName)) + return "typeName: array expected"; + for (var i = 0; i < message.typeName.length; ++i) { + var error = $root.pg_query.Node.verify(message.typeName[i]); + if (error) + return "typeName." + error; + } + } + if (message.vals != null && message.hasOwnProperty("vals")) { + if (!Array.isArray(message.vals)) + return "vals: array expected"; + for (var i = 0; i < message.vals.length; ++i) { + var error = $root.pg_query.Node.verify(message.vals[i]); + if (error) + return "vals." + error; + } + } + return null; + }; + + /** + * Creates a CreateEnumStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateEnumStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateEnumStmt} CreateEnumStmt + */ + CreateEnumStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateEnumStmt) + return object; + var message = new $root.pg_query.CreateEnumStmt(); + if (object.typeName) { + if (!Array.isArray(object.typeName)) + throw TypeError(".pg_query.CreateEnumStmt.typeName: array expected"); + message.typeName = []; + for (var i = 0; i < object.typeName.length; ++i) { + if (typeof object.typeName[i] !== "object") + throw TypeError(".pg_query.CreateEnumStmt.typeName: object expected"); + message.typeName[i] = $root.pg_query.Node.fromObject(object.typeName[i]); + } + } + if (object.vals) { + if (!Array.isArray(object.vals)) + throw TypeError(".pg_query.CreateEnumStmt.vals: array expected"); + message.vals = []; + for (var i = 0; i < object.vals.length; ++i) { + if (typeof object.vals[i] !== "object") + throw TypeError(".pg_query.CreateEnumStmt.vals: object expected"); + message.vals[i] = $root.pg_query.Node.fromObject(object.vals[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateEnumStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateEnumStmt + * @static + * @param {pg_query.CreateEnumStmt} message CreateEnumStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEnumStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.typeName = []; + object.vals = []; + } + if (message.typeName && message.typeName.length) { + object.typeName = []; + for (var j = 0; j < message.typeName.length; ++j) + object.typeName[j] = $root.pg_query.Node.toObject(message.typeName[j], options); + } + if (message.vals && message.vals.length) { + object.vals = []; + for (var j = 0; j < message.vals.length; ++j) + object.vals[j] = $root.pg_query.Node.toObject(message.vals[j], options); + } + return object; + }; + + /** + * Converts this CreateEnumStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateEnumStmt + * @instance + * @returns {Object.} JSON object + */ + CreateEnumStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEnumStmt + * @function getTypeUrl + * @memberof pg_query.CreateEnumStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEnumStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateEnumStmt"; + }; + + return CreateEnumStmt; + })(); + + pg_query.CreateRangeStmt = (function() { + + /** + * Properties of a CreateRangeStmt. + * @memberof pg_query + * @interface ICreateRangeStmt + * @property {Array.|null} [typeName] CreateRangeStmt typeName + * @property {Array.|null} [params] CreateRangeStmt params + */ + + /** + * Constructs a new CreateRangeStmt. + * @memberof pg_query + * @classdesc Represents a CreateRangeStmt. + * @implements ICreateRangeStmt + * @constructor + * @param {pg_query.ICreateRangeStmt=} [properties] Properties to set + */ + function CreateRangeStmt(properties) { + this.typeName = []; + this.params = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateRangeStmt typeName. + * @member {Array.} typeName + * @memberof pg_query.CreateRangeStmt + * @instance + */ + CreateRangeStmt.prototype.typeName = $util.emptyArray; + + /** + * CreateRangeStmt params. + * @member {Array.} params + * @memberof pg_query.CreateRangeStmt + * @instance + */ + CreateRangeStmt.prototype.params = $util.emptyArray; + + /** + * Creates a new CreateRangeStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateRangeStmt + * @static + * @param {pg_query.ICreateRangeStmt=} [properties] Properties to set + * @returns {pg_query.CreateRangeStmt} CreateRangeStmt instance + */ + CreateRangeStmt.create = function create(properties) { + return new CreateRangeStmt(properties); + }; + + /** + * Encodes the specified CreateRangeStmt message. Does not implicitly {@link pg_query.CreateRangeStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateRangeStmt + * @static + * @param {pg_query.ICreateRangeStmt} message CreateRangeStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRangeStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.typeName != null && message.typeName.length) + for (var i = 0; i < message.typeName.length; ++i) + $root.pg_query.Node.encode(message.typeName[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.params != null && message.params.length) + for (var i = 0; i < message.params.length; ++i) + $root.pg_query.Node.encode(message.params[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateRangeStmt message, length delimited. Does not implicitly {@link pg_query.CreateRangeStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateRangeStmt + * @static + * @param {pg_query.ICreateRangeStmt} message CreateRangeStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRangeStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRangeStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateRangeStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateRangeStmt} CreateRangeStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRangeStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateRangeStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.typeName && message.typeName.length)) + message.typeName = []; + message.typeName.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.params && message.params.length)) + message.params = []; + message.params.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRangeStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateRangeStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateRangeStmt} CreateRangeStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRangeStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRangeStmt message. + * @function verify + * @memberof pg_query.CreateRangeStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRangeStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.typeName != null && message.hasOwnProperty("typeName")) { + if (!Array.isArray(message.typeName)) + return "typeName: array expected"; + for (var i = 0; i < message.typeName.length; ++i) { + var error = $root.pg_query.Node.verify(message.typeName[i]); + if (error) + return "typeName." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + if (!Array.isArray(message.params)) + return "params: array expected"; + for (var i = 0; i < message.params.length; ++i) { + var error = $root.pg_query.Node.verify(message.params[i]); + if (error) + return "params." + error; + } + } + return null; + }; + + /** + * Creates a CreateRangeStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateRangeStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateRangeStmt} CreateRangeStmt + */ + CreateRangeStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateRangeStmt) + return object; + var message = new $root.pg_query.CreateRangeStmt(); + if (object.typeName) { + if (!Array.isArray(object.typeName)) + throw TypeError(".pg_query.CreateRangeStmt.typeName: array expected"); + message.typeName = []; + for (var i = 0; i < object.typeName.length; ++i) { + if (typeof object.typeName[i] !== "object") + throw TypeError(".pg_query.CreateRangeStmt.typeName: object expected"); + message.typeName[i] = $root.pg_query.Node.fromObject(object.typeName[i]); + } + } + if (object.params) { + if (!Array.isArray(object.params)) + throw TypeError(".pg_query.CreateRangeStmt.params: array expected"); + message.params = []; + for (var i = 0; i < object.params.length; ++i) { + if (typeof object.params[i] !== "object") + throw TypeError(".pg_query.CreateRangeStmt.params: object expected"); + message.params[i] = $root.pg_query.Node.fromObject(object.params[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateRangeStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateRangeStmt + * @static + * @param {pg_query.CreateRangeStmt} message CreateRangeStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRangeStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.typeName = []; + object.params = []; + } + if (message.typeName && message.typeName.length) { + object.typeName = []; + for (var j = 0; j < message.typeName.length; ++j) + object.typeName[j] = $root.pg_query.Node.toObject(message.typeName[j], options); + } + if (message.params && message.params.length) { + object.params = []; + for (var j = 0; j < message.params.length; ++j) + object.params[j] = $root.pg_query.Node.toObject(message.params[j], options); + } + return object; + }; + + /** + * Converts this CreateRangeStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateRangeStmt + * @instance + * @returns {Object.} JSON object + */ + CreateRangeStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRangeStmt + * @function getTypeUrl + * @memberof pg_query.CreateRangeStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRangeStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateRangeStmt"; + }; + + return CreateRangeStmt; + })(); + + pg_query.AlterEnumStmt = (function() { + + /** + * Properties of an AlterEnumStmt. + * @memberof pg_query + * @interface IAlterEnumStmt + * @property {Array.|null} [typeName] AlterEnumStmt typeName + * @property {string|null} [oldVal] AlterEnumStmt oldVal + * @property {string|null} [newVal] AlterEnumStmt newVal + * @property {string|null} [newValNeighbor] AlterEnumStmt newValNeighbor + * @property {boolean|null} [newValIsAfter] AlterEnumStmt newValIsAfter + * @property {boolean|null} [skipIfNewValExists] AlterEnumStmt skipIfNewValExists + */ + + /** + * Constructs a new AlterEnumStmt. + * @memberof pg_query + * @classdesc Represents an AlterEnumStmt. + * @implements IAlterEnumStmt + * @constructor + * @param {pg_query.IAlterEnumStmt=} [properties] Properties to set + */ + function AlterEnumStmt(properties) { + this.typeName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterEnumStmt typeName. + * @member {Array.} typeName + * @memberof pg_query.AlterEnumStmt + * @instance + */ + AlterEnumStmt.prototype.typeName = $util.emptyArray; + + /** + * AlterEnumStmt oldVal. + * @member {string} oldVal + * @memberof pg_query.AlterEnumStmt + * @instance + */ + AlterEnumStmt.prototype.oldVal = ""; + + /** + * AlterEnumStmt newVal. + * @member {string} newVal + * @memberof pg_query.AlterEnumStmt + * @instance + */ + AlterEnumStmt.prototype.newVal = ""; + + /** + * AlterEnumStmt newValNeighbor. + * @member {string} newValNeighbor + * @memberof pg_query.AlterEnumStmt + * @instance + */ + AlterEnumStmt.prototype.newValNeighbor = ""; + + /** + * AlterEnumStmt newValIsAfter. + * @member {boolean} newValIsAfter + * @memberof pg_query.AlterEnumStmt + * @instance + */ + AlterEnumStmt.prototype.newValIsAfter = false; + + /** + * AlterEnumStmt skipIfNewValExists. + * @member {boolean} skipIfNewValExists + * @memberof pg_query.AlterEnumStmt + * @instance + */ + AlterEnumStmt.prototype.skipIfNewValExists = false; + + /** + * Creates a new AlterEnumStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterEnumStmt + * @static + * @param {pg_query.IAlterEnumStmt=} [properties] Properties to set + * @returns {pg_query.AlterEnumStmt} AlterEnumStmt instance + */ + AlterEnumStmt.create = function create(properties) { + return new AlterEnumStmt(properties); + }; + + /** + * Encodes the specified AlterEnumStmt message. Does not implicitly {@link pg_query.AlterEnumStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterEnumStmt + * @static + * @param {pg_query.IAlterEnumStmt} message AlterEnumStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterEnumStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.typeName != null && message.typeName.length) + for (var i = 0; i < message.typeName.length; ++i) + $root.pg_query.Node.encode(message.typeName[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.oldVal != null && Object.hasOwnProperty.call(message, "oldVal")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.oldVal); + if (message.newVal != null && Object.hasOwnProperty.call(message, "newVal")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.newVal); + if (message.newValNeighbor != null && Object.hasOwnProperty.call(message, "newValNeighbor")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.newValNeighbor); + if (message.newValIsAfter != null && Object.hasOwnProperty.call(message, "newValIsAfter")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.newValIsAfter); + if (message.skipIfNewValExists != null && Object.hasOwnProperty.call(message, "skipIfNewValExists")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.skipIfNewValExists); + return writer; + }; + + /** + * Encodes the specified AlterEnumStmt message, length delimited. Does not implicitly {@link pg_query.AlterEnumStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterEnumStmt + * @static + * @param {pg_query.IAlterEnumStmt} message AlterEnumStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterEnumStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterEnumStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterEnumStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterEnumStmt} AlterEnumStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterEnumStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterEnumStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.typeName && message.typeName.length)) + message.typeName = []; + message.typeName.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.oldVal = reader.string(); + break; + } + case 3: { + message.newVal = reader.string(); + break; + } + case 4: { + message.newValNeighbor = reader.string(); + break; + } + case 5: { + message.newValIsAfter = reader.bool(); + break; + } + case 6: { + message.skipIfNewValExists = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterEnumStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterEnumStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterEnumStmt} AlterEnumStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterEnumStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterEnumStmt message. + * @function verify + * @memberof pg_query.AlterEnumStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterEnumStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.typeName != null && message.hasOwnProperty("typeName")) { + if (!Array.isArray(message.typeName)) + return "typeName: array expected"; + for (var i = 0; i < message.typeName.length; ++i) { + var error = $root.pg_query.Node.verify(message.typeName[i]); + if (error) + return "typeName." + error; + } + } + if (message.oldVal != null && message.hasOwnProperty("oldVal")) + if (!$util.isString(message.oldVal)) + return "oldVal: string expected"; + if (message.newVal != null && message.hasOwnProperty("newVal")) + if (!$util.isString(message.newVal)) + return "newVal: string expected"; + if (message.newValNeighbor != null && message.hasOwnProperty("newValNeighbor")) + if (!$util.isString(message.newValNeighbor)) + return "newValNeighbor: string expected"; + if (message.newValIsAfter != null && message.hasOwnProperty("newValIsAfter")) + if (typeof message.newValIsAfter !== "boolean") + return "newValIsAfter: boolean expected"; + if (message.skipIfNewValExists != null && message.hasOwnProperty("skipIfNewValExists")) + if (typeof message.skipIfNewValExists !== "boolean") + return "skipIfNewValExists: boolean expected"; + return null; + }; + + /** + * Creates an AlterEnumStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterEnumStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterEnumStmt} AlterEnumStmt + */ + AlterEnumStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterEnumStmt) + return object; + var message = new $root.pg_query.AlterEnumStmt(); + if (object.typeName) { + if (!Array.isArray(object.typeName)) + throw TypeError(".pg_query.AlterEnumStmt.typeName: array expected"); + message.typeName = []; + for (var i = 0; i < object.typeName.length; ++i) { + if (typeof object.typeName[i] !== "object") + throw TypeError(".pg_query.AlterEnumStmt.typeName: object expected"); + message.typeName[i] = $root.pg_query.Node.fromObject(object.typeName[i]); + } + } + if (object.oldVal != null) + message.oldVal = String(object.oldVal); + if (object.newVal != null) + message.newVal = String(object.newVal); + if (object.newValNeighbor != null) + message.newValNeighbor = String(object.newValNeighbor); + if (object.newValIsAfter != null) + message.newValIsAfter = Boolean(object.newValIsAfter); + if (object.skipIfNewValExists != null) + message.skipIfNewValExists = Boolean(object.skipIfNewValExists); + return message; + }; + + /** + * Creates a plain object from an AlterEnumStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterEnumStmt + * @static + * @param {pg_query.AlterEnumStmt} message AlterEnumStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterEnumStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.typeName = []; + if (options.defaults) { + object.oldVal = ""; + object.newVal = ""; + object.newValNeighbor = ""; + object.newValIsAfter = false; + object.skipIfNewValExists = false; + } + if (message.typeName && message.typeName.length) { + object.typeName = []; + for (var j = 0; j < message.typeName.length; ++j) + object.typeName[j] = $root.pg_query.Node.toObject(message.typeName[j], options); + } + if (message.oldVal != null && message.hasOwnProperty("oldVal")) + object.oldVal = message.oldVal; + if (message.newVal != null && message.hasOwnProperty("newVal")) + object.newVal = message.newVal; + if (message.newValNeighbor != null && message.hasOwnProperty("newValNeighbor")) + object.newValNeighbor = message.newValNeighbor; + if (message.newValIsAfter != null && message.hasOwnProperty("newValIsAfter")) + object.newValIsAfter = message.newValIsAfter; + if (message.skipIfNewValExists != null && message.hasOwnProperty("skipIfNewValExists")) + object.skipIfNewValExists = message.skipIfNewValExists; + return object; + }; + + /** + * Converts this AlterEnumStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterEnumStmt + * @instance + * @returns {Object.} JSON object + */ + AlterEnumStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterEnumStmt + * @function getTypeUrl + * @memberof pg_query.AlterEnumStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterEnumStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterEnumStmt"; + }; + + return AlterEnumStmt; + })(); + + pg_query.AlterTSDictionaryStmt = (function() { + + /** + * Properties of an AlterTSDictionaryStmt. + * @memberof pg_query + * @interface IAlterTSDictionaryStmt + * @property {Array.|null} [dictname] AlterTSDictionaryStmt dictname + * @property {Array.|null} [options] AlterTSDictionaryStmt options + */ + + /** + * Constructs a new AlterTSDictionaryStmt. + * @memberof pg_query + * @classdesc Represents an AlterTSDictionaryStmt. + * @implements IAlterTSDictionaryStmt + * @constructor + * @param {pg_query.IAlterTSDictionaryStmt=} [properties] Properties to set + */ + function AlterTSDictionaryStmt(properties) { + this.dictname = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterTSDictionaryStmt dictname. + * @member {Array.} dictname + * @memberof pg_query.AlterTSDictionaryStmt + * @instance + */ + AlterTSDictionaryStmt.prototype.dictname = $util.emptyArray; + + /** + * AlterTSDictionaryStmt options. + * @member {Array.} options + * @memberof pg_query.AlterTSDictionaryStmt + * @instance + */ + AlterTSDictionaryStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new AlterTSDictionaryStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterTSDictionaryStmt + * @static + * @param {pg_query.IAlterTSDictionaryStmt=} [properties] Properties to set + * @returns {pg_query.AlterTSDictionaryStmt} AlterTSDictionaryStmt instance + */ + AlterTSDictionaryStmt.create = function create(properties) { + return new AlterTSDictionaryStmt(properties); + }; + + /** + * Encodes the specified AlterTSDictionaryStmt message. Does not implicitly {@link pg_query.AlterTSDictionaryStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterTSDictionaryStmt + * @static + * @param {pg_query.IAlterTSDictionaryStmt} message AlterTSDictionaryStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTSDictionaryStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dictname != null && message.dictname.length) + for (var i = 0; i < message.dictname.length; ++i) + $root.pg_query.Node.encode(message.dictname[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterTSDictionaryStmt message, length delimited. Does not implicitly {@link pg_query.AlterTSDictionaryStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterTSDictionaryStmt + * @static + * @param {pg_query.IAlterTSDictionaryStmt} message AlterTSDictionaryStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTSDictionaryStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterTSDictionaryStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterTSDictionaryStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterTSDictionaryStmt} AlterTSDictionaryStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTSDictionaryStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterTSDictionaryStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dictname && message.dictname.length)) + message.dictname = []; + message.dictname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterTSDictionaryStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterTSDictionaryStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterTSDictionaryStmt} AlterTSDictionaryStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTSDictionaryStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterTSDictionaryStmt message. + * @function verify + * @memberof pg_query.AlterTSDictionaryStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterTSDictionaryStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dictname != null && message.hasOwnProperty("dictname")) { + if (!Array.isArray(message.dictname)) + return "dictname: array expected"; + for (var i = 0; i < message.dictname.length; ++i) { + var error = $root.pg_query.Node.verify(message.dictname[i]); + if (error) + return "dictname." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates an AlterTSDictionaryStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterTSDictionaryStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterTSDictionaryStmt} AlterTSDictionaryStmt + */ + AlterTSDictionaryStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterTSDictionaryStmt) + return object; + var message = new $root.pg_query.AlterTSDictionaryStmt(); + if (object.dictname) { + if (!Array.isArray(object.dictname)) + throw TypeError(".pg_query.AlterTSDictionaryStmt.dictname: array expected"); + message.dictname = []; + for (var i = 0; i < object.dictname.length; ++i) { + if (typeof object.dictname[i] !== "object") + throw TypeError(".pg_query.AlterTSDictionaryStmt.dictname: object expected"); + message.dictname[i] = $root.pg_query.Node.fromObject(object.dictname[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterTSDictionaryStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterTSDictionaryStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlterTSDictionaryStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterTSDictionaryStmt + * @static + * @param {pg_query.AlterTSDictionaryStmt} message AlterTSDictionaryStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterTSDictionaryStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dictname = []; + object.options = []; + } + if (message.dictname && message.dictname.length) { + object.dictname = []; + for (var j = 0; j < message.dictname.length; ++j) + object.dictname[j] = $root.pg_query.Node.toObject(message.dictname[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this AlterTSDictionaryStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterTSDictionaryStmt + * @instance + * @returns {Object.} JSON object + */ + AlterTSDictionaryStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterTSDictionaryStmt + * @function getTypeUrl + * @memberof pg_query.AlterTSDictionaryStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterTSDictionaryStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterTSDictionaryStmt"; + }; + + return AlterTSDictionaryStmt; + })(); + + pg_query.AlterTSConfigurationStmt = (function() { + + /** + * Properties of an AlterTSConfigurationStmt. + * @memberof pg_query + * @interface IAlterTSConfigurationStmt + * @property {pg_query.AlterTSConfigType|null} [kind] AlterTSConfigurationStmt kind + * @property {Array.|null} [cfgname] AlterTSConfigurationStmt cfgname + * @property {Array.|null} [tokentype] AlterTSConfigurationStmt tokentype + * @property {Array.|null} [dicts] AlterTSConfigurationStmt dicts + * @property {boolean|null} [override] AlterTSConfigurationStmt override + * @property {boolean|null} [replace] AlterTSConfigurationStmt replace + * @property {boolean|null} [missing_ok] AlterTSConfigurationStmt missing_ok + */ + + /** + * Constructs a new AlterTSConfigurationStmt. + * @memberof pg_query + * @classdesc Represents an AlterTSConfigurationStmt. + * @implements IAlterTSConfigurationStmt + * @constructor + * @param {pg_query.IAlterTSConfigurationStmt=} [properties] Properties to set + */ + function AlterTSConfigurationStmt(properties) { + this.cfgname = []; + this.tokentype = []; + this.dicts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterTSConfigurationStmt kind. + * @member {pg_query.AlterTSConfigType} kind + * @memberof pg_query.AlterTSConfigurationStmt + * @instance + */ + AlterTSConfigurationStmt.prototype.kind = 0; + + /** + * AlterTSConfigurationStmt cfgname. + * @member {Array.} cfgname + * @memberof pg_query.AlterTSConfigurationStmt + * @instance + */ + AlterTSConfigurationStmt.prototype.cfgname = $util.emptyArray; + + /** + * AlterTSConfigurationStmt tokentype. + * @member {Array.} tokentype + * @memberof pg_query.AlterTSConfigurationStmt + * @instance + */ + AlterTSConfigurationStmt.prototype.tokentype = $util.emptyArray; + + /** + * AlterTSConfigurationStmt dicts. + * @member {Array.} dicts + * @memberof pg_query.AlterTSConfigurationStmt + * @instance + */ + AlterTSConfigurationStmt.prototype.dicts = $util.emptyArray; + + /** + * AlterTSConfigurationStmt override. + * @member {boolean} override + * @memberof pg_query.AlterTSConfigurationStmt + * @instance + */ + AlterTSConfigurationStmt.prototype.override = false; + + /** + * AlterTSConfigurationStmt replace. + * @member {boolean} replace + * @memberof pg_query.AlterTSConfigurationStmt + * @instance + */ + AlterTSConfigurationStmt.prototype.replace = false; + + /** + * AlterTSConfigurationStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.AlterTSConfigurationStmt + * @instance + */ + AlterTSConfigurationStmt.prototype.missing_ok = false; + + /** + * Creates a new AlterTSConfigurationStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterTSConfigurationStmt + * @static + * @param {pg_query.IAlterTSConfigurationStmt=} [properties] Properties to set + * @returns {pg_query.AlterTSConfigurationStmt} AlterTSConfigurationStmt instance + */ + AlterTSConfigurationStmt.create = function create(properties) { + return new AlterTSConfigurationStmt(properties); + }; + + /** + * Encodes the specified AlterTSConfigurationStmt message. Does not implicitly {@link pg_query.AlterTSConfigurationStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterTSConfigurationStmt + * @static + * @param {pg_query.IAlterTSConfigurationStmt} message AlterTSConfigurationStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTSConfigurationStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.cfgname != null && message.cfgname.length) + for (var i = 0; i < message.cfgname.length; ++i) + $root.pg_query.Node.encode(message.cfgname[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tokentype != null && message.tokentype.length) + for (var i = 0; i < message.tokentype.length; ++i) + $root.pg_query.Node.encode(message.tokentype[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.dicts != null && message.dicts.length) + for (var i = 0; i < message.dicts.length; ++i) + $root.pg_query.Node.encode(message.dicts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.override != null && Object.hasOwnProperty.call(message, "override")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.override); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.replace); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.missing_ok); + return writer; + }; + + /** + * Encodes the specified AlterTSConfigurationStmt message, length delimited. Does not implicitly {@link pg_query.AlterTSConfigurationStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterTSConfigurationStmt + * @static + * @param {pg_query.IAlterTSConfigurationStmt} message AlterTSConfigurationStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTSConfigurationStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterTSConfigurationStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterTSConfigurationStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterTSConfigurationStmt} AlterTSConfigurationStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTSConfigurationStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterTSConfigurationStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + if (!(message.cfgname && message.cfgname.length)) + message.cfgname = []; + message.cfgname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.tokentype && message.tokentype.length)) + message.tokentype = []; + message.tokentype.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.dicts && message.dicts.length)) + message.dicts = []; + message.dicts.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.override = reader.bool(); + break; + } + case 6: { + message.replace = reader.bool(); + break; + } + case 7: { + message.missing_ok = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterTSConfigurationStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterTSConfigurationStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterTSConfigurationStmt} AlterTSConfigurationStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTSConfigurationStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterTSConfigurationStmt message. + * @function verify + * @memberof pg_query.AlterTSConfigurationStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterTSConfigurationStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.cfgname != null && message.hasOwnProperty("cfgname")) { + if (!Array.isArray(message.cfgname)) + return "cfgname: array expected"; + for (var i = 0; i < message.cfgname.length; ++i) { + var error = $root.pg_query.Node.verify(message.cfgname[i]); + if (error) + return "cfgname." + error; + } + } + if (message.tokentype != null && message.hasOwnProperty("tokentype")) { + if (!Array.isArray(message.tokentype)) + return "tokentype: array expected"; + for (var i = 0; i < message.tokentype.length; ++i) { + var error = $root.pg_query.Node.verify(message.tokentype[i]); + if (error) + return "tokentype." + error; + } + } + if (message.dicts != null && message.hasOwnProperty("dicts")) { + if (!Array.isArray(message.dicts)) + return "dicts: array expected"; + for (var i = 0; i < message.dicts.length; ++i) { + var error = $root.pg_query.Node.verify(message.dicts[i]); + if (error) + return "dicts." + error; + } + } + if (message.override != null && message.hasOwnProperty("override")) + if (typeof message.override !== "boolean") + return "override: boolean expected"; + if (message.replace != null && message.hasOwnProperty("replace")) + if (typeof message.replace !== "boolean") + return "replace: boolean expected"; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + return null; + }; + + /** + * Creates an AlterTSConfigurationStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterTSConfigurationStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterTSConfigurationStmt} AlterTSConfigurationStmt + */ + AlterTSConfigurationStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterTSConfigurationStmt) + return object; + var message = new $root.pg_query.AlterTSConfigurationStmt(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "ALTER_TSCONFIG_TYPE_UNDEFINED": + case 0: + message.kind = 0; + break; + case "ALTER_TSCONFIG_ADD_MAPPING": + case 1: + message.kind = 1; + break; + case "ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN": + case 2: + message.kind = 2; + break; + case "ALTER_TSCONFIG_REPLACE_DICT": + case 3: + message.kind = 3; + break; + case "ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN": + case 4: + message.kind = 4; + break; + case "ALTER_TSCONFIG_DROP_MAPPING": + case 5: + message.kind = 5; + break; + } + if (object.cfgname) { + if (!Array.isArray(object.cfgname)) + throw TypeError(".pg_query.AlterTSConfigurationStmt.cfgname: array expected"); + message.cfgname = []; + for (var i = 0; i < object.cfgname.length; ++i) { + if (typeof object.cfgname[i] !== "object") + throw TypeError(".pg_query.AlterTSConfigurationStmt.cfgname: object expected"); + message.cfgname[i] = $root.pg_query.Node.fromObject(object.cfgname[i]); + } + } + if (object.tokentype) { + if (!Array.isArray(object.tokentype)) + throw TypeError(".pg_query.AlterTSConfigurationStmt.tokentype: array expected"); + message.tokentype = []; + for (var i = 0; i < object.tokentype.length; ++i) { + if (typeof object.tokentype[i] !== "object") + throw TypeError(".pg_query.AlterTSConfigurationStmt.tokentype: object expected"); + message.tokentype[i] = $root.pg_query.Node.fromObject(object.tokentype[i]); + } + } + if (object.dicts) { + if (!Array.isArray(object.dicts)) + throw TypeError(".pg_query.AlterTSConfigurationStmt.dicts: array expected"); + message.dicts = []; + for (var i = 0; i < object.dicts.length; ++i) { + if (typeof object.dicts[i] !== "object") + throw TypeError(".pg_query.AlterTSConfigurationStmt.dicts: object expected"); + message.dicts[i] = $root.pg_query.Node.fromObject(object.dicts[i]); + } + } + if (object.override != null) + message.override = Boolean(object.override); + if (object.replace != null) + message.replace = Boolean(object.replace); + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + return message; + }; + + /** + * Creates a plain object from an AlterTSConfigurationStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterTSConfigurationStmt + * @static + * @param {pg_query.AlterTSConfigurationStmt} message AlterTSConfigurationStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterTSConfigurationStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.cfgname = []; + object.tokentype = []; + object.dicts = []; + } + if (options.defaults) { + object.kind = options.enums === String ? "ALTER_TSCONFIG_TYPE_UNDEFINED" : 0; + object.override = false; + object.replace = false; + object.missing_ok = false; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.pg_query.AlterTSConfigType[message.kind] === undefined ? message.kind : $root.pg_query.AlterTSConfigType[message.kind] : message.kind; + if (message.cfgname && message.cfgname.length) { + object.cfgname = []; + for (var j = 0; j < message.cfgname.length; ++j) + object.cfgname[j] = $root.pg_query.Node.toObject(message.cfgname[j], options); + } + if (message.tokentype && message.tokentype.length) { + object.tokentype = []; + for (var j = 0; j < message.tokentype.length; ++j) + object.tokentype[j] = $root.pg_query.Node.toObject(message.tokentype[j], options); + } + if (message.dicts && message.dicts.length) { + object.dicts = []; + for (var j = 0; j < message.dicts.length; ++j) + object.dicts[j] = $root.pg_query.Node.toObject(message.dicts[j], options); + } + if (message.override != null && message.hasOwnProperty("override")) + object.override = message.override; + if (message.replace != null && message.hasOwnProperty("replace")) + object.replace = message.replace; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + return object; + }; + + /** + * Converts this AlterTSConfigurationStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterTSConfigurationStmt + * @instance + * @returns {Object.} JSON object + */ + AlterTSConfigurationStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterTSConfigurationStmt + * @function getTypeUrl + * @memberof pg_query.AlterTSConfigurationStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterTSConfigurationStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterTSConfigurationStmt"; + }; + + return AlterTSConfigurationStmt; + })(); + + pg_query.CreateFdwStmt = (function() { + + /** + * Properties of a CreateFdwStmt. + * @memberof pg_query + * @interface ICreateFdwStmt + * @property {string|null} [fdwname] CreateFdwStmt fdwname + * @property {Array.|null} [func_options] CreateFdwStmt func_options + * @property {Array.|null} [options] CreateFdwStmt options + */ + + /** + * Constructs a new CreateFdwStmt. + * @memberof pg_query + * @classdesc Represents a CreateFdwStmt. + * @implements ICreateFdwStmt + * @constructor + * @param {pg_query.ICreateFdwStmt=} [properties] Properties to set + */ + function CreateFdwStmt(properties) { + this.func_options = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateFdwStmt fdwname. + * @member {string} fdwname + * @memberof pg_query.CreateFdwStmt + * @instance + */ + CreateFdwStmt.prototype.fdwname = ""; + + /** + * CreateFdwStmt func_options. + * @member {Array.} func_options + * @memberof pg_query.CreateFdwStmt + * @instance + */ + CreateFdwStmt.prototype.func_options = $util.emptyArray; + + /** + * CreateFdwStmt options. + * @member {Array.} options + * @memberof pg_query.CreateFdwStmt + * @instance + */ + CreateFdwStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new CreateFdwStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateFdwStmt + * @static + * @param {pg_query.ICreateFdwStmt=} [properties] Properties to set + * @returns {pg_query.CreateFdwStmt} CreateFdwStmt instance + */ + CreateFdwStmt.create = function create(properties) { + return new CreateFdwStmt(properties); + }; + + /** + * Encodes the specified CreateFdwStmt message. Does not implicitly {@link pg_query.CreateFdwStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateFdwStmt + * @static + * @param {pg_query.ICreateFdwStmt} message CreateFdwStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFdwStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fdwname != null && Object.hasOwnProperty.call(message, "fdwname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fdwname); + if (message.func_options != null && message.func_options.length) + for (var i = 0; i < message.func_options.length; ++i) + $root.pg_query.Node.encode(message.func_options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFdwStmt message, length delimited. Does not implicitly {@link pg_query.CreateFdwStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateFdwStmt + * @static + * @param {pg_query.ICreateFdwStmt} message CreateFdwStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFdwStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFdwStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateFdwStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateFdwStmt} CreateFdwStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFdwStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateFdwStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fdwname = reader.string(); + break; + } + case 2: { + if (!(message.func_options && message.func_options.length)) + message.func_options = []; + message.func_options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFdwStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateFdwStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateFdwStmt} CreateFdwStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFdwStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFdwStmt message. + * @function verify + * @memberof pg_query.CreateFdwStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFdwStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fdwname != null && message.hasOwnProperty("fdwname")) + if (!$util.isString(message.fdwname)) + return "fdwname: string expected"; + if (message.func_options != null && message.hasOwnProperty("func_options")) { + if (!Array.isArray(message.func_options)) + return "func_options: array expected"; + for (var i = 0; i < message.func_options.length; ++i) { + var error = $root.pg_query.Node.verify(message.func_options[i]); + if (error) + return "func_options." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates a CreateFdwStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateFdwStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateFdwStmt} CreateFdwStmt + */ + CreateFdwStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateFdwStmt) + return object; + var message = new $root.pg_query.CreateFdwStmt(); + if (object.fdwname != null) + message.fdwname = String(object.fdwname); + if (object.func_options) { + if (!Array.isArray(object.func_options)) + throw TypeError(".pg_query.CreateFdwStmt.func_options: array expected"); + message.func_options = []; + for (var i = 0; i < object.func_options.length; ++i) { + if (typeof object.func_options[i] !== "object") + throw TypeError(".pg_query.CreateFdwStmt.func_options: object expected"); + message.func_options[i] = $root.pg_query.Node.fromObject(object.func_options[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreateFdwStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreateFdwStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateFdwStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateFdwStmt + * @static + * @param {pg_query.CreateFdwStmt} message CreateFdwStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFdwStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.func_options = []; + object.options = []; + } + if (options.defaults) + object.fdwname = ""; + if (message.fdwname != null && message.hasOwnProperty("fdwname")) + object.fdwname = message.fdwname; + if (message.func_options && message.func_options.length) { + object.func_options = []; + for (var j = 0; j < message.func_options.length; ++j) + object.func_options[j] = $root.pg_query.Node.toObject(message.func_options[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this CreateFdwStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateFdwStmt + * @instance + * @returns {Object.} JSON object + */ + CreateFdwStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFdwStmt + * @function getTypeUrl + * @memberof pg_query.CreateFdwStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFdwStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateFdwStmt"; + }; + + return CreateFdwStmt; + })(); + + pg_query.AlterFdwStmt = (function() { + + /** + * Properties of an AlterFdwStmt. + * @memberof pg_query + * @interface IAlterFdwStmt + * @property {string|null} [fdwname] AlterFdwStmt fdwname + * @property {Array.|null} [func_options] AlterFdwStmt func_options + * @property {Array.|null} [options] AlterFdwStmt options + */ + + /** + * Constructs a new AlterFdwStmt. + * @memberof pg_query + * @classdesc Represents an AlterFdwStmt. + * @implements IAlterFdwStmt + * @constructor + * @param {pg_query.IAlterFdwStmt=} [properties] Properties to set + */ + function AlterFdwStmt(properties) { + this.func_options = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterFdwStmt fdwname. + * @member {string} fdwname + * @memberof pg_query.AlterFdwStmt + * @instance + */ + AlterFdwStmt.prototype.fdwname = ""; + + /** + * AlterFdwStmt func_options. + * @member {Array.} func_options + * @memberof pg_query.AlterFdwStmt + * @instance + */ + AlterFdwStmt.prototype.func_options = $util.emptyArray; + + /** + * AlterFdwStmt options. + * @member {Array.} options + * @memberof pg_query.AlterFdwStmt + * @instance + */ + AlterFdwStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new AlterFdwStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterFdwStmt + * @static + * @param {pg_query.IAlterFdwStmt=} [properties] Properties to set + * @returns {pg_query.AlterFdwStmt} AlterFdwStmt instance + */ + AlterFdwStmt.create = function create(properties) { + return new AlterFdwStmt(properties); + }; + + /** + * Encodes the specified AlterFdwStmt message. Does not implicitly {@link pg_query.AlterFdwStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterFdwStmt + * @static + * @param {pg_query.IAlterFdwStmt} message AlterFdwStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterFdwStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fdwname != null && Object.hasOwnProperty.call(message, "fdwname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fdwname); + if (message.func_options != null && message.func_options.length) + for (var i = 0; i < message.func_options.length; ++i) + $root.pg_query.Node.encode(message.func_options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterFdwStmt message, length delimited. Does not implicitly {@link pg_query.AlterFdwStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterFdwStmt + * @static + * @param {pg_query.IAlterFdwStmt} message AlterFdwStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterFdwStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterFdwStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterFdwStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterFdwStmt} AlterFdwStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterFdwStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterFdwStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fdwname = reader.string(); + break; + } + case 2: { + if (!(message.func_options && message.func_options.length)) + message.func_options = []; + message.func_options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterFdwStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterFdwStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterFdwStmt} AlterFdwStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterFdwStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterFdwStmt message. + * @function verify + * @memberof pg_query.AlterFdwStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterFdwStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fdwname != null && message.hasOwnProperty("fdwname")) + if (!$util.isString(message.fdwname)) + return "fdwname: string expected"; + if (message.func_options != null && message.hasOwnProperty("func_options")) { + if (!Array.isArray(message.func_options)) + return "func_options: array expected"; + for (var i = 0; i < message.func_options.length; ++i) { + var error = $root.pg_query.Node.verify(message.func_options[i]); + if (error) + return "func_options." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates an AlterFdwStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterFdwStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterFdwStmt} AlterFdwStmt + */ + AlterFdwStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterFdwStmt) + return object; + var message = new $root.pg_query.AlterFdwStmt(); + if (object.fdwname != null) + message.fdwname = String(object.fdwname); + if (object.func_options) { + if (!Array.isArray(object.func_options)) + throw TypeError(".pg_query.AlterFdwStmt.func_options: array expected"); + message.func_options = []; + for (var i = 0; i < object.func_options.length; ++i) { + if (typeof object.func_options[i] !== "object") + throw TypeError(".pg_query.AlterFdwStmt.func_options: object expected"); + message.func_options[i] = $root.pg_query.Node.fromObject(object.func_options[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterFdwStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterFdwStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlterFdwStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterFdwStmt + * @static + * @param {pg_query.AlterFdwStmt} message AlterFdwStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterFdwStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.func_options = []; + object.options = []; + } + if (options.defaults) + object.fdwname = ""; + if (message.fdwname != null && message.hasOwnProperty("fdwname")) + object.fdwname = message.fdwname; + if (message.func_options && message.func_options.length) { + object.func_options = []; + for (var j = 0; j < message.func_options.length; ++j) + object.func_options[j] = $root.pg_query.Node.toObject(message.func_options[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this AlterFdwStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterFdwStmt + * @instance + * @returns {Object.} JSON object + */ + AlterFdwStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterFdwStmt + * @function getTypeUrl + * @memberof pg_query.AlterFdwStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterFdwStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterFdwStmt"; + }; + + return AlterFdwStmt; + })(); + + pg_query.CreateForeignServerStmt = (function() { + + /** + * Properties of a CreateForeignServerStmt. + * @memberof pg_query + * @interface ICreateForeignServerStmt + * @property {string|null} [servername] CreateForeignServerStmt servername + * @property {string|null} [servertype] CreateForeignServerStmt servertype + * @property {string|null} [version] CreateForeignServerStmt version + * @property {string|null} [fdwname] CreateForeignServerStmt fdwname + * @property {boolean|null} [if_not_exists] CreateForeignServerStmt if_not_exists + * @property {Array.|null} [options] CreateForeignServerStmt options + */ + + /** + * Constructs a new CreateForeignServerStmt. + * @memberof pg_query + * @classdesc Represents a CreateForeignServerStmt. + * @implements ICreateForeignServerStmt + * @constructor + * @param {pg_query.ICreateForeignServerStmt=} [properties] Properties to set + */ + function CreateForeignServerStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateForeignServerStmt servername. + * @member {string} servername + * @memberof pg_query.CreateForeignServerStmt + * @instance + */ + CreateForeignServerStmt.prototype.servername = ""; + + /** + * CreateForeignServerStmt servertype. + * @member {string} servertype + * @memberof pg_query.CreateForeignServerStmt + * @instance + */ + CreateForeignServerStmt.prototype.servertype = ""; + + /** + * CreateForeignServerStmt version. + * @member {string} version + * @memberof pg_query.CreateForeignServerStmt + * @instance + */ + CreateForeignServerStmt.prototype.version = ""; + + /** + * CreateForeignServerStmt fdwname. + * @member {string} fdwname + * @memberof pg_query.CreateForeignServerStmt + * @instance + */ + CreateForeignServerStmt.prototype.fdwname = ""; + + /** + * CreateForeignServerStmt if_not_exists. + * @member {boolean} if_not_exists + * @memberof pg_query.CreateForeignServerStmt + * @instance + */ + CreateForeignServerStmt.prototype.if_not_exists = false; + + /** + * CreateForeignServerStmt options. + * @member {Array.} options + * @memberof pg_query.CreateForeignServerStmt + * @instance + */ + CreateForeignServerStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new CreateForeignServerStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateForeignServerStmt + * @static + * @param {pg_query.ICreateForeignServerStmt=} [properties] Properties to set + * @returns {pg_query.CreateForeignServerStmt} CreateForeignServerStmt instance + */ + CreateForeignServerStmt.create = function create(properties) { + return new CreateForeignServerStmt(properties); + }; + + /** + * Encodes the specified CreateForeignServerStmt message. Does not implicitly {@link pg_query.CreateForeignServerStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateForeignServerStmt + * @static + * @param {pg_query.ICreateForeignServerStmt} message CreateForeignServerStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateForeignServerStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.servername != null && Object.hasOwnProperty.call(message, "servername")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.servername); + if (message.servertype != null && Object.hasOwnProperty.call(message, "servertype")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.servertype); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + if (message.fdwname != null && Object.hasOwnProperty.call(message, "fdwname")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fdwname); + if (message.if_not_exists != null && Object.hasOwnProperty.call(message, "if_not_exists")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.if_not_exists); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateForeignServerStmt message, length delimited. Does not implicitly {@link pg_query.CreateForeignServerStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateForeignServerStmt + * @static + * @param {pg_query.ICreateForeignServerStmt} message CreateForeignServerStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateForeignServerStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateForeignServerStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateForeignServerStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateForeignServerStmt} CreateForeignServerStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateForeignServerStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateForeignServerStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.servername = reader.string(); + break; + } + case 2: { + message.servertype = reader.string(); + break; + } + case 3: { + message.version = reader.string(); + break; + } + case 4: { + message.fdwname = reader.string(); + break; + } + case 5: { + message.if_not_exists = reader.bool(); + break; + } + case 6: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateForeignServerStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateForeignServerStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateForeignServerStmt} CreateForeignServerStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateForeignServerStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateForeignServerStmt message. + * @function verify + * @memberof pg_query.CreateForeignServerStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateForeignServerStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.servername != null && message.hasOwnProperty("servername")) + if (!$util.isString(message.servername)) + return "servername: string expected"; + if (message.servertype != null && message.hasOwnProperty("servertype")) + if (!$util.isString(message.servertype)) + return "servertype: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.fdwname != null && message.hasOwnProperty("fdwname")) + if (!$util.isString(message.fdwname)) + return "fdwname: string expected"; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + if (typeof message.if_not_exists !== "boolean") + return "if_not_exists: boolean expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates a CreateForeignServerStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateForeignServerStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateForeignServerStmt} CreateForeignServerStmt + */ + CreateForeignServerStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateForeignServerStmt) + return object; + var message = new $root.pg_query.CreateForeignServerStmt(); + if (object.servername != null) + message.servername = String(object.servername); + if (object.servertype != null) + message.servertype = String(object.servertype); + if (object.version != null) + message.version = String(object.version); + if (object.fdwname != null) + message.fdwname = String(object.fdwname); + if (object.if_not_exists != null) + message.if_not_exists = Boolean(object.if_not_exists); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreateForeignServerStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreateForeignServerStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateForeignServerStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateForeignServerStmt + * @static + * @param {pg_query.CreateForeignServerStmt} message CreateForeignServerStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateForeignServerStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.servername = ""; + object.servertype = ""; + object.version = ""; + object.fdwname = ""; + object.if_not_exists = false; + } + if (message.servername != null && message.hasOwnProperty("servername")) + object.servername = message.servername; + if (message.servertype != null && message.hasOwnProperty("servertype")) + object.servertype = message.servertype; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.fdwname != null && message.hasOwnProperty("fdwname")) + object.fdwname = message.fdwname; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + object.if_not_exists = message.if_not_exists; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this CreateForeignServerStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateForeignServerStmt + * @instance + * @returns {Object.} JSON object + */ + CreateForeignServerStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateForeignServerStmt + * @function getTypeUrl + * @memberof pg_query.CreateForeignServerStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateForeignServerStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateForeignServerStmt"; + }; + + return CreateForeignServerStmt; + })(); + + pg_query.AlterForeignServerStmt = (function() { + + /** + * Properties of an AlterForeignServerStmt. + * @memberof pg_query + * @interface IAlterForeignServerStmt + * @property {string|null} [servername] AlterForeignServerStmt servername + * @property {string|null} [version] AlterForeignServerStmt version + * @property {Array.|null} [options] AlterForeignServerStmt options + * @property {boolean|null} [has_version] AlterForeignServerStmt has_version + */ + + /** + * Constructs a new AlterForeignServerStmt. + * @memberof pg_query + * @classdesc Represents an AlterForeignServerStmt. + * @implements IAlterForeignServerStmt + * @constructor + * @param {pg_query.IAlterForeignServerStmt=} [properties] Properties to set + */ + function AlterForeignServerStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterForeignServerStmt servername. + * @member {string} servername + * @memberof pg_query.AlterForeignServerStmt + * @instance + */ + AlterForeignServerStmt.prototype.servername = ""; + + /** + * AlterForeignServerStmt version. + * @member {string} version + * @memberof pg_query.AlterForeignServerStmt + * @instance + */ + AlterForeignServerStmt.prototype.version = ""; + + /** + * AlterForeignServerStmt options. + * @member {Array.} options + * @memberof pg_query.AlterForeignServerStmt + * @instance + */ + AlterForeignServerStmt.prototype.options = $util.emptyArray; + + /** + * AlterForeignServerStmt has_version. + * @member {boolean} has_version + * @memberof pg_query.AlterForeignServerStmt + * @instance + */ + AlterForeignServerStmt.prototype.has_version = false; + + /** + * Creates a new AlterForeignServerStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterForeignServerStmt + * @static + * @param {pg_query.IAlterForeignServerStmt=} [properties] Properties to set + * @returns {pg_query.AlterForeignServerStmt} AlterForeignServerStmt instance + */ + AlterForeignServerStmt.create = function create(properties) { + return new AlterForeignServerStmt(properties); + }; + + /** + * Encodes the specified AlterForeignServerStmt message. Does not implicitly {@link pg_query.AlterForeignServerStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterForeignServerStmt + * @static + * @param {pg_query.IAlterForeignServerStmt} message AlterForeignServerStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterForeignServerStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.servername != null && Object.hasOwnProperty.call(message, "servername")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.servername); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.has_version != null && Object.hasOwnProperty.call(message, "has_version")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.has_version); + return writer; + }; + + /** + * Encodes the specified AlterForeignServerStmt message, length delimited. Does not implicitly {@link pg_query.AlterForeignServerStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterForeignServerStmt + * @static + * @param {pg_query.IAlterForeignServerStmt} message AlterForeignServerStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterForeignServerStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterForeignServerStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterForeignServerStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterForeignServerStmt} AlterForeignServerStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterForeignServerStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterForeignServerStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.servername = reader.string(); + break; + } + case 2: { + message.version = reader.string(); + break; + } + case 3: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.has_version = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterForeignServerStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterForeignServerStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterForeignServerStmt} AlterForeignServerStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterForeignServerStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterForeignServerStmt message. + * @function verify + * @memberof pg_query.AlterForeignServerStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterForeignServerStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.servername != null && message.hasOwnProperty("servername")) + if (!$util.isString(message.servername)) + return "servername: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.has_version != null && message.hasOwnProperty("has_version")) + if (typeof message.has_version !== "boolean") + return "has_version: boolean expected"; + return null; + }; + + /** + * Creates an AlterForeignServerStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterForeignServerStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterForeignServerStmt} AlterForeignServerStmt + */ + AlterForeignServerStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterForeignServerStmt) + return object; + var message = new $root.pg_query.AlterForeignServerStmt(); + if (object.servername != null) + message.servername = String(object.servername); + if (object.version != null) + message.version = String(object.version); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterForeignServerStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterForeignServerStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.has_version != null) + message.has_version = Boolean(object.has_version); + return message; + }; + + /** + * Creates a plain object from an AlterForeignServerStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterForeignServerStmt + * @static + * @param {pg_query.AlterForeignServerStmt} message AlterForeignServerStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterForeignServerStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.servername = ""; + object.version = ""; + object.has_version = false; + } + if (message.servername != null && message.hasOwnProperty("servername")) + object.servername = message.servername; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.has_version != null && message.hasOwnProperty("has_version")) + object.has_version = message.has_version; + return object; + }; + + /** + * Converts this AlterForeignServerStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterForeignServerStmt + * @instance + * @returns {Object.} JSON object + */ + AlterForeignServerStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterForeignServerStmt + * @function getTypeUrl + * @memberof pg_query.AlterForeignServerStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterForeignServerStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterForeignServerStmt"; + }; + + return AlterForeignServerStmt; + })(); + + pg_query.CreateUserMappingStmt = (function() { + + /** + * Properties of a CreateUserMappingStmt. + * @memberof pg_query + * @interface ICreateUserMappingStmt + * @property {pg_query.IRoleSpec|null} [user] CreateUserMappingStmt user + * @property {string|null} [servername] CreateUserMappingStmt servername + * @property {boolean|null} [if_not_exists] CreateUserMappingStmt if_not_exists + * @property {Array.|null} [options] CreateUserMappingStmt options + */ + + /** + * Constructs a new CreateUserMappingStmt. + * @memberof pg_query + * @classdesc Represents a CreateUserMappingStmt. + * @implements ICreateUserMappingStmt + * @constructor + * @param {pg_query.ICreateUserMappingStmt=} [properties] Properties to set + */ + function CreateUserMappingStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateUserMappingStmt user. + * @member {pg_query.IRoleSpec|null|undefined} user + * @memberof pg_query.CreateUserMappingStmt + * @instance + */ + CreateUserMappingStmt.prototype.user = null; + + /** + * CreateUserMappingStmt servername. + * @member {string} servername + * @memberof pg_query.CreateUserMappingStmt + * @instance + */ + CreateUserMappingStmt.prototype.servername = ""; + + /** + * CreateUserMappingStmt if_not_exists. + * @member {boolean} if_not_exists + * @memberof pg_query.CreateUserMappingStmt + * @instance + */ + CreateUserMappingStmt.prototype.if_not_exists = false; + + /** + * CreateUserMappingStmt options. + * @member {Array.} options + * @memberof pg_query.CreateUserMappingStmt + * @instance + */ + CreateUserMappingStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new CreateUserMappingStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateUserMappingStmt + * @static + * @param {pg_query.ICreateUserMappingStmt=} [properties] Properties to set + * @returns {pg_query.CreateUserMappingStmt} CreateUserMappingStmt instance + */ + CreateUserMappingStmt.create = function create(properties) { + return new CreateUserMappingStmt(properties); + }; + + /** + * Encodes the specified CreateUserMappingStmt message. Does not implicitly {@link pg_query.CreateUserMappingStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateUserMappingStmt + * @static + * @param {pg_query.ICreateUserMappingStmt} message CreateUserMappingStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserMappingStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.pg_query.RoleSpec.encode(message.user, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.servername != null && Object.hasOwnProperty.call(message, "servername")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.servername); + if (message.if_not_exists != null && Object.hasOwnProperty.call(message, "if_not_exists")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.if_not_exists); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateUserMappingStmt message, length delimited. Does not implicitly {@link pg_query.CreateUserMappingStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateUserMappingStmt + * @static + * @param {pg_query.ICreateUserMappingStmt} message CreateUserMappingStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateUserMappingStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateUserMappingStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateUserMappingStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateUserMappingStmt} CreateUserMappingStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserMappingStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateUserMappingStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.user = $root.pg_query.RoleSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.servername = reader.string(); + break; + } + case 3: { + message.if_not_exists = reader.bool(); + break; + } + case 4: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateUserMappingStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateUserMappingStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateUserMappingStmt} CreateUserMappingStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateUserMappingStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateUserMappingStmt message. + * @function verify + * @memberof pg_query.CreateUserMappingStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateUserMappingStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.pg_query.RoleSpec.verify(message.user); + if (error) + return "user." + error; + } + if (message.servername != null && message.hasOwnProperty("servername")) + if (!$util.isString(message.servername)) + return "servername: string expected"; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + if (typeof message.if_not_exists !== "boolean") + return "if_not_exists: boolean expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates a CreateUserMappingStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateUserMappingStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateUserMappingStmt} CreateUserMappingStmt + */ + CreateUserMappingStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateUserMappingStmt) + return object; + var message = new $root.pg_query.CreateUserMappingStmt(); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".pg_query.CreateUserMappingStmt.user: object expected"); + message.user = $root.pg_query.RoleSpec.fromObject(object.user); + } + if (object.servername != null) + message.servername = String(object.servername); + if (object.if_not_exists != null) + message.if_not_exists = Boolean(object.if_not_exists); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreateUserMappingStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreateUserMappingStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateUserMappingStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateUserMappingStmt + * @static + * @param {pg_query.CreateUserMappingStmt} message CreateUserMappingStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateUserMappingStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.user = null; + object.servername = ""; + object.if_not_exists = false; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.pg_query.RoleSpec.toObject(message.user, options); + if (message.servername != null && message.hasOwnProperty("servername")) + object.servername = message.servername; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + object.if_not_exists = message.if_not_exists; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this CreateUserMappingStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateUserMappingStmt + * @instance + * @returns {Object.} JSON object + */ + CreateUserMappingStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateUserMappingStmt + * @function getTypeUrl + * @memberof pg_query.CreateUserMappingStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateUserMappingStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateUserMappingStmt"; + }; + + return CreateUserMappingStmt; + })(); + + pg_query.AlterUserMappingStmt = (function() { + + /** + * Properties of an AlterUserMappingStmt. + * @memberof pg_query + * @interface IAlterUserMappingStmt + * @property {pg_query.IRoleSpec|null} [user] AlterUserMappingStmt user + * @property {string|null} [servername] AlterUserMappingStmt servername + * @property {Array.|null} [options] AlterUserMappingStmt options + */ + + /** + * Constructs a new AlterUserMappingStmt. + * @memberof pg_query + * @classdesc Represents an AlterUserMappingStmt. + * @implements IAlterUserMappingStmt + * @constructor + * @param {pg_query.IAlterUserMappingStmt=} [properties] Properties to set + */ + function AlterUserMappingStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterUserMappingStmt user. + * @member {pg_query.IRoleSpec|null|undefined} user + * @memberof pg_query.AlterUserMappingStmt + * @instance + */ + AlterUserMappingStmt.prototype.user = null; + + /** + * AlterUserMappingStmt servername. + * @member {string} servername + * @memberof pg_query.AlterUserMappingStmt + * @instance + */ + AlterUserMappingStmt.prototype.servername = ""; + + /** + * AlterUserMappingStmt options. + * @member {Array.} options + * @memberof pg_query.AlterUserMappingStmt + * @instance + */ + AlterUserMappingStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new AlterUserMappingStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterUserMappingStmt + * @static + * @param {pg_query.IAlterUserMappingStmt=} [properties] Properties to set + * @returns {pg_query.AlterUserMappingStmt} AlterUserMappingStmt instance + */ + AlterUserMappingStmt.create = function create(properties) { + return new AlterUserMappingStmt(properties); + }; + + /** + * Encodes the specified AlterUserMappingStmt message. Does not implicitly {@link pg_query.AlterUserMappingStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterUserMappingStmt + * @static + * @param {pg_query.IAlterUserMappingStmt} message AlterUserMappingStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterUserMappingStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.pg_query.RoleSpec.encode(message.user, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.servername != null && Object.hasOwnProperty.call(message, "servername")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.servername); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterUserMappingStmt message, length delimited. Does not implicitly {@link pg_query.AlterUserMappingStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterUserMappingStmt + * @static + * @param {pg_query.IAlterUserMappingStmt} message AlterUserMappingStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterUserMappingStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterUserMappingStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterUserMappingStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterUserMappingStmt} AlterUserMappingStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterUserMappingStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterUserMappingStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.user = $root.pg_query.RoleSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.servername = reader.string(); + break; + } + case 3: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterUserMappingStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterUserMappingStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterUserMappingStmt} AlterUserMappingStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterUserMappingStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterUserMappingStmt message. + * @function verify + * @memberof pg_query.AlterUserMappingStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterUserMappingStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.pg_query.RoleSpec.verify(message.user); + if (error) + return "user." + error; + } + if (message.servername != null && message.hasOwnProperty("servername")) + if (!$util.isString(message.servername)) + return "servername: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates an AlterUserMappingStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterUserMappingStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterUserMappingStmt} AlterUserMappingStmt + */ + AlterUserMappingStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterUserMappingStmt) + return object; + var message = new $root.pg_query.AlterUserMappingStmt(); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".pg_query.AlterUserMappingStmt.user: object expected"); + message.user = $root.pg_query.RoleSpec.fromObject(object.user); + } + if (object.servername != null) + message.servername = String(object.servername); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterUserMappingStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterUserMappingStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlterUserMappingStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterUserMappingStmt + * @static + * @param {pg_query.AlterUserMappingStmt} message AlterUserMappingStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterUserMappingStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.user = null; + object.servername = ""; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.pg_query.RoleSpec.toObject(message.user, options); + if (message.servername != null && message.hasOwnProperty("servername")) + object.servername = message.servername; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this AlterUserMappingStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterUserMappingStmt + * @instance + * @returns {Object.} JSON object + */ + AlterUserMappingStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterUserMappingStmt + * @function getTypeUrl + * @memberof pg_query.AlterUserMappingStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterUserMappingStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterUserMappingStmt"; + }; + + return AlterUserMappingStmt; + })(); + + pg_query.DropUserMappingStmt = (function() { + + /** + * Properties of a DropUserMappingStmt. + * @memberof pg_query + * @interface IDropUserMappingStmt + * @property {pg_query.IRoleSpec|null} [user] DropUserMappingStmt user + * @property {string|null} [servername] DropUserMappingStmt servername + * @property {boolean|null} [missing_ok] DropUserMappingStmt missing_ok + */ + + /** + * Constructs a new DropUserMappingStmt. + * @memberof pg_query + * @classdesc Represents a DropUserMappingStmt. + * @implements IDropUserMappingStmt + * @constructor + * @param {pg_query.IDropUserMappingStmt=} [properties] Properties to set + */ + function DropUserMappingStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DropUserMappingStmt user. + * @member {pg_query.IRoleSpec|null|undefined} user + * @memberof pg_query.DropUserMappingStmt + * @instance + */ + DropUserMappingStmt.prototype.user = null; + + /** + * DropUserMappingStmt servername. + * @member {string} servername + * @memberof pg_query.DropUserMappingStmt + * @instance + */ + DropUserMappingStmt.prototype.servername = ""; + + /** + * DropUserMappingStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.DropUserMappingStmt + * @instance + */ + DropUserMappingStmt.prototype.missing_ok = false; + + /** + * Creates a new DropUserMappingStmt instance using the specified properties. + * @function create + * @memberof pg_query.DropUserMappingStmt + * @static + * @param {pg_query.IDropUserMappingStmt=} [properties] Properties to set + * @returns {pg_query.DropUserMappingStmt} DropUserMappingStmt instance + */ + DropUserMappingStmt.create = function create(properties) { + return new DropUserMappingStmt(properties); + }; + + /** + * Encodes the specified DropUserMappingStmt message. Does not implicitly {@link pg_query.DropUserMappingStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DropUserMappingStmt + * @static + * @param {pg_query.IDropUserMappingStmt} message DropUserMappingStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropUserMappingStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.pg_query.RoleSpec.encode(message.user, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.servername != null && Object.hasOwnProperty.call(message, "servername")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.servername); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.missing_ok); + return writer; + }; + + /** + * Encodes the specified DropUserMappingStmt message, length delimited. Does not implicitly {@link pg_query.DropUserMappingStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DropUserMappingStmt + * @static + * @param {pg_query.IDropUserMappingStmt} message DropUserMappingStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropUserMappingStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DropUserMappingStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DropUserMappingStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DropUserMappingStmt} DropUserMappingStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropUserMappingStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DropUserMappingStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.user = $root.pg_query.RoleSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.servername = reader.string(); + break; + } + case 3: { + message.missing_ok = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DropUserMappingStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DropUserMappingStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DropUserMappingStmt} DropUserMappingStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropUserMappingStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DropUserMappingStmt message. + * @function verify + * @memberof pg_query.DropUserMappingStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DropUserMappingStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.pg_query.RoleSpec.verify(message.user); + if (error) + return "user." + error; + } + if (message.servername != null && message.hasOwnProperty("servername")) + if (!$util.isString(message.servername)) + return "servername: string expected"; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + return null; + }; + + /** + * Creates a DropUserMappingStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DropUserMappingStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DropUserMappingStmt} DropUserMappingStmt + */ + DropUserMappingStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DropUserMappingStmt) + return object; + var message = new $root.pg_query.DropUserMappingStmt(); + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".pg_query.DropUserMappingStmt.user: object expected"); + message.user = $root.pg_query.RoleSpec.fromObject(object.user); + } + if (object.servername != null) + message.servername = String(object.servername); + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + return message; + }; + + /** + * Creates a plain object from a DropUserMappingStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DropUserMappingStmt + * @static + * @param {pg_query.DropUserMappingStmt} message DropUserMappingStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DropUserMappingStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.user = null; + object.servername = ""; + object.missing_ok = false; + } + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.pg_query.RoleSpec.toObject(message.user, options); + if (message.servername != null && message.hasOwnProperty("servername")) + object.servername = message.servername; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + return object; + }; + + /** + * Converts this DropUserMappingStmt to JSON. + * @function toJSON + * @memberof pg_query.DropUserMappingStmt + * @instance + * @returns {Object.} JSON object + */ + DropUserMappingStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DropUserMappingStmt + * @function getTypeUrl + * @memberof pg_query.DropUserMappingStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DropUserMappingStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DropUserMappingStmt"; + }; + + return DropUserMappingStmt; + })(); + + pg_query.AlterTableSpaceOptionsStmt = (function() { + + /** + * Properties of an AlterTableSpaceOptionsStmt. + * @memberof pg_query + * @interface IAlterTableSpaceOptionsStmt + * @property {string|null} [tablespacename] AlterTableSpaceOptionsStmt tablespacename + * @property {Array.|null} [options] AlterTableSpaceOptionsStmt options + * @property {boolean|null} [isReset] AlterTableSpaceOptionsStmt isReset + */ + + /** + * Constructs a new AlterTableSpaceOptionsStmt. + * @memberof pg_query + * @classdesc Represents an AlterTableSpaceOptionsStmt. + * @implements IAlterTableSpaceOptionsStmt + * @constructor + * @param {pg_query.IAlterTableSpaceOptionsStmt=} [properties] Properties to set + */ + function AlterTableSpaceOptionsStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterTableSpaceOptionsStmt tablespacename. + * @member {string} tablespacename + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @instance + */ + AlterTableSpaceOptionsStmt.prototype.tablespacename = ""; + + /** + * AlterTableSpaceOptionsStmt options. + * @member {Array.} options + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @instance + */ + AlterTableSpaceOptionsStmt.prototype.options = $util.emptyArray; + + /** + * AlterTableSpaceOptionsStmt isReset. + * @member {boolean} isReset + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @instance + */ + AlterTableSpaceOptionsStmt.prototype.isReset = false; + + /** + * Creates a new AlterTableSpaceOptionsStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @static + * @param {pg_query.IAlterTableSpaceOptionsStmt=} [properties] Properties to set + * @returns {pg_query.AlterTableSpaceOptionsStmt} AlterTableSpaceOptionsStmt instance + */ + AlterTableSpaceOptionsStmt.create = function create(properties) { + return new AlterTableSpaceOptionsStmt(properties); + }; + + /** + * Encodes the specified AlterTableSpaceOptionsStmt message. Does not implicitly {@link pg_query.AlterTableSpaceOptionsStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @static + * @param {pg_query.IAlterTableSpaceOptionsStmt} message AlterTableSpaceOptionsStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTableSpaceOptionsStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tablespacename != null && Object.hasOwnProperty.call(message, "tablespacename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tablespacename); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.isReset != null && Object.hasOwnProperty.call(message, "isReset")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isReset); + return writer; + }; + + /** + * Encodes the specified AlterTableSpaceOptionsStmt message, length delimited. Does not implicitly {@link pg_query.AlterTableSpaceOptionsStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @static + * @param {pg_query.IAlterTableSpaceOptionsStmt} message AlterTableSpaceOptionsStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTableSpaceOptionsStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterTableSpaceOptionsStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterTableSpaceOptionsStmt} AlterTableSpaceOptionsStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTableSpaceOptionsStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterTableSpaceOptionsStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tablespacename = reader.string(); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.isReset = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterTableSpaceOptionsStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterTableSpaceOptionsStmt} AlterTableSpaceOptionsStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTableSpaceOptionsStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterTableSpaceOptionsStmt message. + * @function verify + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterTableSpaceOptionsStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tablespacename != null && message.hasOwnProperty("tablespacename")) + if (!$util.isString(message.tablespacename)) + return "tablespacename: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.isReset != null && message.hasOwnProperty("isReset")) + if (typeof message.isReset !== "boolean") + return "isReset: boolean expected"; + return null; + }; + + /** + * Creates an AlterTableSpaceOptionsStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterTableSpaceOptionsStmt} AlterTableSpaceOptionsStmt + */ + AlterTableSpaceOptionsStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterTableSpaceOptionsStmt) + return object; + var message = new $root.pg_query.AlterTableSpaceOptionsStmt(); + if (object.tablespacename != null) + message.tablespacename = String(object.tablespacename); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterTableSpaceOptionsStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterTableSpaceOptionsStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.isReset != null) + message.isReset = Boolean(object.isReset); + return message; + }; + + /** + * Creates a plain object from an AlterTableSpaceOptionsStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @static + * @param {pg_query.AlterTableSpaceOptionsStmt} message AlterTableSpaceOptionsStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterTableSpaceOptionsStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.tablespacename = ""; + object.isReset = false; + } + if (message.tablespacename != null && message.hasOwnProperty("tablespacename")) + object.tablespacename = message.tablespacename; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.isReset != null && message.hasOwnProperty("isReset")) + object.isReset = message.isReset; + return object; + }; + + /** + * Converts this AlterTableSpaceOptionsStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @instance + * @returns {Object.} JSON object + */ + AlterTableSpaceOptionsStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterTableSpaceOptionsStmt + * @function getTypeUrl + * @memberof pg_query.AlterTableSpaceOptionsStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterTableSpaceOptionsStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterTableSpaceOptionsStmt"; + }; + + return AlterTableSpaceOptionsStmt; + })(); + + pg_query.AlterTableMoveAllStmt = (function() { + + /** + * Properties of an AlterTableMoveAllStmt. + * @memberof pg_query + * @interface IAlterTableMoveAllStmt + * @property {string|null} [orig_tablespacename] AlterTableMoveAllStmt orig_tablespacename + * @property {pg_query.ObjectType|null} [objtype] AlterTableMoveAllStmt objtype + * @property {Array.|null} [roles] AlterTableMoveAllStmt roles + * @property {string|null} [new_tablespacename] AlterTableMoveAllStmt new_tablespacename + * @property {boolean|null} [nowait] AlterTableMoveAllStmt nowait + */ + + /** + * Constructs a new AlterTableMoveAllStmt. + * @memberof pg_query + * @classdesc Represents an AlterTableMoveAllStmt. + * @implements IAlterTableMoveAllStmt + * @constructor + * @param {pg_query.IAlterTableMoveAllStmt=} [properties] Properties to set + */ + function AlterTableMoveAllStmt(properties) { + this.roles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterTableMoveAllStmt orig_tablespacename. + * @member {string} orig_tablespacename + * @memberof pg_query.AlterTableMoveAllStmt + * @instance + */ + AlterTableMoveAllStmt.prototype.orig_tablespacename = ""; + + /** + * AlterTableMoveAllStmt objtype. + * @member {pg_query.ObjectType} objtype + * @memberof pg_query.AlterTableMoveAllStmt + * @instance + */ + AlterTableMoveAllStmt.prototype.objtype = 0; + + /** + * AlterTableMoveAllStmt roles. + * @member {Array.} roles + * @memberof pg_query.AlterTableMoveAllStmt + * @instance + */ + AlterTableMoveAllStmt.prototype.roles = $util.emptyArray; + + /** + * AlterTableMoveAllStmt new_tablespacename. + * @member {string} new_tablespacename + * @memberof pg_query.AlterTableMoveAllStmt + * @instance + */ + AlterTableMoveAllStmt.prototype.new_tablespacename = ""; + + /** + * AlterTableMoveAllStmt nowait. + * @member {boolean} nowait + * @memberof pg_query.AlterTableMoveAllStmt + * @instance + */ + AlterTableMoveAllStmt.prototype.nowait = false; + + /** + * Creates a new AlterTableMoveAllStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterTableMoveAllStmt + * @static + * @param {pg_query.IAlterTableMoveAllStmt=} [properties] Properties to set + * @returns {pg_query.AlterTableMoveAllStmt} AlterTableMoveAllStmt instance + */ + AlterTableMoveAllStmt.create = function create(properties) { + return new AlterTableMoveAllStmt(properties); + }; + + /** + * Encodes the specified AlterTableMoveAllStmt message. Does not implicitly {@link pg_query.AlterTableMoveAllStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterTableMoveAllStmt + * @static + * @param {pg_query.IAlterTableMoveAllStmt} message AlterTableMoveAllStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTableMoveAllStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.orig_tablespacename != null && Object.hasOwnProperty.call(message, "orig_tablespacename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.orig_tablespacename); + if (message.objtype != null && Object.hasOwnProperty.call(message, "objtype")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.objtype); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + $root.pg_query.Node.encode(message.roles[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.new_tablespacename != null && Object.hasOwnProperty.call(message, "new_tablespacename")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.new_tablespacename); + if (message.nowait != null && Object.hasOwnProperty.call(message, "nowait")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.nowait); + return writer; + }; + + /** + * Encodes the specified AlterTableMoveAllStmt message, length delimited. Does not implicitly {@link pg_query.AlterTableMoveAllStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterTableMoveAllStmt + * @static + * @param {pg_query.IAlterTableMoveAllStmt} message AlterTableMoveAllStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterTableMoveAllStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterTableMoveAllStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterTableMoveAllStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterTableMoveAllStmt} AlterTableMoveAllStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTableMoveAllStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterTableMoveAllStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.orig_tablespacename = reader.string(); + break; + } + case 2: { + message.objtype = reader.int32(); + break; + } + case 3: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.new_tablespacename = reader.string(); + break; + } + case 5: { + message.nowait = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterTableMoveAllStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterTableMoveAllStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterTableMoveAllStmt} AlterTableMoveAllStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterTableMoveAllStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterTableMoveAllStmt message. + * @function verify + * @memberof pg_query.AlterTableMoveAllStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterTableMoveAllStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.orig_tablespacename != null && message.hasOwnProperty("orig_tablespacename")) + if (!$util.isString(message.orig_tablespacename)) + return "orig_tablespacename: string expected"; + if (message.objtype != null && message.hasOwnProperty("objtype")) + switch (message.objtype) { + default: + return "objtype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) { + var error = $root.pg_query.Node.verify(message.roles[i]); + if (error) + return "roles." + error; + } + } + if (message.new_tablespacename != null && message.hasOwnProperty("new_tablespacename")) + if (!$util.isString(message.new_tablespacename)) + return "new_tablespacename: string expected"; + if (message.nowait != null && message.hasOwnProperty("nowait")) + if (typeof message.nowait !== "boolean") + return "nowait: boolean expected"; + return null; + }; + + /** + * Creates an AlterTableMoveAllStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterTableMoveAllStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterTableMoveAllStmt} AlterTableMoveAllStmt + */ + AlterTableMoveAllStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterTableMoveAllStmt) + return object; + var message = new $root.pg_query.AlterTableMoveAllStmt(); + if (object.orig_tablespacename != null) + message.orig_tablespacename = String(object.orig_tablespacename); + switch (object.objtype) { + default: + if (typeof object.objtype === "number") { + message.objtype = object.objtype; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.objtype = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.objtype = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.objtype = 2; + break; + case "OBJECT_AMOP": + case 3: + message.objtype = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.objtype = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.objtype = 5; + break; + case "OBJECT_CAST": + case 6: + message.objtype = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.objtype = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.objtype = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.objtype = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.objtype = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.objtype = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.objtype = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.objtype = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.objtype = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.objtype = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.objtype = 16; + break; + case "OBJECT_FDW": + case 17: + message.objtype = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.objtype = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.objtype = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.objtype = 20; + break; + case "OBJECT_INDEX": + case 21: + message.objtype = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.objtype = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.objtype = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.objtype = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.objtype = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.objtype = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.objtype = 27; + break; + case "OBJECT_POLICY": + case 28: + message.objtype = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.objtype = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.objtype = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.objtype = 31; + break; + case "OBJECT_ROLE": + case 32: + message.objtype = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.objtype = 33; + break; + case "OBJECT_RULE": + case 34: + message.objtype = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.objtype = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.objtype = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.objtype = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.objtype = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.objtype = 39; + break; + case "OBJECT_TABLE": + case 40: + message.objtype = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.objtype = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.objtype = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.objtype = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.objtype = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.objtype = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.objtype = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.objtype = 47; + break; + case "OBJECT_TYPE": + case 48: + message.objtype = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.objtype = 49; + break; + case "OBJECT_VIEW": + case 50: + message.objtype = 50; + break; + } + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".pg_query.AlterTableMoveAllStmt.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) { + if (typeof object.roles[i] !== "object") + throw TypeError(".pg_query.AlterTableMoveAllStmt.roles: object expected"); + message.roles[i] = $root.pg_query.Node.fromObject(object.roles[i]); + } + } + if (object.new_tablespacename != null) + message.new_tablespacename = String(object.new_tablespacename); + if (object.nowait != null) + message.nowait = Boolean(object.nowait); + return message; + }; + + /** + * Creates a plain object from an AlterTableMoveAllStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterTableMoveAllStmt + * @static + * @param {pg_query.AlterTableMoveAllStmt} message AlterTableMoveAllStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterTableMoveAllStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.roles = []; + if (options.defaults) { + object.orig_tablespacename = ""; + object.objtype = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.new_tablespacename = ""; + object.nowait = false; + } + if (message.orig_tablespacename != null && message.hasOwnProperty("orig_tablespacename")) + object.orig_tablespacename = message.orig_tablespacename; + if (message.objtype != null && message.hasOwnProperty("objtype")) + object.objtype = options.enums === String ? $root.pg_query.ObjectType[message.objtype] === undefined ? message.objtype : $root.pg_query.ObjectType[message.objtype] : message.objtype; + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = $root.pg_query.Node.toObject(message.roles[j], options); + } + if (message.new_tablespacename != null && message.hasOwnProperty("new_tablespacename")) + object.new_tablespacename = message.new_tablespacename; + if (message.nowait != null && message.hasOwnProperty("nowait")) + object.nowait = message.nowait; + return object; + }; + + /** + * Converts this AlterTableMoveAllStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterTableMoveAllStmt + * @instance + * @returns {Object.} JSON object + */ + AlterTableMoveAllStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterTableMoveAllStmt + * @function getTypeUrl + * @memberof pg_query.AlterTableMoveAllStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterTableMoveAllStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterTableMoveAllStmt"; + }; + + return AlterTableMoveAllStmt; + })(); + + pg_query.SecLabelStmt = (function() { + + /** + * Properties of a SecLabelStmt. + * @memberof pg_query + * @interface ISecLabelStmt + * @property {pg_query.ObjectType|null} [objtype] SecLabelStmt objtype + * @property {pg_query.INode|null} [object] SecLabelStmt object + * @property {string|null} [provider] SecLabelStmt provider + * @property {string|null} [label] SecLabelStmt label + */ + + /** + * Constructs a new SecLabelStmt. + * @memberof pg_query + * @classdesc Represents a SecLabelStmt. + * @implements ISecLabelStmt + * @constructor + * @param {pg_query.ISecLabelStmt=} [properties] Properties to set + */ + function SecLabelStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecLabelStmt objtype. + * @member {pg_query.ObjectType} objtype + * @memberof pg_query.SecLabelStmt + * @instance + */ + SecLabelStmt.prototype.objtype = 0; + + /** + * SecLabelStmt object. + * @member {pg_query.INode|null|undefined} object + * @memberof pg_query.SecLabelStmt + * @instance + */ + SecLabelStmt.prototype.object = null; + + /** + * SecLabelStmt provider. + * @member {string} provider + * @memberof pg_query.SecLabelStmt + * @instance + */ + SecLabelStmt.prototype.provider = ""; + + /** + * SecLabelStmt label. + * @member {string} label + * @memberof pg_query.SecLabelStmt + * @instance + */ + SecLabelStmt.prototype.label = ""; + + /** + * Creates a new SecLabelStmt instance using the specified properties. + * @function create + * @memberof pg_query.SecLabelStmt + * @static + * @param {pg_query.ISecLabelStmt=} [properties] Properties to set + * @returns {pg_query.SecLabelStmt} SecLabelStmt instance + */ + SecLabelStmt.create = function create(properties) { + return new SecLabelStmt(properties); + }; + + /** + * Encodes the specified SecLabelStmt message. Does not implicitly {@link pg_query.SecLabelStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.SecLabelStmt + * @static + * @param {pg_query.ISecLabelStmt} message SecLabelStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecLabelStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objtype != null && Object.hasOwnProperty.call(message, "objtype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.objtype); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + $root.pg_query.Node.encode(message.object, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.provider != null && Object.hasOwnProperty.call(message, "provider")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.provider); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.label); + return writer; + }; + + /** + * Encodes the specified SecLabelStmt message, length delimited. Does not implicitly {@link pg_query.SecLabelStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.SecLabelStmt + * @static + * @param {pg_query.ISecLabelStmt} message SecLabelStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecLabelStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecLabelStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.SecLabelStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.SecLabelStmt} SecLabelStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecLabelStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.SecLabelStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.objtype = reader.int32(); + break; + } + case 2: { + message.object = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.provider = reader.string(); + break; + } + case 4: { + message.label = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecLabelStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.SecLabelStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.SecLabelStmt} SecLabelStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecLabelStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecLabelStmt message. + * @function verify + * @memberof pg_query.SecLabelStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecLabelStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objtype != null && message.hasOwnProperty("objtype")) + switch (message.objtype) { + default: + return "objtype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.object != null && message.hasOwnProperty("object")) { + var error = $root.pg_query.Node.verify(message.object); + if (error) + return "object." + error; + } + if (message.provider != null && message.hasOwnProperty("provider")) + if (!$util.isString(message.provider)) + return "provider: string expected"; + if (message.label != null && message.hasOwnProperty("label")) + if (!$util.isString(message.label)) + return "label: string expected"; + return null; + }; + + /** + * Creates a SecLabelStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.SecLabelStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.SecLabelStmt} SecLabelStmt + */ + SecLabelStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.SecLabelStmt) + return object; + var message = new $root.pg_query.SecLabelStmt(); + switch (object.objtype) { + default: + if (typeof object.objtype === "number") { + message.objtype = object.objtype; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.objtype = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.objtype = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.objtype = 2; + break; + case "OBJECT_AMOP": + case 3: + message.objtype = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.objtype = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.objtype = 5; + break; + case "OBJECT_CAST": + case 6: + message.objtype = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.objtype = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.objtype = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.objtype = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.objtype = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.objtype = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.objtype = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.objtype = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.objtype = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.objtype = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.objtype = 16; + break; + case "OBJECT_FDW": + case 17: + message.objtype = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.objtype = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.objtype = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.objtype = 20; + break; + case "OBJECT_INDEX": + case 21: + message.objtype = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.objtype = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.objtype = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.objtype = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.objtype = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.objtype = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.objtype = 27; + break; + case "OBJECT_POLICY": + case 28: + message.objtype = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.objtype = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.objtype = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.objtype = 31; + break; + case "OBJECT_ROLE": + case 32: + message.objtype = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.objtype = 33; + break; + case "OBJECT_RULE": + case 34: + message.objtype = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.objtype = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.objtype = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.objtype = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.objtype = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.objtype = 39; + break; + case "OBJECT_TABLE": + case 40: + message.objtype = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.objtype = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.objtype = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.objtype = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.objtype = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.objtype = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.objtype = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.objtype = 47; + break; + case "OBJECT_TYPE": + case 48: + message.objtype = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.objtype = 49; + break; + case "OBJECT_VIEW": + case 50: + message.objtype = 50; + break; + } + if (object.object != null) { + if (typeof object.object !== "object") + throw TypeError(".pg_query.SecLabelStmt.object: object expected"); + message.object = $root.pg_query.Node.fromObject(object.object); + } + if (object.provider != null) + message.provider = String(object.provider); + if (object.label != null) + message.label = String(object.label); + return message; + }; + + /** + * Creates a plain object from a SecLabelStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.SecLabelStmt + * @static + * @param {pg_query.SecLabelStmt} message SecLabelStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecLabelStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.objtype = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.object = null; + object.provider = ""; + object.label = ""; + } + if (message.objtype != null && message.hasOwnProperty("objtype")) + object.objtype = options.enums === String ? $root.pg_query.ObjectType[message.objtype] === undefined ? message.objtype : $root.pg_query.ObjectType[message.objtype] : message.objtype; + if (message.object != null && message.hasOwnProperty("object")) + object.object = $root.pg_query.Node.toObject(message.object, options); + if (message.provider != null && message.hasOwnProperty("provider")) + object.provider = message.provider; + if (message.label != null && message.hasOwnProperty("label")) + object.label = message.label; + return object; + }; + + /** + * Converts this SecLabelStmt to JSON. + * @function toJSON + * @memberof pg_query.SecLabelStmt + * @instance + * @returns {Object.} JSON object + */ + SecLabelStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecLabelStmt + * @function getTypeUrl + * @memberof pg_query.SecLabelStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecLabelStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.SecLabelStmt"; + }; + + return SecLabelStmt; + })(); + + pg_query.CreateForeignTableStmt = (function() { + + /** + * Properties of a CreateForeignTableStmt. + * @memberof pg_query + * @interface ICreateForeignTableStmt + * @property {pg_query.ICreateStmt|null} [base] CreateForeignTableStmt base + * @property {string|null} [servername] CreateForeignTableStmt servername + * @property {Array.|null} [options] CreateForeignTableStmt options + */ + + /** + * Constructs a new CreateForeignTableStmt. + * @memberof pg_query + * @classdesc Represents a CreateForeignTableStmt. + * @implements ICreateForeignTableStmt + * @constructor + * @param {pg_query.ICreateForeignTableStmt=} [properties] Properties to set + */ + function CreateForeignTableStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateForeignTableStmt base. + * @member {pg_query.ICreateStmt|null|undefined} base + * @memberof pg_query.CreateForeignTableStmt + * @instance + */ + CreateForeignTableStmt.prototype.base = null; + + /** + * CreateForeignTableStmt servername. + * @member {string} servername + * @memberof pg_query.CreateForeignTableStmt + * @instance + */ + CreateForeignTableStmt.prototype.servername = ""; + + /** + * CreateForeignTableStmt options. + * @member {Array.} options + * @memberof pg_query.CreateForeignTableStmt + * @instance + */ + CreateForeignTableStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new CreateForeignTableStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateForeignTableStmt + * @static + * @param {pg_query.ICreateForeignTableStmt=} [properties] Properties to set + * @returns {pg_query.CreateForeignTableStmt} CreateForeignTableStmt instance + */ + CreateForeignTableStmt.create = function create(properties) { + return new CreateForeignTableStmt(properties); + }; + + /** + * Encodes the specified CreateForeignTableStmt message. Does not implicitly {@link pg_query.CreateForeignTableStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateForeignTableStmt + * @static + * @param {pg_query.ICreateForeignTableStmt} message CreateForeignTableStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateForeignTableStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.base != null && Object.hasOwnProperty.call(message, "base")) + $root.pg_query.CreateStmt.encode(message.base, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.servername != null && Object.hasOwnProperty.call(message, "servername")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.servername); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateForeignTableStmt message, length delimited. Does not implicitly {@link pg_query.CreateForeignTableStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateForeignTableStmt + * @static + * @param {pg_query.ICreateForeignTableStmt} message CreateForeignTableStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateForeignTableStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateForeignTableStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateForeignTableStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateForeignTableStmt} CreateForeignTableStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateForeignTableStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateForeignTableStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.base = $root.pg_query.CreateStmt.decode(reader, reader.uint32()); + break; + } + case 2: { + message.servername = reader.string(); + break; + } + case 3: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateForeignTableStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateForeignTableStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateForeignTableStmt} CreateForeignTableStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateForeignTableStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateForeignTableStmt message. + * @function verify + * @memberof pg_query.CreateForeignTableStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateForeignTableStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.base != null && message.hasOwnProperty("base")) { + var error = $root.pg_query.CreateStmt.verify(message.base); + if (error) + return "base." + error; + } + if (message.servername != null && message.hasOwnProperty("servername")) + if (!$util.isString(message.servername)) + return "servername: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates a CreateForeignTableStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateForeignTableStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateForeignTableStmt} CreateForeignTableStmt + */ + CreateForeignTableStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateForeignTableStmt) + return object; + var message = new $root.pg_query.CreateForeignTableStmt(); + if (object.base != null) { + if (typeof object.base !== "object") + throw TypeError(".pg_query.CreateForeignTableStmt.base: object expected"); + message.base = $root.pg_query.CreateStmt.fromObject(object.base); + } + if (object.servername != null) + message.servername = String(object.servername); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreateForeignTableStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreateForeignTableStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateForeignTableStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateForeignTableStmt + * @static + * @param {pg_query.CreateForeignTableStmt} message CreateForeignTableStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateForeignTableStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.base = null; + object.servername = ""; + } + if (message.base != null && message.hasOwnProperty("base")) + object.base = $root.pg_query.CreateStmt.toObject(message.base, options); + if (message.servername != null && message.hasOwnProperty("servername")) + object.servername = message.servername; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this CreateForeignTableStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateForeignTableStmt + * @instance + * @returns {Object.} JSON object + */ + CreateForeignTableStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateForeignTableStmt + * @function getTypeUrl + * @memberof pg_query.CreateForeignTableStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateForeignTableStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateForeignTableStmt"; + }; + + return CreateForeignTableStmt; + })(); + + pg_query.ImportForeignSchemaStmt = (function() { + + /** + * Properties of an ImportForeignSchemaStmt. + * @memberof pg_query + * @interface IImportForeignSchemaStmt + * @property {string|null} [server_name] ImportForeignSchemaStmt server_name + * @property {string|null} [remote_schema] ImportForeignSchemaStmt remote_schema + * @property {string|null} [local_schema] ImportForeignSchemaStmt local_schema + * @property {pg_query.ImportForeignSchemaType|null} [list_type] ImportForeignSchemaStmt list_type + * @property {Array.|null} [table_list] ImportForeignSchemaStmt table_list + * @property {Array.|null} [options] ImportForeignSchemaStmt options + */ + + /** + * Constructs a new ImportForeignSchemaStmt. + * @memberof pg_query + * @classdesc Represents an ImportForeignSchemaStmt. + * @implements IImportForeignSchemaStmt + * @constructor + * @param {pg_query.IImportForeignSchemaStmt=} [properties] Properties to set + */ + function ImportForeignSchemaStmt(properties) { + this.table_list = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportForeignSchemaStmt server_name. + * @member {string} server_name + * @memberof pg_query.ImportForeignSchemaStmt + * @instance + */ + ImportForeignSchemaStmt.prototype.server_name = ""; + + /** + * ImportForeignSchemaStmt remote_schema. + * @member {string} remote_schema + * @memberof pg_query.ImportForeignSchemaStmt + * @instance + */ + ImportForeignSchemaStmt.prototype.remote_schema = ""; + + /** + * ImportForeignSchemaStmt local_schema. + * @member {string} local_schema + * @memberof pg_query.ImportForeignSchemaStmt + * @instance + */ + ImportForeignSchemaStmt.prototype.local_schema = ""; + + /** + * ImportForeignSchemaStmt list_type. + * @member {pg_query.ImportForeignSchemaType} list_type + * @memberof pg_query.ImportForeignSchemaStmt + * @instance + */ + ImportForeignSchemaStmt.prototype.list_type = 0; + + /** + * ImportForeignSchemaStmt table_list. + * @member {Array.} table_list + * @memberof pg_query.ImportForeignSchemaStmt + * @instance + */ + ImportForeignSchemaStmt.prototype.table_list = $util.emptyArray; + + /** + * ImportForeignSchemaStmt options. + * @member {Array.} options + * @memberof pg_query.ImportForeignSchemaStmt + * @instance + */ + ImportForeignSchemaStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new ImportForeignSchemaStmt instance using the specified properties. + * @function create + * @memberof pg_query.ImportForeignSchemaStmt + * @static + * @param {pg_query.IImportForeignSchemaStmt=} [properties] Properties to set + * @returns {pg_query.ImportForeignSchemaStmt} ImportForeignSchemaStmt instance + */ + ImportForeignSchemaStmt.create = function create(properties) { + return new ImportForeignSchemaStmt(properties); + }; + + /** + * Encodes the specified ImportForeignSchemaStmt message. Does not implicitly {@link pg_query.ImportForeignSchemaStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.ImportForeignSchemaStmt + * @static + * @param {pg_query.IImportForeignSchemaStmt} message ImportForeignSchemaStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportForeignSchemaStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.server_name != null && Object.hasOwnProperty.call(message, "server_name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.server_name); + if (message.remote_schema != null && Object.hasOwnProperty.call(message, "remote_schema")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.remote_schema); + if (message.local_schema != null && Object.hasOwnProperty.call(message, "local_schema")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.local_schema); + if (message.list_type != null && Object.hasOwnProperty.call(message, "list_type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.list_type); + if (message.table_list != null && message.table_list.length) + for (var i = 0; i < message.table_list.length; ++i) + $root.pg_query.Node.encode(message.table_list[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ImportForeignSchemaStmt message, length delimited. Does not implicitly {@link pg_query.ImportForeignSchemaStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ImportForeignSchemaStmt + * @static + * @param {pg_query.IImportForeignSchemaStmt} message ImportForeignSchemaStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportForeignSchemaStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportForeignSchemaStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ImportForeignSchemaStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ImportForeignSchemaStmt} ImportForeignSchemaStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportForeignSchemaStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ImportForeignSchemaStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.server_name = reader.string(); + break; + } + case 2: { + message.remote_schema = reader.string(); + break; + } + case 3: { + message.local_schema = reader.string(); + break; + } + case 4: { + message.list_type = reader.int32(); + break; + } + case 5: { + if (!(message.table_list && message.table_list.length)) + message.table_list = []; + message.table_list.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportForeignSchemaStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ImportForeignSchemaStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ImportForeignSchemaStmt} ImportForeignSchemaStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportForeignSchemaStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportForeignSchemaStmt message. + * @function verify + * @memberof pg_query.ImportForeignSchemaStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportForeignSchemaStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.server_name != null && message.hasOwnProperty("server_name")) + if (!$util.isString(message.server_name)) + return "server_name: string expected"; + if (message.remote_schema != null && message.hasOwnProperty("remote_schema")) + if (!$util.isString(message.remote_schema)) + return "remote_schema: string expected"; + if (message.local_schema != null && message.hasOwnProperty("local_schema")) + if (!$util.isString(message.local_schema)) + return "local_schema: string expected"; + if (message.list_type != null && message.hasOwnProperty("list_type")) + switch (message.list_type) { + default: + return "list_type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.table_list != null && message.hasOwnProperty("table_list")) { + if (!Array.isArray(message.table_list)) + return "table_list: array expected"; + for (var i = 0; i < message.table_list.length; ++i) { + var error = $root.pg_query.Node.verify(message.table_list[i]); + if (error) + return "table_list." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates an ImportForeignSchemaStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ImportForeignSchemaStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ImportForeignSchemaStmt} ImportForeignSchemaStmt + */ + ImportForeignSchemaStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ImportForeignSchemaStmt) + return object; + var message = new $root.pg_query.ImportForeignSchemaStmt(); + if (object.server_name != null) + message.server_name = String(object.server_name); + if (object.remote_schema != null) + message.remote_schema = String(object.remote_schema); + if (object.local_schema != null) + message.local_schema = String(object.local_schema); + switch (object.list_type) { + default: + if (typeof object.list_type === "number") { + message.list_type = object.list_type; + break; + } + break; + case "IMPORT_FOREIGN_SCHEMA_TYPE_UNDEFINED": + case 0: + message.list_type = 0; + break; + case "FDW_IMPORT_SCHEMA_ALL": + case 1: + message.list_type = 1; + break; + case "FDW_IMPORT_SCHEMA_LIMIT_TO": + case 2: + message.list_type = 2; + break; + case "FDW_IMPORT_SCHEMA_EXCEPT": + case 3: + message.list_type = 3; + break; + } + if (object.table_list) { + if (!Array.isArray(object.table_list)) + throw TypeError(".pg_query.ImportForeignSchemaStmt.table_list: array expected"); + message.table_list = []; + for (var i = 0; i < object.table_list.length; ++i) { + if (typeof object.table_list[i] !== "object") + throw TypeError(".pg_query.ImportForeignSchemaStmt.table_list: object expected"); + message.table_list[i] = $root.pg_query.Node.fromObject(object.table_list[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.ImportForeignSchemaStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.ImportForeignSchemaStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ImportForeignSchemaStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ImportForeignSchemaStmt + * @static + * @param {pg_query.ImportForeignSchemaStmt} message ImportForeignSchemaStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportForeignSchemaStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.table_list = []; + object.options = []; + } + if (options.defaults) { + object.server_name = ""; + object.remote_schema = ""; + object.local_schema = ""; + object.list_type = options.enums === String ? "IMPORT_FOREIGN_SCHEMA_TYPE_UNDEFINED" : 0; + } + if (message.server_name != null && message.hasOwnProperty("server_name")) + object.server_name = message.server_name; + if (message.remote_schema != null && message.hasOwnProperty("remote_schema")) + object.remote_schema = message.remote_schema; + if (message.local_schema != null && message.hasOwnProperty("local_schema")) + object.local_schema = message.local_schema; + if (message.list_type != null && message.hasOwnProperty("list_type")) + object.list_type = options.enums === String ? $root.pg_query.ImportForeignSchemaType[message.list_type] === undefined ? message.list_type : $root.pg_query.ImportForeignSchemaType[message.list_type] : message.list_type; + if (message.table_list && message.table_list.length) { + object.table_list = []; + for (var j = 0; j < message.table_list.length; ++j) + object.table_list[j] = $root.pg_query.Node.toObject(message.table_list[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this ImportForeignSchemaStmt to JSON. + * @function toJSON + * @memberof pg_query.ImportForeignSchemaStmt + * @instance + * @returns {Object.} JSON object + */ + ImportForeignSchemaStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportForeignSchemaStmt + * @function getTypeUrl + * @memberof pg_query.ImportForeignSchemaStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportForeignSchemaStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ImportForeignSchemaStmt"; + }; + + return ImportForeignSchemaStmt; + })(); + + pg_query.CreateExtensionStmt = (function() { + + /** + * Properties of a CreateExtensionStmt. + * @memberof pg_query + * @interface ICreateExtensionStmt + * @property {string|null} [extname] CreateExtensionStmt extname + * @property {boolean|null} [if_not_exists] CreateExtensionStmt if_not_exists + * @property {Array.|null} [options] CreateExtensionStmt options + */ + + /** + * Constructs a new CreateExtensionStmt. + * @memberof pg_query + * @classdesc Represents a CreateExtensionStmt. + * @implements ICreateExtensionStmt + * @constructor + * @param {pg_query.ICreateExtensionStmt=} [properties] Properties to set + */ + function CreateExtensionStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateExtensionStmt extname. + * @member {string} extname + * @memberof pg_query.CreateExtensionStmt + * @instance + */ + CreateExtensionStmt.prototype.extname = ""; + + /** + * CreateExtensionStmt if_not_exists. + * @member {boolean} if_not_exists + * @memberof pg_query.CreateExtensionStmt + * @instance + */ + CreateExtensionStmt.prototype.if_not_exists = false; + + /** + * CreateExtensionStmt options. + * @member {Array.} options + * @memberof pg_query.CreateExtensionStmt + * @instance + */ + CreateExtensionStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new CreateExtensionStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateExtensionStmt + * @static + * @param {pg_query.ICreateExtensionStmt=} [properties] Properties to set + * @returns {pg_query.CreateExtensionStmt} CreateExtensionStmt instance + */ + CreateExtensionStmt.create = function create(properties) { + return new CreateExtensionStmt(properties); + }; + + /** + * Encodes the specified CreateExtensionStmt message. Does not implicitly {@link pg_query.CreateExtensionStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateExtensionStmt + * @static + * @param {pg_query.ICreateExtensionStmt} message CreateExtensionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExtensionStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extname != null && Object.hasOwnProperty.call(message, "extname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.extname); + if (message.if_not_exists != null && Object.hasOwnProperty.call(message, "if_not_exists")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.if_not_exists); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateExtensionStmt message, length delimited. Does not implicitly {@link pg_query.CreateExtensionStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateExtensionStmt + * @static + * @param {pg_query.ICreateExtensionStmt} message CreateExtensionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateExtensionStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateExtensionStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateExtensionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateExtensionStmt} CreateExtensionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExtensionStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateExtensionStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.extname = reader.string(); + break; + } + case 2: { + message.if_not_exists = reader.bool(); + break; + } + case 3: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateExtensionStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateExtensionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateExtensionStmt} CreateExtensionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateExtensionStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateExtensionStmt message. + * @function verify + * @memberof pg_query.CreateExtensionStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateExtensionStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extname != null && message.hasOwnProperty("extname")) + if (!$util.isString(message.extname)) + return "extname: string expected"; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + if (typeof message.if_not_exists !== "boolean") + return "if_not_exists: boolean expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates a CreateExtensionStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateExtensionStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateExtensionStmt} CreateExtensionStmt + */ + CreateExtensionStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateExtensionStmt) + return object; + var message = new $root.pg_query.CreateExtensionStmt(); + if (object.extname != null) + message.extname = String(object.extname); + if (object.if_not_exists != null) + message.if_not_exists = Boolean(object.if_not_exists); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreateExtensionStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreateExtensionStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateExtensionStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateExtensionStmt + * @static + * @param {pg_query.CreateExtensionStmt} message CreateExtensionStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateExtensionStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) { + object.extname = ""; + object.if_not_exists = false; + } + if (message.extname != null && message.hasOwnProperty("extname")) + object.extname = message.extname; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + object.if_not_exists = message.if_not_exists; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this CreateExtensionStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateExtensionStmt + * @instance + * @returns {Object.} JSON object + */ + CreateExtensionStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateExtensionStmt + * @function getTypeUrl + * @memberof pg_query.CreateExtensionStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateExtensionStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateExtensionStmt"; + }; + + return CreateExtensionStmt; + })(); + + pg_query.AlterExtensionStmt = (function() { + + /** + * Properties of an AlterExtensionStmt. + * @memberof pg_query + * @interface IAlterExtensionStmt + * @property {string|null} [extname] AlterExtensionStmt extname + * @property {Array.|null} [options] AlterExtensionStmt options + */ + + /** + * Constructs a new AlterExtensionStmt. + * @memberof pg_query + * @classdesc Represents an AlterExtensionStmt. + * @implements IAlterExtensionStmt + * @constructor + * @param {pg_query.IAlterExtensionStmt=} [properties] Properties to set + */ + function AlterExtensionStmt(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterExtensionStmt extname. + * @member {string} extname + * @memberof pg_query.AlterExtensionStmt + * @instance + */ + AlterExtensionStmt.prototype.extname = ""; + + /** + * AlterExtensionStmt options. + * @member {Array.} options + * @memberof pg_query.AlterExtensionStmt + * @instance + */ + AlterExtensionStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new AlterExtensionStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterExtensionStmt + * @static + * @param {pg_query.IAlterExtensionStmt=} [properties] Properties to set + * @returns {pg_query.AlterExtensionStmt} AlterExtensionStmt instance + */ + AlterExtensionStmt.create = function create(properties) { + return new AlterExtensionStmt(properties); + }; + + /** + * Encodes the specified AlterExtensionStmt message. Does not implicitly {@link pg_query.AlterExtensionStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterExtensionStmt + * @static + * @param {pg_query.IAlterExtensionStmt} message AlterExtensionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterExtensionStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extname != null && Object.hasOwnProperty.call(message, "extname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.extname); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterExtensionStmt message, length delimited. Does not implicitly {@link pg_query.AlterExtensionStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterExtensionStmt + * @static + * @param {pg_query.IAlterExtensionStmt} message AlterExtensionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterExtensionStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterExtensionStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterExtensionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterExtensionStmt} AlterExtensionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterExtensionStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterExtensionStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.extname = reader.string(); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterExtensionStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterExtensionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterExtensionStmt} AlterExtensionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterExtensionStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterExtensionStmt message. + * @function verify + * @memberof pg_query.AlterExtensionStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterExtensionStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extname != null && message.hasOwnProperty("extname")) + if (!$util.isString(message.extname)) + return "extname: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates an AlterExtensionStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterExtensionStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterExtensionStmt} AlterExtensionStmt + */ + AlterExtensionStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterExtensionStmt) + return object; + var message = new $root.pg_query.AlterExtensionStmt(); + if (object.extname != null) + message.extname = String(object.extname); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterExtensionStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterExtensionStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlterExtensionStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterExtensionStmt + * @static + * @param {pg_query.AlterExtensionStmt} message AlterExtensionStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterExtensionStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.options = []; + if (options.defaults) + object.extname = ""; + if (message.extname != null && message.hasOwnProperty("extname")) + object.extname = message.extname; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this AlterExtensionStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterExtensionStmt + * @instance + * @returns {Object.} JSON object + */ + AlterExtensionStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterExtensionStmt + * @function getTypeUrl + * @memberof pg_query.AlterExtensionStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterExtensionStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterExtensionStmt"; + }; + + return AlterExtensionStmt; + })(); + + pg_query.AlterExtensionContentsStmt = (function() { + + /** + * Properties of an AlterExtensionContentsStmt. + * @memberof pg_query + * @interface IAlterExtensionContentsStmt + * @property {string|null} [extname] AlterExtensionContentsStmt extname + * @property {number|null} [action] AlterExtensionContentsStmt action + * @property {pg_query.ObjectType|null} [objtype] AlterExtensionContentsStmt objtype + * @property {pg_query.INode|null} [object] AlterExtensionContentsStmt object + */ + + /** + * Constructs a new AlterExtensionContentsStmt. + * @memberof pg_query + * @classdesc Represents an AlterExtensionContentsStmt. + * @implements IAlterExtensionContentsStmt + * @constructor + * @param {pg_query.IAlterExtensionContentsStmt=} [properties] Properties to set + */ + function AlterExtensionContentsStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterExtensionContentsStmt extname. + * @member {string} extname + * @memberof pg_query.AlterExtensionContentsStmt + * @instance + */ + AlterExtensionContentsStmt.prototype.extname = ""; + + /** + * AlterExtensionContentsStmt action. + * @member {number} action + * @memberof pg_query.AlterExtensionContentsStmt + * @instance + */ + AlterExtensionContentsStmt.prototype.action = 0; + + /** + * AlterExtensionContentsStmt objtype. + * @member {pg_query.ObjectType} objtype + * @memberof pg_query.AlterExtensionContentsStmt + * @instance + */ + AlterExtensionContentsStmt.prototype.objtype = 0; + + /** + * AlterExtensionContentsStmt object. + * @member {pg_query.INode|null|undefined} object + * @memberof pg_query.AlterExtensionContentsStmt + * @instance + */ + AlterExtensionContentsStmt.prototype.object = null; + + /** + * Creates a new AlterExtensionContentsStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterExtensionContentsStmt + * @static + * @param {pg_query.IAlterExtensionContentsStmt=} [properties] Properties to set + * @returns {pg_query.AlterExtensionContentsStmt} AlterExtensionContentsStmt instance + */ + AlterExtensionContentsStmt.create = function create(properties) { + return new AlterExtensionContentsStmt(properties); + }; + + /** + * Encodes the specified AlterExtensionContentsStmt message. Does not implicitly {@link pg_query.AlterExtensionContentsStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterExtensionContentsStmt + * @static + * @param {pg_query.IAlterExtensionContentsStmt} message AlterExtensionContentsStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterExtensionContentsStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.extname != null && Object.hasOwnProperty.call(message, "extname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.extname); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.action); + if (message.objtype != null && Object.hasOwnProperty.call(message, "objtype")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.objtype); + if (message.object != null && Object.hasOwnProperty.call(message, "object")) + $root.pg_query.Node.encode(message.object, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterExtensionContentsStmt message, length delimited. Does not implicitly {@link pg_query.AlterExtensionContentsStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterExtensionContentsStmt + * @static + * @param {pg_query.IAlterExtensionContentsStmt} message AlterExtensionContentsStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterExtensionContentsStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterExtensionContentsStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterExtensionContentsStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterExtensionContentsStmt} AlterExtensionContentsStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterExtensionContentsStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterExtensionContentsStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.extname = reader.string(); + break; + } + case 2: { + message.action = reader.int32(); + break; + } + case 3: { + message.objtype = reader.int32(); + break; + } + case 4: { + message.object = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterExtensionContentsStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterExtensionContentsStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterExtensionContentsStmt} AlterExtensionContentsStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterExtensionContentsStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterExtensionContentsStmt message. + * @function verify + * @memberof pg_query.AlterExtensionContentsStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterExtensionContentsStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.extname != null && message.hasOwnProperty("extname")) + if (!$util.isString(message.extname)) + return "extname: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isInteger(message.action)) + return "action: integer expected"; + if (message.objtype != null && message.hasOwnProperty("objtype")) + switch (message.objtype) { + default: + return "objtype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + break; + } + if (message.object != null && message.hasOwnProperty("object")) { + var error = $root.pg_query.Node.verify(message.object); + if (error) + return "object." + error; + } + return null; + }; + + /** + * Creates an AlterExtensionContentsStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterExtensionContentsStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterExtensionContentsStmt} AlterExtensionContentsStmt + */ + AlterExtensionContentsStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterExtensionContentsStmt) + return object; + var message = new $root.pg_query.AlterExtensionContentsStmt(); + if (object.extname != null) + message.extname = String(object.extname); + if (object.action != null) + message.action = object.action | 0; + switch (object.objtype) { + default: + if (typeof object.objtype === "number") { + message.objtype = object.objtype; + break; + } + break; + case "OBJECT_TYPE_UNDEFINED": + case 0: + message.objtype = 0; + break; + case "OBJECT_ACCESS_METHOD": + case 1: + message.objtype = 1; + break; + case "OBJECT_AGGREGATE": + case 2: + message.objtype = 2; + break; + case "OBJECT_AMOP": + case 3: + message.objtype = 3; + break; + case "OBJECT_AMPROC": + case 4: + message.objtype = 4; + break; + case "OBJECT_ATTRIBUTE": + case 5: + message.objtype = 5; + break; + case "OBJECT_CAST": + case 6: + message.objtype = 6; + break; + case "OBJECT_COLUMN": + case 7: + message.objtype = 7; + break; + case "OBJECT_COLLATION": + case 8: + message.objtype = 8; + break; + case "OBJECT_CONVERSION": + case 9: + message.objtype = 9; + break; + case "OBJECT_DATABASE": + case 10: + message.objtype = 10; + break; + case "OBJECT_DEFAULT": + case 11: + message.objtype = 11; + break; + case "OBJECT_DEFACL": + case 12: + message.objtype = 12; + break; + case "OBJECT_DOMAIN": + case 13: + message.objtype = 13; + break; + case "OBJECT_DOMCONSTRAINT": + case 14: + message.objtype = 14; + break; + case "OBJECT_EVENT_TRIGGER": + case 15: + message.objtype = 15; + break; + case "OBJECT_EXTENSION": + case 16: + message.objtype = 16; + break; + case "OBJECT_FDW": + case 17: + message.objtype = 17; + break; + case "OBJECT_FOREIGN_SERVER": + case 18: + message.objtype = 18; + break; + case "OBJECT_FOREIGN_TABLE": + case 19: + message.objtype = 19; + break; + case "OBJECT_FUNCTION": + case 20: + message.objtype = 20; + break; + case "OBJECT_INDEX": + case 21: + message.objtype = 21; + break; + case "OBJECT_LANGUAGE": + case 22: + message.objtype = 22; + break; + case "OBJECT_LARGEOBJECT": + case 23: + message.objtype = 23; + break; + case "OBJECT_MATVIEW": + case 24: + message.objtype = 24; + break; + case "OBJECT_OPCLASS": + case 25: + message.objtype = 25; + break; + case "OBJECT_OPERATOR": + case 26: + message.objtype = 26; + break; + case "OBJECT_OPFAMILY": + case 27: + message.objtype = 27; + break; + case "OBJECT_POLICY": + case 28: + message.objtype = 28; + break; + case "OBJECT_PROCEDURE": + case 29: + message.objtype = 29; + break; + case "OBJECT_PUBLICATION": + case 30: + message.objtype = 30; + break; + case "OBJECT_PUBLICATION_REL": + case 31: + message.objtype = 31; + break; + case "OBJECT_ROLE": + case 32: + message.objtype = 32; + break; + case "OBJECT_ROUTINE": + case 33: + message.objtype = 33; + break; + case "OBJECT_RULE": + case 34: + message.objtype = 34; + break; + case "OBJECT_SCHEMA": + case 35: + message.objtype = 35; + break; + case "OBJECT_SEQUENCE": + case 36: + message.objtype = 36; + break; + case "OBJECT_SUBSCRIPTION": + case 37: + message.objtype = 37; + break; + case "OBJECT_STATISTIC_EXT": + case 38: + message.objtype = 38; + break; + case "OBJECT_TABCONSTRAINT": + case 39: + message.objtype = 39; + break; + case "OBJECT_TABLE": + case 40: + message.objtype = 40; + break; + case "OBJECT_TABLESPACE": + case 41: + message.objtype = 41; + break; + case "OBJECT_TRANSFORM": + case 42: + message.objtype = 42; + break; + case "OBJECT_TRIGGER": + case 43: + message.objtype = 43; + break; + case "OBJECT_TSCONFIGURATION": + case 44: + message.objtype = 44; + break; + case "OBJECT_TSDICTIONARY": + case 45: + message.objtype = 45; + break; + case "OBJECT_TSPARSER": + case 46: + message.objtype = 46; + break; + case "OBJECT_TSTEMPLATE": + case 47: + message.objtype = 47; + break; + case "OBJECT_TYPE": + case 48: + message.objtype = 48; + break; + case "OBJECT_USER_MAPPING": + case 49: + message.objtype = 49; + break; + case "OBJECT_VIEW": + case 50: + message.objtype = 50; + break; + } + if (object.object != null) { + if (typeof object.object !== "object") + throw TypeError(".pg_query.AlterExtensionContentsStmt.object: object expected"); + message.object = $root.pg_query.Node.fromObject(object.object); + } + return message; + }; + + /** + * Creates a plain object from an AlterExtensionContentsStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterExtensionContentsStmt + * @static + * @param {pg_query.AlterExtensionContentsStmt} message AlterExtensionContentsStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterExtensionContentsStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.extname = ""; + object.action = 0; + object.objtype = options.enums === String ? "OBJECT_TYPE_UNDEFINED" : 0; + object.object = null; + } + if (message.extname != null && message.hasOwnProperty("extname")) + object.extname = message.extname; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.objtype != null && message.hasOwnProperty("objtype")) + object.objtype = options.enums === String ? $root.pg_query.ObjectType[message.objtype] === undefined ? message.objtype : $root.pg_query.ObjectType[message.objtype] : message.objtype; + if (message.object != null && message.hasOwnProperty("object")) + object.object = $root.pg_query.Node.toObject(message.object, options); + return object; + }; + + /** + * Converts this AlterExtensionContentsStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterExtensionContentsStmt + * @instance + * @returns {Object.} JSON object + */ + AlterExtensionContentsStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterExtensionContentsStmt + * @function getTypeUrl + * @memberof pg_query.AlterExtensionContentsStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterExtensionContentsStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterExtensionContentsStmt"; + }; + + return AlterExtensionContentsStmt; + })(); + + pg_query.CreateEventTrigStmt = (function() { + + /** + * Properties of a CreateEventTrigStmt. + * @memberof pg_query + * @interface ICreateEventTrigStmt + * @property {string|null} [trigname] CreateEventTrigStmt trigname + * @property {string|null} [eventname] CreateEventTrigStmt eventname + * @property {Array.|null} [whenclause] CreateEventTrigStmt whenclause + * @property {Array.|null} [funcname] CreateEventTrigStmt funcname + */ + + /** + * Constructs a new CreateEventTrigStmt. + * @memberof pg_query + * @classdesc Represents a CreateEventTrigStmt. + * @implements ICreateEventTrigStmt + * @constructor + * @param {pg_query.ICreateEventTrigStmt=} [properties] Properties to set + */ + function CreateEventTrigStmt(properties) { + this.whenclause = []; + this.funcname = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateEventTrigStmt trigname. + * @member {string} trigname + * @memberof pg_query.CreateEventTrigStmt + * @instance + */ + CreateEventTrigStmt.prototype.trigname = ""; + + /** + * CreateEventTrigStmt eventname. + * @member {string} eventname + * @memberof pg_query.CreateEventTrigStmt + * @instance + */ + CreateEventTrigStmt.prototype.eventname = ""; + + /** + * CreateEventTrigStmt whenclause. + * @member {Array.} whenclause + * @memberof pg_query.CreateEventTrigStmt + * @instance + */ + CreateEventTrigStmt.prototype.whenclause = $util.emptyArray; + + /** + * CreateEventTrigStmt funcname. + * @member {Array.} funcname + * @memberof pg_query.CreateEventTrigStmt + * @instance + */ + CreateEventTrigStmt.prototype.funcname = $util.emptyArray; + + /** + * Creates a new CreateEventTrigStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateEventTrigStmt + * @static + * @param {pg_query.ICreateEventTrigStmt=} [properties] Properties to set + * @returns {pg_query.CreateEventTrigStmt} CreateEventTrigStmt instance + */ + CreateEventTrigStmt.create = function create(properties) { + return new CreateEventTrigStmt(properties); + }; + + /** + * Encodes the specified CreateEventTrigStmt message. Does not implicitly {@link pg_query.CreateEventTrigStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateEventTrigStmt + * @static + * @param {pg_query.ICreateEventTrigStmt} message CreateEventTrigStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEventTrigStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trigname != null && Object.hasOwnProperty.call(message, "trigname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.trigname); + if (message.eventname != null && Object.hasOwnProperty.call(message, "eventname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.eventname); + if (message.whenclause != null && message.whenclause.length) + for (var i = 0; i < message.whenclause.length; ++i) + $root.pg_query.Node.encode(message.whenclause[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.funcname != null && message.funcname.length) + for (var i = 0; i < message.funcname.length; ++i) + $root.pg_query.Node.encode(message.funcname[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateEventTrigStmt message, length delimited. Does not implicitly {@link pg_query.CreateEventTrigStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateEventTrigStmt + * @static + * @param {pg_query.ICreateEventTrigStmt} message CreateEventTrigStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEventTrigStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateEventTrigStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateEventTrigStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateEventTrigStmt} CreateEventTrigStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEventTrigStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateEventTrigStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.trigname = reader.string(); + break; + } + case 2: { + message.eventname = reader.string(); + break; + } + case 3: { + if (!(message.whenclause && message.whenclause.length)) + message.whenclause = []; + message.whenclause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.funcname && message.funcname.length)) + message.funcname = []; + message.funcname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateEventTrigStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateEventTrigStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateEventTrigStmt} CreateEventTrigStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEventTrigStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateEventTrigStmt message. + * @function verify + * @memberof pg_query.CreateEventTrigStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEventTrigStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trigname != null && message.hasOwnProperty("trigname")) + if (!$util.isString(message.trigname)) + return "trigname: string expected"; + if (message.eventname != null && message.hasOwnProperty("eventname")) + if (!$util.isString(message.eventname)) + return "eventname: string expected"; + if (message.whenclause != null && message.hasOwnProperty("whenclause")) { + if (!Array.isArray(message.whenclause)) + return "whenclause: array expected"; + for (var i = 0; i < message.whenclause.length; ++i) { + var error = $root.pg_query.Node.verify(message.whenclause[i]); + if (error) + return "whenclause." + error; + } + } + if (message.funcname != null && message.hasOwnProperty("funcname")) { + if (!Array.isArray(message.funcname)) + return "funcname: array expected"; + for (var i = 0; i < message.funcname.length; ++i) { + var error = $root.pg_query.Node.verify(message.funcname[i]); + if (error) + return "funcname." + error; + } + } + return null; + }; + + /** + * Creates a CreateEventTrigStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateEventTrigStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateEventTrigStmt} CreateEventTrigStmt + */ + CreateEventTrigStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateEventTrigStmt) + return object; + var message = new $root.pg_query.CreateEventTrigStmt(); + if (object.trigname != null) + message.trigname = String(object.trigname); + if (object.eventname != null) + message.eventname = String(object.eventname); + if (object.whenclause) { + if (!Array.isArray(object.whenclause)) + throw TypeError(".pg_query.CreateEventTrigStmt.whenclause: array expected"); + message.whenclause = []; + for (var i = 0; i < object.whenclause.length; ++i) { + if (typeof object.whenclause[i] !== "object") + throw TypeError(".pg_query.CreateEventTrigStmt.whenclause: object expected"); + message.whenclause[i] = $root.pg_query.Node.fromObject(object.whenclause[i]); + } + } + if (object.funcname) { + if (!Array.isArray(object.funcname)) + throw TypeError(".pg_query.CreateEventTrigStmt.funcname: array expected"); + message.funcname = []; + for (var i = 0; i < object.funcname.length; ++i) { + if (typeof object.funcname[i] !== "object") + throw TypeError(".pg_query.CreateEventTrigStmt.funcname: object expected"); + message.funcname[i] = $root.pg_query.Node.fromObject(object.funcname[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateEventTrigStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateEventTrigStmt + * @static + * @param {pg_query.CreateEventTrigStmt} message CreateEventTrigStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEventTrigStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.whenclause = []; + object.funcname = []; + } + if (options.defaults) { + object.trigname = ""; + object.eventname = ""; + } + if (message.trigname != null && message.hasOwnProperty("trigname")) + object.trigname = message.trigname; + if (message.eventname != null && message.hasOwnProperty("eventname")) + object.eventname = message.eventname; + if (message.whenclause && message.whenclause.length) { + object.whenclause = []; + for (var j = 0; j < message.whenclause.length; ++j) + object.whenclause[j] = $root.pg_query.Node.toObject(message.whenclause[j], options); + } + if (message.funcname && message.funcname.length) { + object.funcname = []; + for (var j = 0; j < message.funcname.length; ++j) + object.funcname[j] = $root.pg_query.Node.toObject(message.funcname[j], options); + } + return object; + }; + + /** + * Converts this CreateEventTrigStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateEventTrigStmt + * @instance + * @returns {Object.} JSON object + */ + CreateEventTrigStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateEventTrigStmt + * @function getTypeUrl + * @memberof pg_query.CreateEventTrigStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateEventTrigStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateEventTrigStmt"; + }; + + return CreateEventTrigStmt; + })(); + + pg_query.AlterEventTrigStmt = (function() { + + /** + * Properties of an AlterEventTrigStmt. + * @memberof pg_query + * @interface IAlterEventTrigStmt + * @property {string|null} [trigname] AlterEventTrigStmt trigname + * @property {string|null} [tgenabled] AlterEventTrigStmt tgenabled + */ + + /** + * Constructs a new AlterEventTrigStmt. + * @memberof pg_query + * @classdesc Represents an AlterEventTrigStmt. + * @implements IAlterEventTrigStmt + * @constructor + * @param {pg_query.IAlterEventTrigStmt=} [properties] Properties to set + */ + function AlterEventTrigStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterEventTrigStmt trigname. + * @member {string} trigname + * @memberof pg_query.AlterEventTrigStmt + * @instance + */ + AlterEventTrigStmt.prototype.trigname = ""; + + /** + * AlterEventTrigStmt tgenabled. + * @member {string} tgenabled + * @memberof pg_query.AlterEventTrigStmt + * @instance + */ + AlterEventTrigStmt.prototype.tgenabled = ""; + + /** + * Creates a new AlterEventTrigStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterEventTrigStmt + * @static + * @param {pg_query.IAlterEventTrigStmt=} [properties] Properties to set + * @returns {pg_query.AlterEventTrigStmt} AlterEventTrigStmt instance + */ + AlterEventTrigStmt.create = function create(properties) { + return new AlterEventTrigStmt(properties); + }; + + /** + * Encodes the specified AlterEventTrigStmt message. Does not implicitly {@link pg_query.AlterEventTrigStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterEventTrigStmt + * @static + * @param {pg_query.IAlterEventTrigStmt} message AlterEventTrigStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterEventTrigStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trigname != null && Object.hasOwnProperty.call(message, "trigname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.trigname); + if (message.tgenabled != null && Object.hasOwnProperty.call(message, "tgenabled")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tgenabled); + return writer; + }; + + /** + * Encodes the specified AlterEventTrigStmt message, length delimited. Does not implicitly {@link pg_query.AlterEventTrigStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterEventTrigStmt + * @static + * @param {pg_query.IAlterEventTrigStmt} message AlterEventTrigStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterEventTrigStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterEventTrigStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterEventTrigStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterEventTrigStmt} AlterEventTrigStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterEventTrigStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterEventTrigStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.trigname = reader.string(); + break; + } + case 2: { + message.tgenabled = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterEventTrigStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterEventTrigStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterEventTrigStmt} AlterEventTrigStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterEventTrigStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterEventTrigStmt message. + * @function verify + * @memberof pg_query.AlterEventTrigStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterEventTrigStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trigname != null && message.hasOwnProperty("trigname")) + if (!$util.isString(message.trigname)) + return "trigname: string expected"; + if (message.tgenabled != null && message.hasOwnProperty("tgenabled")) + if (!$util.isString(message.tgenabled)) + return "tgenabled: string expected"; + return null; + }; + + /** + * Creates an AlterEventTrigStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterEventTrigStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterEventTrigStmt} AlterEventTrigStmt + */ + AlterEventTrigStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterEventTrigStmt) + return object; + var message = new $root.pg_query.AlterEventTrigStmt(); + if (object.trigname != null) + message.trigname = String(object.trigname); + if (object.tgenabled != null) + message.tgenabled = String(object.tgenabled); + return message; + }; + + /** + * Creates a plain object from an AlterEventTrigStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterEventTrigStmt + * @static + * @param {pg_query.AlterEventTrigStmt} message AlterEventTrigStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterEventTrigStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.trigname = ""; + object.tgenabled = ""; + } + if (message.trigname != null && message.hasOwnProperty("trigname")) + object.trigname = message.trigname; + if (message.tgenabled != null && message.hasOwnProperty("tgenabled")) + object.tgenabled = message.tgenabled; + return object; + }; + + /** + * Converts this AlterEventTrigStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterEventTrigStmt + * @instance + * @returns {Object.} JSON object + */ + AlterEventTrigStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterEventTrigStmt + * @function getTypeUrl + * @memberof pg_query.AlterEventTrigStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterEventTrigStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterEventTrigStmt"; + }; + + return AlterEventTrigStmt; + })(); + + pg_query.RefreshMatViewStmt = (function() { + + /** + * Properties of a RefreshMatViewStmt. + * @memberof pg_query + * @interface IRefreshMatViewStmt + * @property {boolean|null} [concurrent] RefreshMatViewStmt concurrent + * @property {boolean|null} [skipData] RefreshMatViewStmt skipData + * @property {pg_query.IRangeVar|null} [relation] RefreshMatViewStmt relation + */ + + /** + * Constructs a new RefreshMatViewStmt. + * @memberof pg_query + * @classdesc Represents a RefreshMatViewStmt. + * @implements IRefreshMatViewStmt + * @constructor + * @param {pg_query.IRefreshMatViewStmt=} [properties] Properties to set + */ + function RefreshMatViewStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RefreshMatViewStmt concurrent. + * @member {boolean} concurrent + * @memberof pg_query.RefreshMatViewStmt + * @instance + */ + RefreshMatViewStmt.prototype.concurrent = false; + + /** + * RefreshMatViewStmt skipData. + * @member {boolean} skipData + * @memberof pg_query.RefreshMatViewStmt + * @instance + */ + RefreshMatViewStmt.prototype.skipData = false; + + /** + * RefreshMatViewStmt relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.RefreshMatViewStmt + * @instance + */ + RefreshMatViewStmt.prototype.relation = null; + + /** + * Creates a new RefreshMatViewStmt instance using the specified properties. + * @function create + * @memberof pg_query.RefreshMatViewStmt + * @static + * @param {pg_query.IRefreshMatViewStmt=} [properties] Properties to set + * @returns {pg_query.RefreshMatViewStmt} RefreshMatViewStmt instance + */ + RefreshMatViewStmt.create = function create(properties) { + return new RefreshMatViewStmt(properties); + }; + + /** + * Encodes the specified RefreshMatViewStmt message. Does not implicitly {@link pg_query.RefreshMatViewStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.RefreshMatViewStmt + * @static + * @param {pg_query.IRefreshMatViewStmt} message RefreshMatViewStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RefreshMatViewStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.concurrent != null && Object.hasOwnProperty.call(message, "concurrent")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.concurrent); + if (message.skipData != null && Object.hasOwnProperty.call(message, "skipData")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.skipData); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RefreshMatViewStmt message, length delimited. Does not implicitly {@link pg_query.RefreshMatViewStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RefreshMatViewStmt + * @static + * @param {pg_query.IRefreshMatViewStmt} message RefreshMatViewStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RefreshMatViewStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RefreshMatViewStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RefreshMatViewStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RefreshMatViewStmt} RefreshMatViewStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RefreshMatViewStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RefreshMatViewStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.concurrent = reader.bool(); + break; + } + case 2: { + message.skipData = reader.bool(); + break; + } + case 3: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RefreshMatViewStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RefreshMatViewStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RefreshMatViewStmt} RefreshMatViewStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RefreshMatViewStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RefreshMatViewStmt message. + * @function verify + * @memberof pg_query.RefreshMatViewStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RefreshMatViewStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.concurrent != null && message.hasOwnProperty("concurrent")) + if (typeof message.concurrent !== "boolean") + return "concurrent: boolean expected"; + if (message.skipData != null && message.hasOwnProperty("skipData")) + if (typeof message.skipData !== "boolean") + return "skipData: boolean expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + return null; + }; + + /** + * Creates a RefreshMatViewStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RefreshMatViewStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RefreshMatViewStmt} RefreshMatViewStmt + */ + RefreshMatViewStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RefreshMatViewStmt) + return object; + var message = new $root.pg_query.RefreshMatViewStmt(); + if (object.concurrent != null) + message.concurrent = Boolean(object.concurrent); + if (object.skipData != null) + message.skipData = Boolean(object.skipData); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.RefreshMatViewStmt.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + return message; + }; + + /** + * Creates a plain object from a RefreshMatViewStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RefreshMatViewStmt + * @static + * @param {pg_query.RefreshMatViewStmt} message RefreshMatViewStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RefreshMatViewStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.concurrent = false; + object.skipData = false; + object.relation = null; + } + if (message.concurrent != null && message.hasOwnProperty("concurrent")) + object.concurrent = message.concurrent; + if (message.skipData != null && message.hasOwnProperty("skipData")) + object.skipData = message.skipData; + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + return object; + }; + + /** + * Converts this RefreshMatViewStmt to JSON. + * @function toJSON + * @memberof pg_query.RefreshMatViewStmt + * @instance + * @returns {Object.} JSON object + */ + RefreshMatViewStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RefreshMatViewStmt + * @function getTypeUrl + * @memberof pg_query.RefreshMatViewStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RefreshMatViewStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RefreshMatViewStmt"; + }; + + return RefreshMatViewStmt; + })(); + + pg_query.ReplicaIdentityStmt = (function() { + + /** + * Properties of a ReplicaIdentityStmt. + * @memberof pg_query + * @interface IReplicaIdentityStmt + * @property {string|null} [identity_type] ReplicaIdentityStmt identity_type + * @property {string|null} [name] ReplicaIdentityStmt name + */ + + /** + * Constructs a new ReplicaIdentityStmt. + * @memberof pg_query + * @classdesc Represents a ReplicaIdentityStmt. + * @implements IReplicaIdentityStmt + * @constructor + * @param {pg_query.IReplicaIdentityStmt=} [properties] Properties to set + */ + function ReplicaIdentityStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicaIdentityStmt identity_type. + * @member {string} identity_type + * @memberof pg_query.ReplicaIdentityStmt + * @instance + */ + ReplicaIdentityStmt.prototype.identity_type = ""; + + /** + * ReplicaIdentityStmt name. + * @member {string} name + * @memberof pg_query.ReplicaIdentityStmt + * @instance + */ + ReplicaIdentityStmt.prototype.name = ""; + + /** + * Creates a new ReplicaIdentityStmt instance using the specified properties. + * @function create + * @memberof pg_query.ReplicaIdentityStmt + * @static + * @param {pg_query.IReplicaIdentityStmt=} [properties] Properties to set + * @returns {pg_query.ReplicaIdentityStmt} ReplicaIdentityStmt instance + */ + ReplicaIdentityStmt.create = function create(properties) { + return new ReplicaIdentityStmt(properties); + }; + + /** + * Encodes the specified ReplicaIdentityStmt message. Does not implicitly {@link pg_query.ReplicaIdentityStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.ReplicaIdentityStmt + * @static + * @param {pg_query.IReplicaIdentityStmt} message ReplicaIdentityStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaIdentityStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identity_type != null && Object.hasOwnProperty.call(message, "identity_type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.identity_type); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified ReplicaIdentityStmt message, length delimited. Does not implicitly {@link pg_query.ReplicaIdentityStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ReplicaIdentityStmt + * @static + * @param {pg_query.IReplicaIdentityStmt} message ReplicaIdentityStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicaIdentityStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicaIdentityStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ReplicaIdentityStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ReplicaIdentityStmt} ReplicaIdentityStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaIdentityStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ReplicaIdentityStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.identity_type = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicaIdentityStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ReplicaIdentityStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ReplicaIdentityStmt} ReplicaIdentityStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicaIdentityStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicaIdentityStmt message. + * @function verify + * @memberof pg_query.ReplicaIdentityStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicaIdentityStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identity_type != null && message.hasOwnProperty("identity_type")) + if (!$util.isString(message.identity_type)) + return "identity_type: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a ReplicaIdentityStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ReplicaIdentityStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ReplicaIdentityStmt} ReplicaIdentityStmt + */ + ReplicaIdentityStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ReplicaIdentityStmt) + return object; + var message = new $root.pg_query.ReplicaIdentityStmt(); + if (object.identity_type != null) + message.identity_type = String(object.identity_type); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a ReplicaIdentityStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ReplicaIdentityStmt + * @static + * @param {pg_query.ReplicaIdentityStmt} message ReplicaIdentityStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicaIdentityStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.identity_type = ""; + object.name = ""; + } + if (message.identity_type != null && message.hasOwnProperty("identity_type")) + object.identity_type = message.identity_type; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ReplicaIdentityStmt to JSON. + * @function toJSON + * @memberof pg_query.ReplicaIdentityStmt + * @instance + * @returns {Object.} JSON object + */ + ReplicaIdentityStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicaIdentityStmt + * @function getTypeUrl + * @memberof pg_query.ReplicaIdentityStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicaIdentityStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ReplicaIdentityStmt"; + }; + + return ReplicaIdentityStmt; + })(); + + pg_query.AlterSystemStmt = (function() { + + /** + * Properties of an AlterSystemStmt. + * @memberof pg_query + * @interface IAlterSystemStmt + * @property {pg_query.IVariableSetStmt|null} [setstmt] AlterSystemStmt setstmt + */ + + /** + * Constructs a new AlterSystemStmt. + * @memberof pg_query + * @classdesc Represents an AlterSystemStmt. + * @implements IAlterSystemStmt + * @constructor + * @param {pg_query.IAlterSystemStmt=} [properties] Properties to set + */ + function AlterSystemStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterSystemStmt setstmt. + * @member {pg_query.IVariableSetStmt|null|undefined} setstmt + * @memberof pg_query.AlterSystemStmt + * @instance + */ + AlterSystemStmt.prototype.setstmt = null; + + /** + * Creates a new AlterSystemStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterSystemStmt + * @static + * @param {pg_query.IAlterSystemStmt=} [properties] Properties to set + * @returns {pg_query.AlterSystemStmt} AlterSystemStmt instance + */ + AlterSystemStmt.create = function create(properties) { + return new AlterSystemStmt(properties); + }; + + /** + * Encodes the specified AlterSystemStmt message. Does not implicitly {@link pg_query.AlterSystemStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterSystemStmt + * @static + * @param {pg_query.IAlterSystemStmt} message AlterSystemStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterSystemStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.setstmt != null && Object.hasOwnProperty.call(message, "setstmt")) + $root.pg_query.VariableSetStmt.encode(message.setstmt, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterSystemStmt message, length delimited. Does not implicitly {@link pg_query.AlterSystemStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterSystemStmt + * @static + * @param {pg_query.IAlterSystemStmt} message AlterSystemStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterSystemStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterSystemStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterSystemStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterSystemStmt} AlterSystemStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterSystemStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterSystemStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.setstmt = $root.pg_query.VariableSetStmt.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterSystemStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterSystemStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterSystemStmt} AlterSystemStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterSystemStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterSystemStmt message. + * @function verify + * @memberof pg_query.AlterSystemStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterSystemStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.setstmt != null && message.hasOwnProperty("setstmt")) { + var error = $root.pg_query.VariableSetStmt.verify(message.setstmt); + if (error) + return "setstmt." + error; + } + return null; + }; + + /** + * Creates an AlterSystemStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterSystemStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterSystemStmt} AlterSystemStmt + */ + AlterSystemStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterSystemStmt) + return object; + var message = new $root.pg_query.AlterSystemStmt(); + if (object.setstmt != null) { + if (typeof object.setstmt !== "object") + throw TypeError(".pg_query.AlterSystemStmt.setstmt: object expected"); + message.setstmt = $root.pg_query.VariableSetStmt.fromObject(object.setstmt); + } + return message; + }; + + /** + * Creates a plain object from an AlterSystemStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterSystemStmt + * @static + * @param {pg_query.AlterSystemStmt} message AlterSystemStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterSystemStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.setstmt = null; + if (message.setstmt != null && message.hasOwnProperty("setstmt")) + object.setstmt = $root.pg_query.VariableSetStmt.toObject(message.setstmt, options); + return object; + }; + + /** + * Converts this AlterSystemStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterSystemStmt + * @instance + * @returns {Object.} JSON object + */ + AlterSystemStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterSystemStmt + * @function getTypeUrl + * @memberof pg_query.AlterSystemStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterSystemStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterSystemStmt"; + }; + + return AlterSystemStmt; + })(); + + pg_query.CreatePolicyStmt = (function() { + + /** + * Properties of a CreatePolicyStmt. + * @memberof pg_query + * @interface ICreatePolicyStmt + * @property {string|null} [policy_name] CreatePolicyStmt policy_name + * @property {pg_query.IRangeVar|null} [table] CreatePolicyStmt table + * @property {string|null} [cmd_name] CreatePolicyStmt cmd_name + * @property {boolean|null} [permissive] CreatePolicyStmt permissive + * @property {Array.|null} [roles] CreatePolicyStmt roles + * @property {pg_query.INode|null} [qual] CreatePolicyStmt qual + * @property {pg_query.INode|null} [with_check] CreatePolicyStmt with_check + */ + + /** + * Constructs a new CreatePolicyStmt. + * @memberof pg_query + * @classdesc Represents a CreatePolicyStmt. + * @implements ICreatePolicyStmt + * @constructor + * @param {pg_query.ICreatePolicyStmt=} [properties] Properties to set + */ + function CreatePolicyStmt(properties) { + this.roles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePolicyStmt policy_name. + * @member {string} policy_name + * @memberof pg_query.CreatePolicyStmt + * @instance + */ + CreatePolicyStmt.prototype.policy_name = ""; + + /** + * CreatePolicyStmt table. + * @member {pg_query.IRangeVar|null|undefined} table + * @memberof pg_query.CreatePolicyStmt + * @instance + */ + CreatePolicyStmt.prototype.table = null; + + /** + * CreatePolicyStmt cmd_name. + * @member {string} cmd_name + * @memberof pg_query.CreatePolicyStmt + * @instance + */ + CreatePolicyStmt.prototype.cmd_name = ""; + + /** + * CreatePolicyStmt permissive. + * @member {boolean} permissive + * @memberof pg_query.CreatePolicyStmt + * @instance + */ + CreatePolicyStmt.prototype.permissive = false; + + /** + * CreatePolicyStmt roles. + * @member {Array.} roles + * @memberof pg_query.CreatePolicyStmt + * @instance + */ + CreatePolicyStmt.prototype.roles = $util.emptyArray; + + /** + * CreatePolicyStmt qual. + * @member {pg_query.INode|null|undefined} qual + * @memberof pg_query.CreatePolicyStmt + * @instance + */ + CreatePolicyStmt.prototype.qual = null; + + /** + * CreatePolicyStmt with_check. + * @member {pg_query.INode|null|undefined} with_check + * @memberof pg_query.CreatePolicyStmt + * @instance + */ + CreatePolicyStmt.prototype.with_check = null; + + /** + * Creates a new CreatePolicyStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreatePolicyStmt + * @static + * @param {pg_query.ICreatePolicyStmt=} [properties] Properties to set + * @returns {pg_query.CreatePolicyStmt} CreatePolicyStmt instance + */ + CreatePolicyStmt.create = function create(properties) { + return new CreatePolicyStmt(properties); + }; + + /** + * Encodes the specified CreatePolicyStmt message. Does not implicitly {@link pg_query.CreatePolicyStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreatePolicyStmt + * @static + * @param {pg_query.ICreatePolicyStmt} message CreatePolicyStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePolicyStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policy_name != null && Object.hasOwnProperty.call(message, "policy_name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.policy_name); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.pg_query.RangeVar.encode(message.table, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cmd_name != null && Object.hasOwnProperty.call(message, "cmd_name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.cmd_name); + if (message.permissive != null && Object.hasOwnProperty.call(message, "permissive")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.permissive); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + $root.pg_query.Node.encode(message.roles[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.qual != null && Object.hasOwnProperty.call(message, "qual")) + $root.pg_query.Node.encode(message.qual, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.with_check != null && Object.hasOwnProperty.call(message, "with_check")) + $root.pg_query.Node.encode(message.with_check, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePolicyStmt message, length delimited. Does not implicitly {@link pg_query.CreatePolicyStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreatePolicyStmt + * @static + * @param {pg_query.ICreatePolicyStmt} message CreatePolicyStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePolicyStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePolicyStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreatePolicyStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreatePolicyStmt} CreatePolicyStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePolicyStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreatePolicyStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.policy_name = reader.string(); + break; + } + case 2: { + message.table = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cmd_name = reader.string(); + break; + } + case 4: { + message.permissive = reader.bool(); + break; + } + case 5: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.qual = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 7: { + message.with_check = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePolicyStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreatePolicyStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreatePolicyStmt} CreatePolicyStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePolicyStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePolicyStmt message. + * @function verify + * @memberof pg_query.CreatePolicyStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePolicyStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policy_name != null && message.hasOwnProperty("policy_name")) + if (!$util.isString(message.policy_name)) + return "policy_name: string expected"; + if (message.table != null && message.hasOwnProperty("table")) { + var error = $root.pg_query.RangeVar.verify(message.table); + if (error) + return "table." + error; + } + if (message.cmd_name != null && message.hasOwnProperty("cmd_name")) + if (!$util.isString(message.cmd_name)) + return "cmd_name: string expected"; + if (message.permissive != null && message.hasOwnProperty("permissive")) + if (typeof message.permissive !== "boolean") + return "permissive: boolean expected"; + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) { + var error = $root.pg_query.Node.verify(message.roles[i]); + if (error) + return "roles." + error; + } + } + if (message.qual != null && message.hasOwnProperty("qual")) { + var error = $root.pg_query.Node.verify(message.qual); + if (error) + return "qual." + error; + } + if (message.with_check != null && message.hasOwnProperty("with_check")) { + var error = $root.pg_query.Node.verify(message.with_check); + if (error) + return "with_check." + error; + } + return null; + }; + + /** + * Creates a CreatePolicyStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreatePolicyStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreatePolicyStmt} CreatePolicyStmt + */ + CreatePolicyStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreatePolicyStmt) + return object; + var message = new $root.pg_query.CreatePolicyStmt(); + if (object.policy_name != null) + message.policy_name = String(object.policy_name); + if (object.table != null) { + if (typeof object.table !== "object") + throw TypeError(".pg_query.CreatePolicyStmt.table: object expected"); + message.table = $root.pg_query.RangeVar.fromObject(object.table); + } + if (object.cmd_name != null) + message.cmd_name = String(object.cmd_name); + if (object.permissive != null) + message.permissive = Boolean(object.permissive); + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".pg_query.CreatePolicyStmt.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) { + if (typeof object.roles[i] !== "object") + throw TypeError(".pg_query.CreatePolicyStmt.roles: object expected"); + message.roles[i] = $root.pg_query.Node.fromObject(object.roles[i]); + } + } + if (object.qual != null) { + if (typeof object.qual !== "object") + throw TypeError(".pg_query.CreatePolicyStmt.qual: object expected"); + message.qual = $root.pg_query.Node.fromObject(object.qual); + } + if (object.with_check != null) { + if (typeof object.with_check !== "object") + throw TypeError(".pg_query.CreatePolicyStmt.with_check: object expected"); + message.with_check = $root.pg_query.Node.fromObject(object.with_check); + } + return message; + }; + + /** + * Creates a plain object from a CreatePolicyStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreatePolicyStmt + * @static + * @param {pg_query.CreatePolicyStmt} message CreatePolicyStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePolicyStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.roles = []; + if (options.defaults) { + object.policy_name = ""; + object.table = null; + object.cmd_name = ""; + object.permissive = false; + object.qual = null; + object.with_check = null; + } + if (message.policy_name != null && message.hasOwnProperty("policy_name")) + object.policy_name = message.policy_name; + if (message.table != null && message.hasOwnProperty("table")) + object.table = $root.pg_query.RangeVar.toObject(message.table, options); + if (message.cmd_name != null && message.hasOwnProperty("cmd_name")) + object.cmd_name = message.cmd_name; + if (message.permissive != null && message.hasOwnProperty("permissive")) + object.permissive = message.permissive; + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = $root.pg_query.Node.toObject(message.roles[j], options); + } + if (message.qual != null && message.hasOwnProperty("qual")) + object.qual = $root.pg_query.Node.toObject(message.qual, options); + if (message.with_check != null && message.hasOwnProperty("with_check")) + object.with_check = $root.pg_query.Node.toObject(message.with_check, options); + return object; + }; + + /** + * Converts this CreatePolicyStmt to JSON. + * @function toJSON + * @memberof pg_query.CreatePolicyStmt + * @instance + * @returns {Object.} JSON object + */ + CreatePolicyStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePolicyStmt + * @function getTypeUrl + * @memberof pg_query.CreatePolicyStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePolicyStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreatePolicyStmt"; + }; + + return CreatePolicyStmt; + })(); + + pg_query.AlterPolicyStmt = (function() { + + /** + * Properties of an AlterPolicyStmt. + * @memberof pg_query + * @interface IAlterPolicyStmt + * @property {string|null} [policy_name] AlterPolicyStmt policy_name + * @property {pg_query.IRangeVar|null} [table] AlterPolicyStmt table + * @property {Array.|null} [roles] AlterPolicyStmt roles + * @property {pg_query.INode|null} [qual] AlterPolicyStmt qual + * @property {pg_query.INode|null} [with_check] AlterPolicyStmt with_check + */ + + /** + * Constructs a new AlterPolicyStmt. + * @memberof pg_query + * @classdesc Represents an AlterPolicyStmt. + * @implements IAlterPolicyStmt + * @constructor + * @param {pg_query.IAlterPolicyStmt=} [properties] Properties to set + */ + function AlterPolicyStmt(properties) { + this.roles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterPolicyStmt policy_name. + * @member {string} policy_name + * @memberof pg_query.AlterPolicyStmt + * @instance + */ + AlterPolicyStmt.prototype.policy_name = ""; + + /** + * AlterPolicyStmt table. + * @member {pg_query.IRangeVar|null|undefined} table + * @memberof pg_query.AlterPolicyStmt + * @instance + */ + AlterPolicyStmt.prototype.table = null; + + /** + * AlterPolicyStmt roles. + * @member {Array.} roles + * @memberof pg_query.AlterPolicyStmt + * @instance + */ + AlterPolicyStmt.prototype.roles = $util.emptyArray; + + /** + * AlterPolicyStmt qual. + * @member {pg_query.INode|null|undefined} qual + * @memberof pg_query.AlterPolicyStmt + * @instance + */ + AlterPolicyStmt.prototype.qual = null; + + /** + * AlterPolicyStmt with_check. + * @member {pg_query.INode|null|undefined} with_check + * @memberof pg_query.AlterPolicyStmt + * @instance + */ + AlterPolicyStmt.prototype.with_check = null; + + /** + * Creates a new AlterPolicyStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterPolicyStmt + * @static + * @param {pg_query.IAlterPolicyStmt=} [properties] Properties to set + * @returns {pg_query.AlterPolicyStmt} AlterPolicyStmt instance + */ + AlterPolicyStmt.create = function create(properties) { + return new AlterPolicyStmt(properties); + }; + + /** + * Encodes the specified AlterPolicyStmt message. Does not implicitly {@link pg_query.AlterPolicyStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterPolicyStmt + * @static + * @param {pg_query.IAlterPolicyStmt} message AlterPolicyStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterPolicyStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policy_name != null && Object.hasOwnProperty.call(message, "policy_name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.policy_name); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + $root.pg_query.RangeVar.encode(message.table, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.roles != null && message.roles.length) + for (var i = 0; i < message.roles.length; ++i) + $root.pg_query.Node.encode(message.roles[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.qual != null && Object.hasOwnProperty.call(message, "qual")) + $root.pg_query.Node.encode(message.qual, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.with_check != null && Object.hasOwnProperty.call(message, "with_check")) + $root.pg_query.Node.encode(message.with_check, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterPolicyStmt message, length delimited. Does not implicitly {@link pg_query.AlterPolicyStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterPolicyStmt + * @static + * @param {pg_query.IAlterPolicyStmt} message AlterPolicyStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterPolicyStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterPolicyStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterPolicyStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterPolicyStmt} AlterPolicyStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterPolicyStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterPolicyStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.policy_name = reader.string(); + break; + } + case 2: { + message.table = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.roles && message.roles.length)) + message.roles = []; + message.roles.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.qual = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + message.with_check = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterPolicyStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterPolicyStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterPolicyStmt} AlterPolicyStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterPolicyStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterPolicyStmt message. + * @function verify + * @memberof pg_query.AlterPolicyStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterPolicyStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policy_name != null && message.hasOwnProperty("policy_name")) + if (!$util.isString(message.policy_name)) + return "policy_name: string expected"; + if (message.table != null && message.hasOwnProperty("table")) { + var error = $root.pg_query.RangeVar.verify(message.table); + if (error) + return "table." + error; + } + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) { + var error = $root.pg_query.Node.verify(message.roles[i]); + if (error) + return "roles." + error; + } + } + if (message.qual != null && message.hasOwnProperty("qual")) { + var error = $root.pg_query.Node.verify(message.qual); + if (error) + return "qual." + error; + } + if (message.with_check != null && message.hasOwnProperty("with_check")) { + var error = $root.pg_query.Node.verify(message.with_check); + if (error) + return "with_check." + error; + } + return null; + }; + + /** + * Creates an AlterPolicyStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterPolicyStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterPolicyStmt} AlterPolicyStmt + */ + AlterPolicyStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterPolicyStmt) + return object; + var message = new $root.pg_query.AlterPolicyStmt(); + if (object.policy_name != null) + message.policy_name = String(object.policy_name); + if (object.table != null) { + if (typeof object.table !== "object") + throw TypeError(".pg_query.AlterPolicyStmt.table: object expected"); + message.table = $root.pg_query.RangeVar.fromObject(object.table); + } + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".pg_query.AlterPolicyStmt.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) { + if (typeof object.roles[i] !== "object") + throw TypeError(".pg_query.AlterPolicyStmt.roles: object expected"); + message.roles[i] = $root.pg_query.Node.fromObject(object.roles[i]); + } + } + if (object.qual != null) { + if (typeof object.qual !== "object") + throw TypeError(".pg_query.AlterPolicyStmt.qual: object expected"); + message.qual = $root.pg_query.Node.fromObject(object.qual); + } + if (object.with_check != null) { + if (typeof object.with_check !== "object") + throw TypeError(".pg_query.AlterPolicyStmt.with_check: object expected"); + message.with_check = $root.pg_query.Node.fromObject(object.with_check); + } + return message; + }; + + /** + * Creates a plain object from an AlterPolicyStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterPolicyStmt + * @static + * @param {pg_query.AlterPolicyStmt} message AlterPolicyStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterPolicyStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.roles = []; + if (options.defaults) { + object.policy_name = ""; + object.table = null; + object.qual = null; + object.with_check = null; + } + if (message.policy_name != null && message.hasOwnProperty("policy_name")) + object.policy_name = message.policy_name; + if (message.table != null && message.hasOwnProperty("table")) + object.table = $root.pg_query.RangeVar.toObject(message.table, options); + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = $root.pg_query.Node.toObject(message.roles[j], options); + } + if (message.qual != null && message.hasOwnProperty("qual")) + object.qual = $root.pg_query.Node.toObject(message.qual, options); + if (message.with_check != null && message.hasOwnProperty("with_check")) + object.with_check = $root.pg_query.Node.toObject(message.with_check, options); + return object; + }; + + /** + * Converts this AlterPolicyStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterPolicyStmt + * @instance + * @returns {Object.} JSON object + */ + AlterPolicyStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterPolicyStmt + * @function getTypeUrl + * @memberof pg_query.AlterPolicyStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterPolicyStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterPolicyStmt"; + }; + + return AlterPolicyStmt; + })(); + + pg_query.CreateTransformStmt = (function() { + + /** + * Properties of a CreateTransformStmt. + * @memberof pg_query + * @interface ICreateTransformStmt + * @property {boolean|null} [replace] CreateTransformStmt replace + * @property {pg_query.ITypeName|null} [type_name] CreateTransformStmt type_name + * @property {string|null} [lang] CreateTransformStmt lang + * @property {pg_query.IObjectWithArgs|null} [fromsql] CreateTransformStmt fromsql + * @property {pg_query.IObjectWithArgs|null} [tosql] CreateTransformStmt tosql + */ + + /** + * Constructs a new CreateTransformStmt. + * @memberof pg_query + * @classdesc Represents a CreateTransformStmt. + * @implements ICreateTransformStmt + * @constructor + * @param {pg_query.ICreateTransformStmt=} [properties] Properties to set + */ + function CreateTransformStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTransformStmt replace. + * @member {boolean} replace + * @memberof pg_query.CreateTransformStmt + * @instance + */ + CreateTransformStmt.prototype.replace = false; + + /** + * CreateTransformStmt type_name. + * @member {pg_query.ITypeName|null|undefined} type_name + * @memberof pg_query.CreateTransformStmt + * @instance + */ + CreateTransformStmt.prototype.type_name = null; + + /** + * CreateTransformStmt lang. + * @member {string} lang + * @memberof pg_query.CreateTransformStmt + * @instance + */ + CreateTransformStmt.prototype.lang = ""; + + /** + * CreateTransformStmt fromsql. + * @member {pg_query.IObjectWithArgs|null|undefined} fromsql + * @memberof pg_query.CreateTransformStmt + * @instance + */ + CreateTransformStmt.prototype.fromsql = null; + + /** + * CreateTransformStmt tosql. + * @member {pg_query.IObjectWithArgs|null|undefined} tosql + * @memberof pg_query.CreateTransformStmt + * @instance + */ + CreateTransformStmt.prototype.tosql = null; + + /** + * Creates a new CreateTransformStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateTransformStmt + * @static + * @param {pg_query.ICreateTransformStmt=} [properties] Properties to set + * @returns {pg_query.CreateTransformStmt} CreateTransformStmt instance + */ + CreateTransformStmt.create = function create(properties) { + return new CreateTransformStmt(properties); + }; + + /** + * Encodes the specified CreateTransformStmt message. Does not implicitly {@link pg_query.CreateTransformStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateTransformStmt + * @static + * @param {pg_query.ICreateTransformStmt} message CreateTransformStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTransformStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replace != null && Object.hasOwnProperty.call(message, "replace")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.replace); + if (message.type_name != null && Object.hasOwnProperty.call(message, "type_name")) + $root.pg_query.TypeName.encode(message.type_name, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lang != null && Object.hasOwnProperty.call(message, "lang")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.lang); + if (message.fromsql != null && Object.hasOwnProperty.call(message, "fromsql")) + $root.pg_query.ObjectWithArgs.encode(message.fromsql, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tosql != null && Object.hasOwnProperty.call(message, "tosql")) + $root.pg_query.ObjectWithArgs.encode(message.tosql, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTransformStmt message, length delimited. Does not implicitly {@link pg_query.CreateTransformStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateTransformStmt + * @static + * @param {pg_query.ICreateTransformStmt} message CreateTransformStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTransformStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTransformStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateTransformStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateTransformStmt} CreateTransformStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTransformStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateTransformStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.replace = reader.bool(); + break; + } + case 2: { + message.type_name = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 3: { + message.lang = reader.string(); + break; + } + case 4: { + message.fromsql = $root.pg_query.ObjectWithArgs.decode(reader, reader.uint32()); + break; + } + case 5: { + message.tosql = $root.pg_query.ObjectWithArgs.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTransformStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateTransformStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateTransformStmt} CreateTransformStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTransformStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTransformStmt message. + * @function verify + * @memberof pg_query.CreateTransformStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTransformStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replace != null && message.hasOwnProperty("replace")) + if (typeof message.replace !== "boolean") + return "replace: boolean expected"; + if (message.type_name != null && message.hasOwnProperty("type_name")) { + var error = $root.pg_query.TypeName.verify(message.type_name); + if (error) + return "type_name." + error; + } + if (message.lang != null && message.hasOwnProperty("lang")) + if (!$util.isString(message.lang)) + return "lang: string expected"; + if (message.fromsql != null && message.hasOwnProperty("fromsql")) { + var error = $root.pg_query.ObjectWithArgs.verify(message.fromsql); + if (error) + return "fromsql." + error; + } + if (message.tosql != null && message.hasOwnProperty("tosql")) { + var error = $root.pg_query.ObjectWithArgs.verify(message.tosql); + if (error) + return "tosql." + error; + } + return null; + }; + + /** + * Creates a CreateTransformStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateTransformStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateTransformStmt} CreateTransformStmt + */ + CreateTransformStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateTransformStmt) + return object; + var message = new $root.pg_query.CreateTransformStmt(); + if (object.replace != null) + message.replace = Boolean(object.replace); + if (object.type_name != null) { + if (typeof object.type_name !== "object") + throw TypeError(".pg_query.CreateTransformStmt.type_name: object expected"); + message.type_name = $root.pg_query.TypeName.fromObject(object.type_name); + } + if (object.lang != null) + message.lang = String(object.lang); + if (object.fromsql != null) { + if (typeof object.fromsql !== "object") + throw TypeError(".pg_query.CreateTransformStmt.fromsql: object expected"); + message.fromsql = $root.pg_query.ObjectWithArgs.fromObject(object.fromsql); + } + if (object.tosql != null) { + if (typeof object.tosql !== "object") + throw TypeError(".pg_query.CreateTransformStmt.tosql: object expected"); + message.tosql = $root.pg_query.ObjectWithArgs.fromObject(object.tosql); + } + return message; + }; + + /** + * Creates a plain object from a CreateTransformStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateTransformStmt + * @static + * @param {pg_query.CreateTransformStmt} message CreateTransformStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTransformStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.replace = false; + object.type_name = null; + object.lang = ""; + object.fromsql = null; + object.tosql = null; + } + if (message.replace != null && message.hasOwnProperty("replace")) + object.replace = message.replace; + if (message.type_name != null && message.hasOwnProperty("type_name")) + object.type_name = $root.pg_query.TypeName.toObject(message.type_name, options); + if (message.lang != null && message.hasOwnProperty("lang")) + object.lang = message.lang; + if (message.fromsql != null && message.hasOwnProperty("fromsql")) + object.fromsql = $root.pg_query.ObjectWithArgs.toObject(message.fromsql, options); + if (message.tosql != null && message.hasOwnProperty("tosql")) + object.tosql = $root.pg_query.ObjectWithArgs.toObject(message.tosql, options); + return object; + }; + + /** + * Converts this CreateTransformStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateTransformStmt + * @instance + * @returns {Object.} JSON object + */ + CreateTransformStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTransformStmt + * @function getTypeUrl + * @memberof pg_query.CreateTransformStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTransformStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateTransformStmt"; + }; + + return CreateTransformStmt; + })(); + + pg_query.CreateAmStmt = (function() { + + /** + * Properties of a CreateAmStmt. + * @memberof pg_query + * @interface ICreateAmStmt + * @property {string|null} [amname] CreateAmStmt amname + * @property {Array.|null} [handler_name] CreateAmStmt handler_name + * @property {string|null} [amtype] CreateAmStmt amtype + */ + + /** + * Constructs a new CreateAmStmt. + * @memberof pg_query + * @classdesc Represents a CreateAmStmt. + * @implements ICreateAmStmt + * @constructor + * @param {pg_query.ICreateAmStmt=} [properties] Properties to set + */ + function CreateAmStmt(properties) { + this.handler_name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAmStmt amname. + * @member {string} amname + * @memberof pg_query.CreateAmStmt + * @instance + */ + CreateAmStmt.prototype.amname = ""; + + /** + * CreateAmStmt handler_name. + * @member {Array.} handler_name + * @memberof pg_query.CreateAmStmt + * @instance + */ + CreateAmStmt.prototype.handler_name = $util.emptyArray; + + /** + * CreateAmStmt amtype. + * @member {string} amtype + * @memberof pg_query.CreateAmStmt + * @instance + */ + CreateAmStmt.prototype.amtype = ""; + + /** + * Creates a new CreateAmStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateAmStmt + * @static + * @param {pg_query.ICreateAmStmt=} [properties] Properties to set + * @returns {pg_query.CreateAmStmt} CreateAmStmt instance + */ + CreateAmStmt.create = function create(properties) { + return new CreateAmStmt(properties); + }; + + /** + * Encodes the specified CreateAmStmt message. Does not implicitly {@link pg_query.CreateAmStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateAmStmt + * @static + * @param {pg_query.ICreateAmStmt} message CreateAmStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAmStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amname != null && Object.hasOwnProperty.call(message, "amname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.amname); + if (message.handler_name != null && message.handler_name.length) + for (var i = 0; i < message.handler_name.length; ++i) + $root.pg_query.Node.encode(message.handler_name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.amtype != null && Object.hasOwnProperty.call(message, "amtype")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.amtype); + return writer; + }; + + /** + * Encodes the specified CreateAmStmt message, length delimited. Does not implicitly {@link pg_query.CreateAmStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateAmStmt + * @static + * @param {pg_query.ICreateAmStmt} message CreateAmStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAmStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAmStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateAmStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateAmStmt} CreateAmStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAmStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateAmStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.amname = reader.string(); + break; + } + case 2: { + if (!(message.handler_name && message.handler_name.length)) + message.handler_name = []; + message.handler_name.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.amtype = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAmStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateAmStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateAmStmt} CreateAmStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAmStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAmStmt message. + * @function verify + * @memberof pg_query.CreateAmStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAmStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amname != null && message.hasOwnProperty("amname")) + if (!$util.isString(message.amname)) + return "amname: string expected"; + if (message.handler_name != null && message.hasOwnProperty("handler_name")) { + if (!Array.isArray(message.handler_name)) + return "handler_name: array expected"; + for (var i = 0; i < message.handler_name.length; ++i) { + var error = $root.pg_query.Node.verify(message.handler_name[i]); + if (error) + return "handler_name." + error; + } + } + if (message.amtype != null && message.hasOwnProperty("amtype")) + if (!$util.isString(message.amtype)) + return "amtype: string expected"; + return null; + }; + + /** + * Creates a CreateAmStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateAmStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateAmStmt} CreateAmStmt + */ + CreateAmStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateAmStmt) + return object; + var message = new $root.pg_query.CreateAmStmt(); + if (object.amname != null) + message.amname = String(object.amname); + if (object.handler_name) { + if (!Array.isArray(object.handler_name)) + throw TypeError(".pg_query.CreateAmStmt.handler_name: array expected"); + message.handler_name = []; + for (var i = 0; i < object.handler_name.length; ++i) { + if (typeof object.handler_name[i] !== "object") + throw TypeError(".pg_query.CreateAmStmt.handler_name: object expected"); + message.handler_name[i] = $root.pg_query.Node.fromObject(object.handler_name[i]); + } + } + if (object.amtype != null) + message.amtype = String(object.amtype); + return message; + }; + + /** + * Creates a plain object from a CreateAmStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateAmStmt + * @static + * @param {pg_query.CreateAmStmt} message CreateAmStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAmStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.handler_name = []; + if (options.defaults) { + object.amname = ""; + object.amtype = ""; + } + if (message.amname != null && message.hasOwnProperty("amname")) + object.amname = message.amname; + if (message.handler_name && message.handler_name.length) { + object.handler_name = []; + for (var j = 0; j < message.handler_name.length; ++j) + object.handler_name[j] = $root.pg_query.Node.toObject(message.handler_name[j], options); + } + if (message.amtype != null && message.hasOwnProperty("amtype")) + object.amtype = message.amtype; + return object; + }; + + /** + * Converts this CreateAmStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateAmStmt + * @instance + * @returns {Object.} JSON object + */ + CreateAmStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAmStmt + * @function getTypeUrl + * @memberof pg_query.CreateAmStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAmStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateAmStmt"; + }; + + return CreateAmStmt; + })(); + + pg_query.CreatePublicationStmt = (function() { + + /** + * Properties of a CreatePublicationStmt. + * @memberof pg_query + * @interface ICreatePublicationStmt + * @property {string|null} [pubname] CreatePublicationStmt pubname + * @property {Array.|null} [options] CreatePublicationStmt options + * @property {Array.|null} [tables] CreatePublicationStmt tables + * @property {boolean|null} [for_all_tables] CreatePublicationStmt for_all_tables + */ + + /** + * Constructs a new CreatePublicationStmt. + * @memberof pg_query + * @classdesc Represents a CreatePublicationStmt. + * @implements ICreatePublicationStmt + * @constructor + * @param {pg_query.ICreatePublicationStmt=} [properties] Properties to set + */ + function CreatePublicationStmt(properties) { + this.options = []; + this.tables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePublicationStmt pubname. + * @member {string} pubname + * @memberof pg_query.CreatePublicationStmt + * @instance + */ + CreatePublicationStmt.prototype.pubname = ""; + + /** + * CreatePublicationStmt options. + * @member {Array.} options + * @memberof pg_query.CreatePublicationStmt + * @instance + */ + CreatePublicationStmt.prototype.options = $util.emptyArray; + + /** + * CreatePublicationStmt tables. + * @member {Array.} tables + * @memberof pg_query.CreatePublicationStmt + * @instance + */ + CreatePublicationStmt.prototype.tables = $util.emptyArray; + + /** + * CreatePublicationStmt for_all_tables. + * @member {boolean} for_all_tables + * @memberof pg_query.CreatePublicationStmt + * @instance + */ + CreatePublicationStmt.prototype.for_all_tables = false; + + /** + * Creates a new CreatePublicationStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreatePublicationStmt + * @static + * @param {pg_query.ICreatePublicationStmt=} [properties] Properties to set + * @returns {pg_query.CreatePublicationStmt} CreatePublicationStmt instance + */ + CreatePublicationStmt.create = function create(properties) { + return new CreatePublicationStmt(properties); + }; + + /** + * Encodes the specified CreatePublicationStmt message. Does not implicitly {@link pg_query.CreatePublicationStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreatePublicationStmt + * @static + * @param {pg_query.ICreatePublicationStmt} message CreatePublicationStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePublicationStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubname != null && Object.hasOwnProperty.call(message, "pubname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubname); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tables != null && message.tables.length) + for (var i = 0; i < message.tables.length; ++i) + $root.pg_query.Node.encode(message.tables[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.for_all_tables != null && Object.hasOwnProperty.call(message, "for_all_tables")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.for_all_tables); + return writer; + }; + + /** + * Encodes the specified CreatePublicationStmt message, length delimited. Does not implicitly {@link pg_query.CreatePublicationStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreatePublicationStmt + * @static + * @param {pg_query.ICreatePublicationStmt} message CreatePublicationStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePublicationStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePublicationStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreatePublicationStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreatePublicationStmt} CreatePublicationStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePublicationStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreatePublicationStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pubname = reader.string(); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.tables && message.tables.length)) + message.tables = []; + message.tables.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.for_all_tables = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePublicationStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreatePublicationStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreatePublicationStmt} CreatePublicationStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePublicationStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePublicationStmt message. + * @function verify + * @memberof pg_query.CreatePublicationStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePublicationStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubname != null && message.hasOwnProperty("pubname")) + if (!$util.isString(message.pubname)) + return "pubname: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.tables != null && message.hasOwnProperty("tables")) { + if (!Array.isArray(message.tables)) + return "tables: array expected"; + for (var i = 0; i < message.tables.length; ++i) { + var error = $root.pg_query.Node.verify(message.tables[i]); + if (error) + return "tables." + error; + } + } + if (message.for_all_tables != null && message.hasOwnProperty("for_all_tables")) + if (typeof message.for_all_tables !== "boolean") + return "for_all_tables: boolean expected"; + return null; + }; + + /** + * Creates a CreatePublicationStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreatePublicationStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreatePublicationStmt} CreatePublicationStmt + */ + CreatePublicationStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreatePublicationStmt) + return object; + var message = new $root.pg_query.CreatePublicationStmt(); + if (object.pubname != null) + message.pubname = String(object.pubname); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreatePublicationStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreatePublicationStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.tables) { + if (!Array.isArray(object.tables)) + throw TypeError(".pg_query.CreatePublicationStmt.tables: array expected"); + message.tables = []; + for (var i = 0; i < object.tables.length; ++i) { + if (typeof object.tables[i] !== "object") + throw TypeError(".pg_query.CreatePublicationStmt.tables: object expected"); + message.tables[i] = $root.pg_query.Node.fromObject(object.tables[i]); + } + } + if (object.for_all_tables != null) + message.for_all_tables = Boolean(object.for_all_tables); + return message; + }; + + /** + * Creates a plain object from a CreatePublicationStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreatePublicationStmt + * @static + * @param {pg_query.CreatePublicationStmt} message CreatePublicationStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePublicationStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.options = []; + object.tables = []; + } + if (options.defaults) { + object.pubname = ""; + object.for_all_tables = false; + } + if (message.pubname != null && message.hasOwnProperty("pubname")) + object.pubname = message.pubname; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.tables && message.tables.length) { + object.tables = []; + for (var j = 0; j < message.tables.length; ++j) + object.tables[j] = $root.pg_query.Node.toObject(message.tables[j], options); + } + if (message.for_all_tables != null && message.hasOwnProperty("for_all_tables")) + object.for_all_tables = message.for_all_tables; + return object; + }; + + /** + * Converts this CreatePublicationStmt to JSON. + * @function toJSON + * @memberof pg_query.CreatePublicationStmt + * @instance + * @returns {Object.} JSON object + */ + CreatePublicationStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePublicationStmt + * @function getTypeUrl + * @memberof pg_query.CreatePublicationStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePublicationStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreatePublicationStmt"; + }; + + return CreatePublicationStmt; + })(); + + pg_query.AlterPublicationStmt = (function() { + + /** + * Properties of an AlterPublicationStmt. + * @memberof pg_query + * @interface IAlterPublicationStmt + * @property {string|null} [pubname] AlterPublicationStmt pubname + * @property {Array.|null} [options] AlterPublicationStmt options + * @property {Array.|null} [tables] AlterPublicationStmt tables + * @property {boolean|null} [for_all_tables] AlterPublicationStmt for_all_tables + * @property {pg_query.DefElemAction|null} [tableAction] AlterPublicationStmt tableAction + */ + + /** + * Constructs a new AlterPublicationStmt. + * @memberof pg_query + * @classdesc Represents an AlterPublicationStmt. + * @implements IAlterPublicationStmt + * @constructor + * @param {pg_query.IAlterPublicationStmt=} [properties] Properties to set + */ + function AlterPublicationStmt(properties) { + this.options = []; + this.tables = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterPublicationStmt pubname. + * @member {string} pubname + * @memberof pg_query.AlterPublicationStmt + * @instance + */ + AlterPublicationStmt.prototype.pubname = ""; + + /** + * AlterPublicationStmt options. + * @member {Array.} options + * @memberof pg_query.AlterPublicationStmt + * @instance + */ + AlterPublicationStmt.prototype.options = $util.emptyArray; + + /** + * AlterPublicationStmt tables. + * @member {Array.} tables + * @memberof pg_query.AlterPublicationStmt + * @instance + */ + AlterPublicationStmt.prototype.tables = $util.emptyArray; + + /** + * AlterPublicationStmt for_all_tables. + * @member {boolean} for_all_tables + * @memberof pg_query.AlterPublicationStmt + * @instance + */ + AlterPublicationStmt.prototype.for_all_tables = false; + + /** + * AlterPublicationStmt tableAction. + * @member {pg_query.DefElemAction} tableAction + * @memberof pg_query.AlterPublicationStmt + * @instance + */ + AlterPublicationStmt.prototype.tableAction = 0; + + /** + * Creates a new AlterPublicationStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterPublicationStmt + * @static + * @param {pg_query.IAlterPublicationStmt=} [properties] Properties to set + * @returns {pg_query.AlterPublicationStmt} AlterPublicationStmt instance + */ + AlterPublicationStmt.create = function create(properties) { + return new AlterPublicationStmt(properties); + }; + + /** + * Encodes the specified AlterPublicationStmt message. Does not implicitly {@link pg_query.AlterPublicationStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterPublicationStmt + * @static + * @param {pg_query.IAlterPublicationStmt} message AlterPublicationStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterPublicationStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubname != null && Object.hasOwnProperty.call(message, "pubname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pubname); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tables != null && message.tables.length) + for (var i = 0; i < message.tables.length; ++i) + $root.pg_query.Node.encode(message.tables[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.for_all_tables != null && Object.hasOwnProperty.call(message, "for_all_tables")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.for_all_tables); + if (message.tableAction != null && Object.hasOwnProperty.call(message, "tableAction")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.tableAction); + return writer; + }; + + /** + * Encodes the specified AlterPublicationStmt message, length delimited. Does not implicitly {@link pg_query.AlterPublicationStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterPublicationStmt + * @static + * @param {pg_query.IAlterPublicationStmt} message AlterPublicationStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterPublicationStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterPublicationStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterPublicationStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterPublicationStmt} AlterPublicationStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterPublicationStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterPublicationStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pubname = reader.string(); + break; + } + case 2: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.tables && message.tables.length)) + message.tables = []; + message.tables.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.for_all_tables = reader.bool(); + break; + } + case 5: { + message.tableAction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterPublicationStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterPublicationStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterPublicationStmt} AlterPublicationStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterPublicationStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterPublicationStmt message. + * @function verify + * @memberof pg_query.AlterPublicationStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterPublicationStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pubname != null && message.hasOwnProperty("pubname")) + if (!$util.isString(message.pubname)) + return "pubname: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.tables != null && message.hasOwnProperty("tables")) { + if (!Array.isArray(message.tables)) + return "tables: array expected"; + for (var i = 0; i < message.tables.length; ++i) { + var error = $root.pg_query.Node.verify(message.tables[i]); + if (error) + return "tables." + error; + } + } + if (message.for_all_tables != null && message.hasOwnProperty("for_all_tables")) + if (typeof message.for_all_tables !== "boolean") + return "for_all_tables: boolean expected"; + if (message.tableAction != null && message.hasOwnProperty("tableAction")) + switch (message.tableAction) { + default: + return "tableAction: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates an AlterPublicationStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterPublicationStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterPublicationStmt} AlterPublicationStmt + */ + AlterPublicationStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterPublicationStmt) + return object; + var message = new $root.pg_query.AlterPublicationStmt(); + if (object.pubname != null) + message.pubname = String(object.pubname); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterPublicationStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterPublicationStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.tables) { + if (!Array.isArray(object.tables)) + throw TypeError(".pg_query.AlterPublicationStmt.tables: array expected"); + message.tables = []; + for (var i = 0; i < object.tables.length; ++i) { + if (typeof object.tables[i] !== "object") + throw TypeError(".pg_query.AlterPublicationStmt.tables: object expected"); + message.tables[i] = $root.pg_query.Node.fromObject(object.tables[i]); + } + } + if (object.for_all_tables != null) + message.for_all_tables = Boolean(object.for_all_tables); + switch (object.tableAction) { + default: + if (typeof object.tableAction === "number") { + message.tableAction = object.tableAction; + break; + } + break; + case "DEF_ELEM_ACTION_UNDEFINED": + case 0: + message.tableAction = 0; + break; + case "DEFELEM_UNSPEC": + case 1: + message.tableAction = 1; + break; + case "DEFELEM_SET": + case 2: + message.tableAction = 2; + break; + case "DEFELEM_ADD": + case 3: + message.tableAction = 3; + break; + case "DEFELEM_DROP": + case 4: + message.tableAction = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from an AlterPublicationStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterPublicationStmt + * @static + * @param {pg_query.AlterPublicationStmt} message AlterPublicationStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterPublicationStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.options = []; + object.tables = []; + } + if (options.defaults) { + object.pubname = ""; + object.for_all_tables = false; + object.tableAction = options.enums === String ? "DEF_ELEM_ACTION_UNDEFINED" : 0; + } + if (message.pubname != null && message.hasOwnProperty("pubname")) + object.pubname = message.pubname; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.tables && message.tables.length) { + object.tables = []; + for (var j = 0; j < message.tables.length; ++j) + object.tables[j] = $root.pg_query.Node.toObject(message.tables[j], options); + } + if (message.for_all_tables != null && message.hasOwnProperty("for_all_tables")) + object.for_all_tables = message.for_all_tables; + if (message.tableAction != null && message.hasOwnProperty("tableAction")) + object.tableAction = options.enums === String ? $root.pg_query.DefElemAction[message.tableAction] === undefined ? message.tableAction : $root.pg_query.DefElemAction[message.tableAction] : message.tableAction; + return object; + }; + + /** + * Converts this AlterPublicationStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterPublicationStmt + * @instance + * @returns {Object.} JSON object + */ + AlterPublicationStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterPublicationStmt + * @function getTypeUrl + * @memberof pg_query.AlterPublicationStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterPublicationStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterPublicationStmt"; + }; + + return AlterPublicationStmt; + })(); + + pg_query.CreateSubscriptionStmt = (function() { + + /** + * Properties of a CreateSubscriptionStmt. + * @memberof pg_query + * @interface ICreateSubscriptionStmt + * @property {string|null} [subname] CreateSubscriptionStmt subname + * @property {string|null} [conninfo] CreateSubscriptionStmt conninfo + * @property {Array.|null} [publication] CreateSubscriptionStmt publication + * @property {Array.|null} [options] CreateSubscriptionStmt options + */ + + /** + * Constructs a new CreateSubscriptionStmt. + * @memberof pg_query + * @classdesc Represents a CreateSubscriptionStmt. + * @implements ICreateSubscriptionStmt + * @constructor + * @param {pg_query.ICreateSubscriptionStmt=} [properties] Properties to set + */ + function CreateSubscriptionStmt(properties) { + this.publication = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSubscriptionStmt subname. + * @member {string} subname + * @memberof pg_query.CreateSubscriptionStmt + * @instance + */ + CreateSubscriptionStmt.prototype.subname = ""; + + /** + * CreateSubscriptionStmt conninfo. + * @member {string} conninfo + * @memberof pg_query.CreateSubscriptionStmt + * @instance + */ + CreateSubscriptionStmt.prototype.conninfo = ""; + + /** + * CreateSubscriptionStmt publication. + * @member {Array.} publication + * @memberof pg_query.CreateSubscriptionStmt + * @instance + */ + CreateSubscriptionStmt.prototype.publication = $util.emptyArray; + + /** + * CreateSubscriptionStmt options. + * @member {Array.} options + * @memberof pg_query.CreateSubscriptionStmt + * @instance + */ + CreateSubscriptionStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new CreateSubscriptionStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateSubscriptionStmt + * @static + * @param {pg_query.ICreateSubscriptionStmt=} [properties] Properties to set + * @returns {pg_query.CreateSubscriptionStmt} CreateSubscriptionStmt instance + */ + CreateSubscriptionStmt.create = function create(properties) { + return new CreateSubscriptionStmt(properties); + }; + + /** + * Encodes the specified CreateSubscriptionStmt message. Does not implicitly {@link pg_query.CreateSubscriptionStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateSubscriptionStmt + * @static + * @param {pg_query.ICreateSubscriptionStmt} message CreateSubscriptionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSubscriptionStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subname != null && Object.hasOwnProperty.call(message, "subname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subname); + if (message.conninfo != null && Object.hasOwnProperty.call(message, "conninfo")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.conninfo); + if (message.publication != null && message.publication.length) + for (var i = 0; i < message.publication.length; ++i) + $root.pg_query.Node.encode(message.publication[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSubscriptionStmt message, length delimited. Does not implicitly {@link pg_query.CreateSubscriptionStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateSubscriptionStmt + * @static + * @param {pg_query.ICreateSubscriptionStmt} message CreateSubscriptionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSubscriptionStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSubscriptionStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateSubscriptionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateSubscriptionStmt} CreateSubscriptionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSubscriptionStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateSubscriptionStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subname = reader.string(); + break; + } + case 2: { + message.conninfo = reader.string(); + break; + } + case 3: { + if (!(message.publication && message.publication.length)) + message.publication = []; + message.publication.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSubscriptionStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateSubscriptionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateSubscriptionStmt} CreateSubscriptionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSubscriptionStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSubscriptionStmt message. + * @function verify + * @memberof pg_query.CreateSubscriptionStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSubscriptionStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subname != null && message.hasOwnProperty("subname")) + if (!$util.isString(message.subname)) + return "subname: string expected"; + if (message.conninfo != null && message.hasOwnProperty("conninfo")) + if (!$util.isString(message.conninfo)) + return "conninfo: string expected"; + if (message.publication != null && message.hasOwnProperty("publication")) { + if (!Array.isArray(message.publication)) + return "publication: array expected"; + for (var i = 0; i < message.publication.length; ++i) { + var error = $root.pg_query.Node.verify(message.publication[i]); + if (error) + return "publication." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates a CreateSubscriptionStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateSubscriptionStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateSubscriptionStmt} CreateSubscriptionStmt + */ + CreateSubscriptionStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateSubscriptionStmt) + return object; + var message = new $root.pg_query.CreateSubscriptionStmt(); + if (object.subname != null) + message.subname = String(object.subname); + if (object.conninfo != null) + message.conninfo = String(object.conninfo); + if (object.publication) { + if (!Array.isArray(object.publication)) + throw TypeError(".pg_query.CreateSubscriptionStmt.publication: array expected"); + message.publication = []; + for (var i = 0; i < object.publication.length; ++i) { + if (typeof object.publication[i] !== "object") + throw TypeError(".pg_query.CreateSubscriptionStmt.publication: object expected"); + message.publication[i] = $root.pg_query.Node.fromObject(object.publication[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.CreateSubscriptionStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.CreateSubscriptionStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateSubscriptionStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateSubscriptionStmt + * @static + * @param {pg_query.CreateSubscriptionStmt} message CreateSubscriptionStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSubscriptionStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.publication = []; + object.options = []; + } + if (options.defaults) { + object.subname = ""; + object.conninfo = ""; + } + if (message.subname != null && message.hasOwnProperty("subname")) + object.subname = message.subname; + if (message.conninfo != null && message.hasOwnProperty("conninfo")) + object.conninfo = message.conninfo; + if (message.publication && message.publication.length) { + object.publication = []; + for (var j = 0; j < message.publication.length; ++j) + object.publication[j] = $root.pg_query.Node.toObject(message.publication[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this CreateSubscriptionStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateSubscriptionStmt + * @instance + * @returns {Object.} JSON object + */ + CreateSubscriptionStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSubscriptionStmt + * @function getTypeUrl + * @memberof pg_query.CreateSubscriptionStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSubscriptionStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateSubscriptionStmt"; + }; + + return CreateSubscriptionStmt; + })(); + + pg_query.AlterSubscriptionStmt = (function() { + + /** + * Properties of an AlterSubscriptionStmt. + * @memberof pg_query + * @interface IAlterSubscriptionStmt + * @property {pg_query.AlterSubscriptionType|null} [kind] AlterSubscriptionStmt kind + * @property {string|null} [subname] AlterSubscriptionStmt subname + * @property {string|null} [conninfo] AlterSubscriptionStmt conninfo + * @property {Array.|null} [publication] AlterSubscriptionStmt publication + * @property {Array.|null} [options] AlterSubscriptionStmt options + */ + + /** + * Constructs a new AlterSubscriptionStmt. + * @memberof pg_query + * @classdesc Represents an AlterSubscriptionStmt. + * @implements IAlterSubscriptionStmt + * @constructor + * @param {pg_query.IAlterSubscriptionStmt=} [properties] Properties to set + */ + function AlterSubscriptionStmt(properties) { + this.publication = []; + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterSubscriptionStmt kind. + * @member {pg_query.AlterSubscriptionType} kind + * @memberof pg_query.AlterSubscriptionStmt + * @instance + */ + AlterSubscriptionStmt.prototype.kind = 0; + + /** + * AlterSubscriptionStmt subname. + * @member {string} subname + * @memberof pg_query.AlterSubscriptionStmt + * @instance + */ + AlterSubscriptionStmt.prototype.subname = ""; + + /** + * AlterSubscriptionStmt conninfo. + * @member {string} conninfo + * @memberof pg_query.AlterSubscriptionStmt + * @instance + */ + AlterSubscriptionStmt.prototype.conninfo = ""; + + /** + * AlterSubscriptionStmt publication. + * @member {Array.} publication + * @memberof pg_query.AlterSubscriptionStmt + * @instance + */ + AlterSubscriptionStmt.prototype.publication = $util.emptyArray; + + /** + * AlterSubscriptionStmt options. + * @member {Array.} options + * @memberof pg_query.AlterSubscriptionStmt + * @instance + */ + AlterSubscriptionStmt.prototype.options = $util.emptyArray; + + /** + * Creates a new AlterSubscriptionStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterSubscriptionStmt + * @static + * @param {pg_query.IAlterSubscriptionStmt=} [properties] Properties to set + * @returns {pg_query.AlterSubscriptionStmt} AlterSubscriptionStmt instance + */ + AlterSubscriptionStmt.create = function create(properties) { + return new AlterSubscriptionStmt(properties); + }; + + /** + * Encodes the specified AlterSubscriptionStmt message. Does not implicitly {@link pg_query.AlterSubscriptionStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterSubscriptionStmt + * @static + * @param {pg_query.IAlterSubscriptionStmt} message AlterSubscriptionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterSubscriptionStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.subname != null && Object.hasOwnProperty.call(message, "subname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subname); + if (message.conninfo != null && Object.hasOwnProperty.call(message, "conninfo")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.conninfo); + if (message.publication != null && message.publication.length) + for (var i = 0; i < message.publication.length; ++i) + $root.pg_query.Node.encode(message.publication[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterSubscriptionStmt message, length delimited. Does not implicitly {@link pg_query.AlterSubscriptionStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterSubscriptionStmt + * @static + * @param {pg_query.IAlterSubscriptionStmt} message AlterSubscriptionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterSubscriptionStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterSubscriptionStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterSubscriptionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterSubscriptionStmt} AlterSubscriptionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterSubscriptionStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterSubscriptionStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.subname = reader.string(); + break; + } + case 3: { + message.conninfo = reader.string(); + break; + } + case 4: { + if (!(message.publication && message.publication.length)) + message.publication = []; + message.publication.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterSubscriptionStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterSubscriptionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterSubscriptionStmt} AlterSubscriptionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterSubscriptionStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterSubscriptionStmt message. + * @function verify + * @memberof pg_query.AlterSubscriptionStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterSubscriptionStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.subname != null && message.hasOwnProperty("subname")) + if (!$util.isString(message.subname)) + return "subname: string expected"; + if (message.conninfo != null && message.hasOwnProperty("conninfo")) + if (!$util.isString(message.conninfo)) + return "conninfo: string expected"; + if (message.publication != null && message.hasOwnProperty("publication")) { + if (!Array.isArray(message.publication)) + return "publication: array expected"; + for (var i = 0; i < message.publication.length; ++i) { + var error = $root.pg_query.Node.verify(message.publication[i]); + if (error) + return "publication." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + return null; + }; + + /** + * Creates an AlterSubscriptionStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterSubscriptionStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterSubscriptionStmt} AlterSubscriptionStmt + */ + AlterSubscriptionStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterSubscriptionStmt) + return object; + var message = new $root.pg_query.AlterSubscriptionStmt(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "ALTER_SUBSCRIPTION_TYPE_UNDEFINED": + case 0: + message.kind = 0; + break; + case "ALTER_SUBSCRIPTION_OPTIONS": + case 1: + message.kind = 1; + break; + case "ALTER_SUBSCRIPTION_CONNECTION": + case 2: + message.kind = 2; + break; + case "ALTER_SUBSCRIPTION_PUBLICATION": + case 3: + message.kind = 3; + break; + case "ALTER_SUBSCRIPTION_REFRESH": + case 4: + message.kind = 4; + break; + case "ALTER_SUBSCRIPTION_ENABLED": + case 5: + message.kind = 5; + break; + } + if (object.subname != null) + message.subname = String(object.subname); + if (object.conninfo != null) + message.conninfo = String(object.conninfo); + if (object.publication) { + if (!Array.isArray(object.publication)) + throw TypeError(".pg_query.AlterSubscriptionStmt.publication: array expected"); + message.publication = []; + for (var i = 0; i < object.publication.length; ++i) { + if (typeof object.publication[i] !== "object") + throw TypeError(".pg_query.AlterSubscriptionStmt.publication: object expected"); + message.publication[i] = $root.pg_query.Node.fromObject(object.publication[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.AlterSubscriptionStmt.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.AlterSubscriptionStmt.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlterSubscriptionStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterSubscriptionStmt + * @static + * @param {pg_query.AlterSubscriptionStmt} message AlterSubscriptionStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterSubscriptionStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.publication = []; + object.options = []; + } + if (options.defaults) { + object.kind = options.enums === String ? "ALTER_SUBSCRIPTION_TYPE_UNDEFINED" : 0; + object.subname = ""; + object.conninfo = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.pg_query.AlterSubscriptionType[message.kind] === undefined ? message.kind : $root.pg_query.AlterSubscriptionType[message.kind] : message.kind; + if (message.subname != null && message.hasOwnProperty("subname")) + object.subname = message.subname; + if (message.conninfo != null && message.hasOwnProperty("conninfo")) + object.conninfo = message.conninfo; + if (message.publication && message.publication.length) { + object.publication = []; + for (var j = 0; j < message.publication.length; ++j) + object.publication[j] = $root.pg_query.Node.toObject(message.publication[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + return object; + }; + + /** + * Converts this AlterSubscriptionStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterSubscriptionStmt + * @instance + * @returns {Object.} JSON object + */ + AlterSubscriptionStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterSubscriptionStmt + * @function getTypeUrl + * @memberof pg_query.AlterSubscriptionStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterSubscriptionStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterSubscriptionStmt"; + }; + + return AlterSubscriptionStmt; + })(); + + pg_query.DropSubscriptionStmt = (function() { + + /** + * Properties of a DropSubscriptionStmt. + * @memberof pg_query + * @interface IDropSubscriptionStmt + * @property {string|null} [subname] DropSubscriptionStmt subname + * @property {boolean|null} [missing_ok] DropSubscriptionStmt missing_ok + * @property {pg_query.DropBehavior|null} [behavior] DropSubscriptionStmt behavior + */ + + /** + * Constructs a new DropSubscriptionStmt. + * @memberof pg_query + * @classdesc Represents a DropSubscriptionStmt. + * @implements IDropSubscriptionStmt + * @constructor + * @param {pg_query.IDropSubscriptionStmt=} [properties] Properties to set + */ + function DropSubscriptionStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DropSubscriptionStmt subname. + * @member {string} subname + * @memberof pg_query.DropSubscriptionStmt + * @instance + */ + DropSubscriptionStmt.prototype.subname = ""; + + /** + * DropSubscriptionStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.DropSubscriptionStmt + * @instance + */ + DropSubscriptionStmt.prototype.missing_ok = false; + + /** + * DropSubscriptionStmt behavior. + * @member {pg_query.DropBehavior} behavior + * @memberof pg_query.DropSubscriptionStmt + * @instance + */ + DropSubscriptionStmt.prototype.behavior = 0; + + /** + * Creates a new DropSubscriptionStmt instance using the specified properties. + * @function create + * @memberof pg_query.DropSubscriptionStmt + * @static + * @param {pg_query.IDropSubscriptionStmt=} [properties] Properties to set + * @returns {pg_query.DropSubscriptionStmt} DropSubscriptionStmt instance + */ + DropSubscriptionStmt.create = function create(properties) { + return new DropSubscriptionStmt(properties); + }; + + /** + * Encodes the specified DropSubscriptionStmt message. Does not implicitly {@link pg_query.DropSubscriptionStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.DropSubscriptionStmt + * @static + * @param {pg_query.IDropSubscriptionStmt} message DropSubscriptionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropSubscriptionStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subname != null && Object.hasOwnProperty.call(message, "subname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.subname); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.missing_ok); + if (message.behavior != null && Object.hasOwnProperty.call(message, "behavior")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.behavior); + return writer; + }; + + /** + * Encodes the specified DropSubscriptionStmt message, length delimited. Does not implicitly {@link pg_query.DropSubscriptionStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DropSubscriptionStmt + * @static + * @param {pg_query.IDropSubscriptionStmt} message DropSubscriptionStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DropSubscriptionStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DropSubscriptionStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DropSubscriptionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DropSubscriptionStmt} DropSubscriptionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropSubscriptionStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DropSubscriptionStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.subname = reader.string(); + break; + } + case 2: { + message.missing_ok = reader.bool(); + break; + } + case 3: { + message.behavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DropSubscriptionStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DropSubscriptionStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DropSubscriptionStmt} DropSubscriptionStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DropSubscriptionStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DropSubscriptionStmt message. + * @function verify + * @memberof pg_query.DropSubscriptionStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DropSubscriptionStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subname != null && message.hasOwnProperty("subname")) + if (!$util.isString(message.subname)) + return "subname: string expected"; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + if (message.behavior != null && message.hasOwnProperty("behavior")) + switch (message.behavior) { + default: + return "behavior: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a DropSubscriptionStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DropSubscriptionStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DropSubscriptionStmt} DropSubscriptionStmt + */ + DropSubscriptionStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DropSubscriptionStmt) + return object; + var message = new $root.pg_query.DropSubscriptionStmt(); + if (object.subname != null) + message.subname = String(object.subname); + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + switch (object.behavior) { + default: + if (typeof object.behavior === "number") { + message.behavior = object.behavior; + break; + } + break; + case "DROP_BEHAVIOR_UNDEFINED": + case 0: + message.behavior = 0; + break; + case "DROP_RESTRICT": + case 1: + message.behavior = 1; + break; + case "DROP_CASCADE": + case 2: + message.behavior = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a DropSubscriptionStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DropSubscriptionStmt + * @static + * @param {pg_query.DropSubscriptionStmt} message DropSubscriptionStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DropSubscriptionStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.subname = ""; + object.missing_ok = false; + object.behavior = options.enums === String ? "DROP_BEHAVIOR_UNDEFINED" : 0; + } + if (message.subname != null && message.hasOwnProperty("subname")) + object.subname = message.subname; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + if (message.behavior != null && message.hasOwnProperty("behavior")) + object.behavior = options.enums === String ? $root.pg_query.DropBehavior[message.behavior] === undefined ? message.behavior : $root.pg_query.DropBehavior[message.behavior] : message.behavior; + return object; + }; + + /** + * Converts this DropSubscriptionStmt to JSON. + * @function toJSON + * @memberof pg_query.DropSubscriptionStmt + * @instance + * @returns {Object.} JSON object + */ + DropSubscriptionStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DropSubscriptionStmt + * @function getTypeUrl + * @memberof pg_query.DropSubscriptionStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DropSubscriptionStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DropSubscriptionStmt"; + }; + + return DropSubscriptionStmt; + })(); + + pg_query.CreateStatsStmt = (function() { + + /** + * Properties of a CreateStatsStmt. + * @memberof pg_query + * @interface ICreateStatsStmt + * @property {Array.|null} [defnames] CreateStatsStmt defnames + * @property {Array.|null} [stat_types] CreateStatsStmt stat_types + * @property {Array.|null} [exprs] CreateStatsStmt exprs + * @property {Array.|null} [relations] CreateStatsStmt relations + * @property {string|null} [stxcomment] CreateStatsStmt stxcomment + * @property {boolean|null} [if_not_exists] CreateStatsStmt if_not_exists + */ + + /** + * Constructs a new CreateStatsStmt. + * @memberof pg_query + * @classdesc Represents a CreateStatsStmt. + * @implements ICreateStatsStmt + * @constructor + * @param {pg_query.ICreateStatsStmt=} [properties] Properties to set + */ + function CreateStatsStmt(properties) { + this.defnames = []; + this.stat_types = []; + this.exprs = []; + this.relations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateStatsStmt defnames. + * @member {Array.} defnames + * @memberof pg_query.CreateStatsStmt + * @instance + */ + CreateStatsStmt.prototype.defnames = $util.emptyArray; + + /** + * CreateStatsStmt stat_types. + * @member {Array.} stat_types + * @memberof pg_query.CreateStatsStmt + * @instance + */ + CreateStatsStmt.prototype.stat_types = $util.emptyArray; + + /** + * CreateStatsStmt exprs. + * @member {Array.} exprs + * @memberof pg_query.CreateStatsStmt + * @instance + */ + CreateStatsStmt.prototype.exprs = $util.emptyArray; + + /** + * CreateStatsStmt relations. + * @member {Array.} relations + * @memberof pg_query.CreateStatsStmt + * @instance + */ + CreateStatsStmt.prototype.relations = $util.emptyArray; + + /** + * CreateStatsStmt stxcomment. + * @member {string} stxcomment + * @memberof pg_query.CreateStatsStmt + * @instance + */ + CreateStatsStmt.prototype.stxcomment = ""; + + /** + * CreateStatsStmt if_not_exists. + * @member {boolean} if_not_exists + * @memberof pg_query.CreateStatsStmt + * @instance + */ + CreateStatsStmt.prototype.if_not_exists = false; + + /** + * Creates a new CreateStatsStmt instance using the specified properties. + * @function create + * @memberof pg_query.CreateStatsStmt + * @static + * @param {pg_query.ICreateStatsStmt=} [properties] Properties to set + * @returns {pg_query.CreateStatsStmt} CreateStatsStmt instance + */ + CreateStatsStmt.create = function create(properties) { + return new CreateStatsStmt(properties); + }; + + /** + * Encodes the specified CreateStatsStmt message. Does not implicitly {@link pg_query.CreateStatsStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateStatsStmt + * @static + * @param {pg_query.ICreateStatsStmt} message CreateStatsStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateStatsStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defnames != null && message.defnames.length) + for (var i = 0; i < message.defnames.length; ++i) + $root.pg_query.Node.encode(message.defnames[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stat_types != null && message.stat_types.length) + for (var i = 0; i < message.stat_types.length; ++i) + $root.pg_query.Node.encode(message.stat_types[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.exprs != null && message.exprs.length) + for (var i = 0; i < message.exprs.length; ++i) + $root.pg_query.Node.encode(message.exprs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.relations != null && message.relations.length) + for (var i = 0; i < message.relations.length; ++i) + $root.pg_query.Node.encode(message.relations[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.stxcomment != null && Object.hasOwnProperty.call(message, "stxcomment")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stxcomment); + if (message.if_not_exists != null && Object.hasOwnProperty.call(message, "if_not_exists")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.if_not_exists); + return writer; + }; + + /** + * Encodes the specified CreateStatsStmt message, length delimited. Does not implicitly {@link pg_query.CreateStatsStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateStatsStmt + * @static + * @param {pg_query.ICreateStatsStmt} message CreateStatsStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateStatsStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateStatsStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateStatsStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateStatsStmt} CreateStatsStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateStatsStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateStatsStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defnames && message.defnames.length)) + message.defnames = []; + message.defnames.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.stat_types && message.stat_types.length)) + message.stat_types = []; + message.stat_types.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.exprs && message.exprs.length)) + message.exprs = []; + message.exprs.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.relations && message.relations.length)) + message.relations = []; + message.relations.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.stxcomment = reader.string(); + break; + } + case 6: { + message.if_not_exists = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateStatsStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateStatsStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateStatsStmt} CreateStatsStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateStatsStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateStatsStmt message. + * @function verify + * @memberof pg_query.CreateStatsStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateStatsStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defnames != null && message.hasOwnProperty("defnames")) { + if (!Array.isArray(message.defnames)) + return "defnames: array expected"; + for (var i = 0; i < message.defnames.length; ++i) { + var error = $root.pg_query.Node.verify(message.defnames[i]); + if (error) + return "defnames." + error; + } + } + if (message.stat_types != null && message.hasOwnProperty("stat_types")) { + if (!Array.isArray(message.stat_types)) + return "stat_types: array expected"; + for (var i = 0; i < message.stat_types.length; ++i) { + var error = $root.pg_query.Node.verify(message.stat_types[i]); + if (error) + return "stat_types." + error; + } + } + if (message.exprs != null && message.hasOwnProperty("exprs")) { + if (!Array.isArray(message.exprs)) + return "exprs: array expected"; + for (var i = 0; i < message.exprs.length; ++i) { + var error = $root.pg_query.Node.verify(message.exprs[i]); + if (error) + return "exprs." + error; + } + } + if (message.relations != null && message.hasOwnProperty("relations")) { + if (!Array.isArray(message.relations)) + return "relations: array expected"; + for (var i = 0; i < message.relations.length; ++i) { + var error = $root.pg_query.Node.verify(message.relations[i]); + if (error) + return "relations." + error; + } + } + if (message.stxcomment != null && message.hasOwnProperty("stxcomment")) + if (!$util.isString(message.stxcomment)) + return "stxcomment: string expected"; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + if (typeof message.if_not_exists !== "boolean") + return "if_not_exists: boolean expected"; + return null; + }; + + /** + * Creates a CreateStatsStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateStatsStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateStatsStmt} CreateStatsStmt + */ + CreateStatsStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateStatsStmt) + return object; + var message = new $root.pg_query.CreateStatsStmt(); + if (object.defnames) { + if (!Array.isArray(object.defnames)) + throw TypeError(".pg_query.CreateStatsStmt.defnames: array expected"); + message.defnames = []; + for (var i = 0; i < object.defnames.length; ++i) { + if (typeof object.defnames[i] !== "object") + throw TypeError(".pg_query.CreateStatsStmt.defnames: object expected"); + message.defnames[i] = $root.pg_query.Node.fromObject(object.defnames[i]); + } + } + if (object.stat_types) { + if (!Array.isArray(object.stat_types)) + throw TypeError(".pg_query.CreateStatsStmt.stat_types: array expected"); + message.stat_types = []; + for (var i = 0; i < object.stat_types.length; ++i) { + if (typeof object.stat_types[i] !== "object") + throw TypeError(".pg_query.CreateStatsStmt.stat_types: object expected"); + message.stat_types[i] = $root.pg_query.Node.fromObject(object.stat_types[i]); + } + } + if (object.exprs) { + if (!Array.isArray(object.exprs)) + throw TypeError(".pg_query.CreateStatsStmt.exprs: array expected"); + message.exprs = []; + for (var i = 0; i < object.exprs.length; ++i) { + if (typeof object.exprs[i] !== "object") + throw TypeError(".pg_query.CreateStatsStmt.exprs: object expected"); + message.exprs[i] = $root.pg_query.Node.fromObject(object.exprs[i]); + } + } + if (object.relations) { + if (!Array.isArray(object.relations)) + throw TypeError(".pg_query.CreateStatsStmt.relations: array expected"); + message.relations = []; + for (var i = 0; i < object.relations.length; ++i) { + if (typeof object.relations[i] !== "object") + throw TypeError(".pg_query.CreateStatsStmt.relations: object expected"); + message.relations[i] = $root.pg_query.Node.fromObject(object.relations[i]); + } + } + if (object.stxcomment != null) + message.stxcomment = String(object.stxcomment); + if (object.if_not_exists != null) + message.if_not_exists = Boolean(object.if_not_exists); + return message; + }; + + /** + * Creates a plain object from a CreateStatsStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateStatsStmt + * @static + * @param {pg_query.CreateStatsStmt} message CreateStatsStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateStatsStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.defnames = []; + object.stat_types = []; + object.exprs = []; + object.relations = []; + } + if (options.defaults) { + object.stxcomment = ""; + object.if_not_exists = false; + } + if (message.defnames && message.defnames.length) { + object.defnames = []; + for (var j = 0; j < message.defnames.length; ++j) + object.defnames[j] = $root.pg_query.Node.toObject(message.defnames[j], options); + } + if (message.stat_types && message.stat_types.length) { + object.stat_types = []; + for (var j = 0; j < message.stat_types.length; ++j) + object.stat_types[j] = $root.pg_query.Node.toObject(message.stat_types[j], options); + } + if (message.exprs && message.exprs.length) { + object.exprs = []; + for (var j = 0; j < message.exprs.length; ++j) + object.exprs[j] = $root.pg_query.Node.toObject(message.exprs[j], options); + } + if (message.relations && message.relations.length) { + object.relations = []; + for (var j = 0; j < message.relations.length; ++j) + object.relations[j] = $root.pg_query.Node.toObject(message.relations[j], options); + } + if (message.stxcomment != null && message.hasOwnProperty("stxcomment")) + object.stxcomment = message.stxcomment; + if (message.if_not_exists != null && message.hasOwnProperty("if_not_exists")) + object.if_not_exists = message.if_not_exists; + return object; + }; + + /** + * Converts this CreateStatsStmt to JSON. + * @function toJSON + * @memberof pg_query.CreateStatsStmt + * @instance + * @returns {Object.} JSON object + */ + CreateStatsStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateStatsStmt + * @function getTypeUrl + * @memberof pg_query.CreateStatsStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateStatsStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateStatsStmt"; + }; + + return CreateStatsStmt; + })(); + + pg_query.AlterCollationStmt = (function() { + + /** + * Properties of an AlterCollationStmt. + * @memberof pg_query + * @interface IAlterCollationStmt + * @property {Array.|null} [collname] AlterCollationStmt collname + */ + + /** + * Constructs a new AlterCollationStmt. + * @memberof pg_query + * @classdesc Represents an AlterCollationStmt. + * @implements IAlterCollationStmt + * @constructor + * @param {pg_query.IAlterCollationStmt=} [properties] Properties to set + */ + function AlterCollationStmt(properties) { + this.collname = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterCollationStmt collname. + * @member {Array.} collname + * @memberof pg_query.AlterCollationStmt + * @instance + */ + AlterCollationStmt.prototype.collname = $util.emptyArray; + + /** + * Creates a new AlterCollationStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterCollationStmt + * @static + * @param {pg_query.IAlterCollationStmt=} [properties] Properties to set + * @returns {pg_query.AlterCollationStmt} AlterCollationStmt instance + */ + AlterCollationStmt.create = function create(properties) { + return new AlterCollationStmt(properties); + }; + + /** + * Encodes the specified AlterCollationStmt message. Does not implicitly {@link pg_query.AlterCollationStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterCollationStmt + * @static + * @param {pg_query.IAlterCollationStmt} message AlterCollationStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterCollationStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.collname != null && message.collname.length) + for (var i = 0; i < message.collname.length; ++i) + $root.pg_query.Node.encode(message.collname[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AlterCollationStmt message, length delimited. Does not implicitly {@link pg_query.AlterCollationStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterCollationStmt + * @static + * @param {pg_query.IAlterCollationStmt} message AlterCollationStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterCollationStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterCollationStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterCollationStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterCollationStmt} AlterCollationStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterCollationStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterCollationStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.collname && message.collname.length)) + message.collname = []; + message.collname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterCollationStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterCollationStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterCollationStmt} AlterCollationStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterCollationStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterCollationStmt message. + * @function verify + * @memberof pg_query.AlterCollationStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterCollationStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.collname != null && message.hasOwnProperty("collname")) { + if (!Array.isArray(message.collname)) + return "collname: array expected"; + for (var i = 0; i < message.collname.length; ++i) { + var error = $root.pg_query.Node.verify(message.collname[i]); + if (error) + return "collname." + error; + } + } + return null; + }; + + /** + * Creates an AlterCollationStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterCollationStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterCollationStmt} AlterCollationStmt + */ + AlterCollationStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterCollationStmt) + return object; + var message = new $root.pg_query.AlterCollationStmt(); + if (object.collname) { + if (!Array.isArray(object.collname)) + throw TypeError(".pg_query.AlterCollationStmt.collname: array expected"); + message.collname = []; + for (var i = 0; i < object.collname.length; ++i) { + if (typeof object.collname[i] !== "object") + throw TypeError(".pg_query.AlterCollationStmt.collname: object expected"); + message.collname[i] = $root.pg_query.Node.fromObject(object.collname[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AlterCollationStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterCollationStmt + * @static + * @param {pg_query.AlterCollationStmt} message AlterCollationStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterCollationStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.collname = []; + if (message.collname && message.collname.length) { + object.collname = []; + for (var j = 0; j < message.collname.length; ++j) + object.collname[j] = $root.pg_query.Node.toObject(message.collname[j], options); + } + return object; + }; + + /** + * Converts this AlterCollationStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterCollationStmt + * @instance + * @returns {Object.} JSON object + */ + AlterCollationStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterCollationStmt + * @function getTypeUrl + * @memberof pg_query.AlterCollationStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterCollationStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterCollationStmt"; + }; + + return AlterCollationStmt; + })(); + + pg_query.CallStmt = (function() { + + /** + * Properties of a CallStmt. + * @memberof pg_query + * @interface ICallStmt + * @property {pg_query.IFuncCall|null} [funccall] CallStmt funccall + * @property {pg_query.IFuncExpr|null} [funcexpr] CallStmt funcexpr + */ + + /** + * Constructs a new CallStmt. + * @memberof pg_query + * @classdesc Represents a CallStmt. + * @implements ICallStmt + * @constructor + * @param {pg_query.ICallStmt=} [properties] Properties to set + */ + function CallStmt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CallStmt funccall. + * @member {pg_query.IFuncCall|null|undefined} funccall + * @memberof pg_query.CallStmt + * @instance + */ + CallStmt.prototype.funccall = null; + + /** + * CallStmt funcexpr. + * @member {pg_query.IFuncExpr|null|undefined} funcexpr + * @memberof pg_query.CallStmt + * @instance + */ + CallStmt.prototype.funcexpr = null; + + /** + * Creates a new CallStmt instance using the specified properties. + * @function create + * @memberof pg_query.CallStmt + * @static + * @param {pg_query.ICallStmt=} [properties] Properties to set + * @returns {pg_query.CallStmt} CallStmt instance + */ + CallStmt.create = function create(properties) { + return new CallStmt(properties); + }; + + /** + * Encodes the specified CallStmt message. Does not implicitly {@link pg_query.CallStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.CallStmt + * @static + * @param {pg_query.ICallStmt} message CallStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CallStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.funccall != null && Object.hasOwnProperty.call(message, "funccall")) + $root.pg_query.FuncCall.encode(message.funccall, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.funcexpr != null && Object.hasOwnProperty.call(message, "funcexpr")) + $root.pg_query.FuncExpr.encode(message.funcexpr, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CallStmt message, length delimited. Does not implicitly {@link pg_query.CallStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CallStmt + * @static + * @param {pg_query.ICallStmt} message CallStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CallStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CallStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CallStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CallStmt} CallStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CallStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CallStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.funccall = $root.pg_query.FuncCall.decode(reader, reader.uint32()); + break; + } + case 2: { + message.funcexpr = $root.pg_query.FuncExpr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CallStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CallStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CallStmt} CallStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CallStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CallStmt message. + * @function verify + * @memberof pg_query.CallStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CallStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.funccall != null && message.hasOwnProperty("funccall")) { + var error = $root.pg_query.FuncCall.verify(message.funccall); + if (error) + return "funccall." + error; + } + if (message.funcexpr != null && message.hasOwnProperty("funcexpr")) { + var error = $root.pg_query.FuncExpr.verify(message.funcexpr); + if (error) + return "funcexpr." + error; + } + return null; + }; + + /** + * Creates a CallStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CallStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CallStmt} CallStmt + */ + CallStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CallStmt) + return object; + var message = new $root.pg_query.CallStmt(); + if (object.funccall != null) { + if (typeof object.funccall !== "object") + throw TypeError(".pg_query.CallStmt.funccall: object expected"); + message.funccall = $root.pg_query.FuncCall.fromObject(object.funccall); + } + if (object.funcexpr != null) { + if (typeof object.funcexpr !== "object") + throw TypeError(".pg_query.CallStmt.funcexpr: object expected"); + message.funcexpr = $root.pg_query.FuncExpr.fromObject(object.funcexpr); + } + return message; + }; + + /** + * Creates a plain object from a CallStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CallStmt + * @static + * @param {pg_query.CallStmt} message CallStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CallStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.funccall = null; + object.funcexpr = null; + } + if (message.funccall != null && message.hasOwnProperty("funccall")) + object.funccall = $root.pg_query.FuncCall.toObject(message.funccall, options); + if (message.funcexpr != null && message.hasOwnProperty("funcexpr")) + object.funcexpr = $root.pg_query.FuncExpr.toObject(message.funcexpr, options); + return object; + }; + + /** + * Converts this CallStmt to JSON. + * @function toJSON + * @memberof pg_query.CallStmt + * @instance + * @returns {Object.} JSON object + */ + CallStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CallStmt + * @function getTypeUrl + * @memberof pg_query.CallStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CallStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CallStmt"; + }; + + return CallStmt; + })(); + + pg_query.AlterStatsStmt = (function() { + + /** + * Properties of an AlterStatsStmt. + * @memberof pg_query + * @interface IAlterStatsStmt + * @property {Array.|null} [defnames] AlterStatsStmt defnames + * @property {number|null} [stxstattarget] AlterStatsStmt stxstattarget + * @property {boolean|null} [missing_ok] AlterStatsStmt missing_ok + */ + + /** + * Constructs a new AlterStatsStmt. + * @memberof pg_query + * @classdesc Represents an AlterStatsStmt. + * @implements IAlterStatsStmt + * @constructor + * @param {pg_query.IAlterStatsStmt=} [properties] Properties to set + */ + function AlterStatsStmt(properties) { + this.defnames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AlterStatsStmt defnames. + * @member {Array.} defnames + * @memberof pg_query.AlterStatsStmt + * @instance + */ + AlterStatsStmt.prototype.defnames = $util.emptyArray; + + /** + * AlterStatsStmt stxstattarget. + * @member {number} stxstattarget + * @memberof pg_query.AlterStatsStmt + * @instance + */ + AlterStatsStmt.prototype.stxstattarget = 0; + + /** + * AlterStatsStmt missing_ok. + * @member {boolean} missing_ok + * @memberof pg_query.AlterStatsStmt + * @instance + */ + AlterStatsStmt.prototype.missing_ok = false; + + /** + * Creates a new AlterStatsStmt instance using the specified properties. + * @function create + * @memberof pg_query.AlterStatsStmt + * @static + * @param {pg_query.IAlterStatsStmt=} [properties] Properties to set + * @returns {pg_query.AlterStatsStmt} AlterStatsStmt instance + */ + AlterStatsStmt.create = function create(properties) { + return new AlterStatsStmt(properties); + }; + + /** + * Encodes the specified AlterStatsStmt message. Does not implicitly {@link pg_query.AlterStatsStmt.verify|verify} messages. + * @function encode + * @memberof pg_query.AlterStatsStmt + * @static + * @param {pg_query.IAlterStatsStmt} message AlterStatsStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterStatsStmt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defnames != null && message.defnames.length) + for (var i = 0; i < message.defnames.length; ++i) + $root.pg_query.Node.encode(message.defnames[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.stxstattarget != null && Object.hasOwnProperty.call(message, "stxstattarget")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.stxstattarget); + if (message.missing_ok != null && Object.hasOwnProperty.call(message, "missing_ok")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.missing_ok); + return writer; + }; + + /** + * Encodes the specified AlterStatsStmt message, length delimited. Does not implicitly {@link pg_query.AlterStatsStmt.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AlterStatsStmt + * @static + * @param {pg_query.IAlterStatsStmt} message AlterStatsStmt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AlterStatsStmt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AlterStatsStmt message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AlterStatsStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AlterStatsStmt} AlterStatsStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterStatsStmt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AlterStatsStmt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defnames && message.defnames.length)) + message.defnames = []; + message.defnames.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.stxstattarget = reader.int32(); + break; + } + case 3: { + message.missing_ok = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AlterStatsStmt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AlterStatsStmt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AlterStatsStmt} AlterStatsStmt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AlterStatsStmt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AlterStatsStmt message. + * @function verify + * @memberof pg_query.AlterStatsStmt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AlterStatsStmt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defnames != null && message.hasOwnProperty("defnames")) { + if (!Array.isArray(message.defnames)) + return "defnames: array expected"; + for (var i = 0; i < message.defnames.length; ++i) { + var error = $root.pg_query.Node.verify(message.defnames[i]); + if (error) + return "defnames." + error; + } + } + if (message.stxstattarget != null && message.hasOwnProperty("stxstattarget")) + if (!$util.isInteger(message.stxstattarget)) + return "stxstattarget: integer expected"; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + if (typeof message.missing_ok !== "boolean") + return "missing_ok: boolean expected"; + return null; + }; + + /** + * Creates an AlterStatsStmt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AlterStatsStmt + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AlterStatsStmt} AlterStatsStmt + */ + AlterStatsStmt.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AlterStatsStmt) + return object; + var message = new $root.pg_query.AlterStatsStmt(); + if (object.defnames) { + if (!Array.isArray(object.defnames)) + throw TypeError(".pg_query.AlterStatsStmt.defnames: array expected"); + message.defnames = []; + for (var i = 0; i < object.defnames.length; ++i) { + if (typeof object.defnames[i] !== "object") + throw TypeError(".pg_query.AlterStatsStmt.defnames: object expected"); + message.defnames[i] = $root.pg_query.Node.fromObject(object.defnames[i]); + } + } + if (object.stxstattarget != null) + message.stxstattarget = object.stxstattarget | 0; + if (object.missing_ok != null) + message.missing_ok = Boolean(object.missing_ok); + return message; + }; + + /** + * Creates a plain object from an AlterStatsStmt message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AlterStatsStmt + * @static + * @param {pg_query.AlterStatsStmt} message AlterStatsStmt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AlterStatsStmt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defnames = []; + if (options.defaults) { + object.stxstattarget = 0; + object.missing_ok = false; + } + if (message.defnames && message.defnames.length) { + object.defnames = []; + for (var j = 0; j < message.defnames.length; ++j) + object.defnames[j] = $root.pg_query.Node.toObject(message.defnames[j], options); + } + if (message.stxstattarget != null && message.hasOwnProperty("stxstattarget")) + object.stxstattarget = message.stxstattarget; + if (message.missing_ok != null && message.hasOwnProperty("missing_ok")) + object.missing_ok = message.missing_ok; + return object; + }; + + /** + * Converts this AlterStatsStmt to JSON. + * @function toJSON + * @memberof pg_query.AlterStatsStmt + * @instance + * @returns {Object.} JSON object + */ + AlterStatsStmt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AlterStatsStmt + * @function getTypeUrl + * @memberof pg_query.AlterStatsStmt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AlterStatsStmt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AlterStatsStmt"; + }; + + return AlterStatsStmt; + })(); + + pg_query.A_Expr = (function() { + + /** + * Properties of a A_Expr. + * @memberof pg_query + * @interface IA_Expr + * @property {pg_query.A_Expr_Kind|null} [kind] A_Expr kind + * @property {Array.|null} [name] A_Expr name + * @property {pg_query.INode|null} [lexpr] A_Expr lexpr + * @property {pg_query.INode|null} [rexpr] A_Expr rexpr + * @property {number|null} [location] A_Expr location + */ + + /** + * Constructs a new A_Expr. + * @memberof pg_query + * @classdesc Represents a A_Expr. + * @implements IA_Expr + * @constructor + * @param {pg_query.IA_Expr=} [properties] Properties to set + */ + function A_Expr(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * A_Expr kind. + * @member {pg_query.A_Expr_Kind} kind + * @memberof pg_query.A_Expr + * @instance + */ + A_Expr.prototype.kind = 0; + + /** + * A_Expr name. + * @member {Array.} name + * @memberof pg_query.A_Expr + * @instance + */ + A_Expr.prototype.name = $util.emptyArray; + + /** + * A_Expr lexpr. + * @member {pg_query.INode|null|undefined} lexpr + * @memberof pg_query.A_Expr + * @instance + */ + A_Expr.prototype.lexpr = null; + + /** + * A_Expr rexpr. + * @member {pg_query.INode|null|undefined} rexpr + * @memberof pg_query.A_Expr + * @instance + */ + A_Expr.prototype.rexpr = null; + + /** + * A_Expr location. + * @member {number} location + * @memberof pg_query.A_Expr + * @instance + */ + A_Expr.prototype.location = 0; + + /** + * Creates a new A_Expr instance using the specified properties. + * @function create + * @memberof pg_query.A_Expr + * @static + * @param {pg_query.IA_Expr=} [properties] Properties to set + * @returns {pg_query.A_Expr} A_Expr instance + */ + A_Expr.create = function create(properties) { + return new A_Expr(properties); + }; + + /** + * Encodes the specified A_Expr message. Does not implicitly {@link pg_query.A_Expr.verify|verify} messages. + * @function encode + * @memberof pg_query.A_Expr + * @static + * @param {pg_query.IA_Expr} message A_Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + A_Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.pg_query.Node.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lexpr != null && Object.hasOwnProperty.call(message, "lexpr")) + $root.pg_query.Node.encode(message.lexpr, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rexpr != null && Object.hasOwnProperty.call(message, "rexpr")) + $root.pg_query.Node.encode(message.rexpr, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified A_Expr message, length delimited. Does not implicitly {@link pg_query.A_Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.A_Expr + * @static + * @param {pg_query.IA_Expr} message A_Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + A_Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a A_Expr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.A_Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.A_Expr} A_Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + A_Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.A_Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.lexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.rexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a A_Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.A_Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.A_Expr} A_Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + A_Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a A_Expr message. + * @function verify + * @memberof pg_query.A_Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + A_Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + break; + } + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.pg_query.Node.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.lexpr != null && message.hasOwnProperty("lexpr")) { + var error = $root.pg_query.Node.verify(message.lexpr); + if (error) + return "lexpr." + error; + } + if (message.rexpr != null && message.hasOwnProperty("rexpr")) { + var error = $root.pg_query.Node.verify(message.rexpr); + if (error) + return "rexpr." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a A_Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.A_Expr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.A_Expr} A_Expr + */ + A_Expr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.A_Expr) + return object; + var message = new $root.pg_query.A_Expr(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "A_EXPR_KIND_UNDEFINED": + case 0: + message.kind = 0; + break; + case "AEXPR_OP": + case 1: + message.kind = 1; + break; + case "AEXPR_OP_ANY": + case 2: + message.kind = 2; + break; + case "AEXPR_OP_ALL": + case 3: + message.kind = 3; + break; + case "AEXPR_DISTINCT": + case 4: + message.kind = 4; + break; + case "AEXPR_NOT_DISTINCT": + case 5: + message.kind = 5; + break; + case "AEXPR_NULLIF": + case 6: + message.kind = 6; + break; + case "AEXPR_OF": + case 7: + message.kind = 7; + break; + case "AEXPR_IN": + case 8: + message.kind = 8; + break; + case "AEXPR_LIKE": + case 9: + message.kind = 9; + break; + case "AEXPR_ILIKE": + case 10: + message.kind = 10; + break; + case "AEXPR_SIMILAR": + case 11: + message.kind = 11; + break; + case "AEXPR_BETWEEN": + case 12: + message.kind = 12; + break; + case "AEXPR_NOT_BETWEEN": + case 13: + message.kind = 13; + break; + case "AEXPR_BETWEEN_SYM": + case 14: + message.kind = 14; + break; + case "AEXPR_NOT_BETWEEN_SYM": + case 15: + message.kind = 15; + break; + case "AEXPR_PAREN": + case 16: + message.kind = 16; + break; + } + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".pg_query.A_Expr.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".pg_query.A_Expr.name: object expected"); + message.name[i] = $root.pg_query.Node.fromObject(object.name[i]); + } + } + if (object.lexpr != null) { + if (typeof object.lexpr !== "object") + throw TypeError(".pg_query.A_Expr.lexpr: object expected"); + message.lexpr = $root.pg_query.Node.fromObject(object.lexpr); + } + if (object.rexpr != null) { + if (typeof object.rexpr !== "object") + throw TypeError(".pg_query.A_Expr.rexpr: object expected"); + message.rexpr = $root.pg_query.Node.fromObject(object.rexpr); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a A_Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.A_Expr + * @static + * @param {pg_query.A_Expr} message A_Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + A_Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.kind = options.enums === String ? "A_EXPR_KIND_UNDEFINED" : 0; + object.lexpr = null; + object.rexpr = null; + object.location = 0; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.pg_query.A_Expr_Kind[message.kind] === undefined ? message.kind : $root.pg_query.A_Expr_Kind[message.kind] : message.kind; + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.pg_query.Node.toObject(message.name[j], options); + } + if (message.lexpr != null && message.hasOwnProperty("lexpr")) + object.lexpr = $root.pg_query.Node.toObject(message.lexpr, options); + if (message.rexpr != null && message.hasOwnProperty("rexpr")) + object.rexpr = $root.pg_query.Node.toObject(message.rexpr, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this A_Expr to JSON. + * @function toJSON + * @memberof pg_query.A_Expr + * @instance + * @returns {Object.} JSON object + */ + A_Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for A_Expr + * @function getTypeUrl + * @memberof pg_query.A_Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + A_Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.A_Expr"; + }; + + return A_Expr; + })(); + + pg_query.ColumnRef = (function() { + + /** + * Properties of a ColumnRef. + * @memberof pg_query + * @interface IColumnRef + * @property {Array.|null} [fields] ColumnRef fields + * @property {number|null} [location] ColumnRef location + */ + + /** + * Constructs a new ColumnRef. + * @memberof pg_query + * @classdesc Represents a ColumnRef. + * @implements IColumnRef + * @constructor + * @param {pg_query.IColumnRef=} [properties] Properties to set + */ + function ColumnRef(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnRef fields. + * @member {Array.} fields + * @memberof pg_query.ColumnRef + * @instance + */ + ColumnRef.prototype.fields = $util.emptyArray; + + /** + * ColumnRef location. + * @member {number} location + * @memberof pg_query.ColumnRef + * @instance + */ + ColumnRef.prototype.location = 0; + + /** + * Creates a new ColumnRef instance using the specified properties. + * @function create + * @memberof pg_query.ColumnRef + * @static + * @param {pg_query.IColumnRef=} [properties] Properties to set + * @returns {pg_query.ColumnRef} ColumnRef instance + */ + ColumnRef.create = function create(properties) { + return new ColumnRef(properties); + }; + + /** + * Encodes the specified ColumnRef message. Does not implicitly {@link pg_query.ColumnRef.verify|verify} messages. + * @function encode + * @memberof pg_query.ColumnRef + * @static + * @param {pg_query.IColumnRef} message ColumnRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnRef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.pg_query.Node.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.location); + return writer; + }; + + /** + * Encodes the specified ColumnRef message, length delimited. Does not implicitly {@link pg_query.ColumnRef.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ColumnRef + * @static + * @param {pg_query.IColumnRef} message ColumnRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnRef message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ColumnRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ColumnRef} ColumnRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnRef.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ColumnRef(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ColumnRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ColumnRef} ColumnRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnRef message. + * @function verify + * @memberof pg_query.ColumnRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.pg_query.Node.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a ColumnRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ColumnRef + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ColumnRef} ColumnRef + */ + ColumnRef.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ColumnRef) + return object; + var message = new $root.pg_query.ColumnRef(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".pg_query.ColumnRef.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".pg_query.ColumnRef.fields: object expected"); + message.fields[i] = $root.pg_query.Node.fromObject(object.fields[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a ColumnRef message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ColumnRef + * @static + * @param {pg_query.ColumnRef} message ColumnRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnRef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) + object.location = 0; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.pg_query.Node.toObject(message.fields[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this ColumnRef to JSON. + * @function toJSON + * @memberof pg_query.ColumnRef + * @instance + * @returns {Object.} JSON object + */ + ColumnRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnRef + * @function getTypeUrl + * @memberof pg_query.ColumnRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ColumnRef"; + }; + + return ColumnRef; + })(); + + pg_query.ParamRef = (function() { + + /** + * Properties of a ParamRef. + * @memberof pg_query + * @interface IParamRef + * @property {number|null} [number] ParamRef number + * @property {number|null} [location] ParamRef location + */ + + /** + * Constructs a new ParamRef. + * @memberof pg_query + * @classdesc Represents a ParamRef. + * @implements IParamRef + * @constructor + * @param {pg_query.IParamRef=} [properties] Properties to set + */ + function ParamRef(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParamRef number. + * @member {number} number + * @memberof pg_query.ParamRef + * @instance + */ + ParamRef.prototype.number = 0; + + /** + * ParamRef location. + * @member {number} location + * @memberof pg_query.ParamRef + * @instance + */ + ParamRef.prototype.location = 0; + + /** + * Creates a new ParamRef instance using the specified properties. + * @function create + * @memberof pg_query.ParamRef + * @static + * @param {pg_query.IParamRef=} [properties] Properties to set + * @returns {pg_query.ParamRef} ParamRef instance + */ + ParamRef.create = function create(properties) { + return new ParamRef(properties); + }; + + /** + * Encodes the specified ParamRef message. Does not implicitly {@link pg_query.ParamRef.verify|verify} messages. + * @function encode + * @memberof pg_query.ParamRef + * @static + * @param {pg_query.IParamRef} message ParamRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParamRef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.location); + return writer; + }; + + /** + * Encodes the specified ParamRef message, length delimited. Does not implicitly {@link pg_query.ParamRef.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ParamRef + * @static + * @param {pg_query.IParamRef} message ParamRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParamRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParamRef message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ParamRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ParamRef} ParamRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParamRef.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ParamRef(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ParamRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ParamRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ParamRef} ParamRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParamRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParamRef message. + * @function verify + * @memberof pg_query.ParamRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParamRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a ParamRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ParamRef + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ParamRef} ParamRef + */ + ParamRef.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ParamRef) + return object; + var message = new $root.pg_query.ParamRef(); + if (object.number != null) + message.number = object.number | 0; + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a ParamRef message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ParamRef + * @static + * @param {pg_query.ParamRef} message ParamRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParamRef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.location = 0; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this ParamRef to JSON. + * @function toJSON + * @memberof pg_query.ParamRef + * @instance + * @returns {Object.} JSON object + */ + ParamRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ParamRef + * @function getTypeUrl + * @memberof pg_query.ParamRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ParamRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ParamRef"; + }; + + return ParamRef; + })(); + + pg_query.A_Const = (function() { + + /** + * Properties of a A_Const. + * @memberof pg_query + * @interface IA_Const + * @property {pg_query.INode|null} [val] A_Const val + * @property {number|null} [location] A_Const location + */ + + /** + * Constructs a new A_Const. + * @memberof pg_query + * @classdesc Represents a A_Const. + * @implements IA_Const + * @constructor + * @param {pg_query.IA_Const=} [properties] Properties to set + */ + function A_Const(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * A_Const val. + * @member {pg_query.INode|null|undefined} val + * @memberof pg_query.A_Const + * @instance + */ + A_Const.prototype.val = null; + + /** + * A_Const location. + * @member {number} location + * @memberof pg_query.A_Const + * @instance + */ + A_Const.prototype.location = 0; + + /** + * Creates a new A_Const instance using the specified properties. + * @function create + * @memberof pg_query.A_Const + * @static + * @param {pg_query.IA_Const=} [properties] Properties to set + * @returns {pg_query.A_Const} A_Const instance + */ + A_Const.create = function create(properties) { + return new A_Const(properties); + }; + + /** + * Encodes the specified A_Const message. Does not implicitly {@link pg_query.A_Const.verify|verify} messages. + * @function encode + * @memberof pg_query.A_Const + * @static + * @param {pg_query.IA_Const} message A_Const message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + A_Const.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.val != null && Object.hasOwnProperty.call(message, "val")) + $root.pg_query.Node.encode(message.val, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.location); + return writer; + }; + + /** + * Encodes the specified A_Const message, length delimited. Does not implicitly {@link pg_query.A_Const.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.A_Const + * @static + * @param {pg_query.IA_Const} message A_Const message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + A_Const.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a A_Const message from the specified reader or buffer. + * @function decode + * @memberof pg_query.A_Const + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.A_Const} A_Const + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + A_Const.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.A_Const(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.val = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a A_Const message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.A_Const + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.A_Const} A_Const + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + A_Const.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a A_Const message. + * @function verify + * @memberof pg_query.A_Const + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + A_Const.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.val != null && message.hasOwnProperty("val")) { + var error = $root.pg_query.Node.verify(message.val); + if (error) + return "val." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a A_Const message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.A_Const + * @static + * @param {Object.} object Plain object + * @returns {pg_query.A_Const} A_Const + */ + A_Const.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.A_Const) + return object; + var message = new $root.pg_query.A_Const(); + if (object.val != null) { + if (typeof object.val !== "object") + throw TypeError(".pg_query.A_Const.val: object expected"); + message.val = $root.pg_query.Node.fromObject(object.val); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a A_Const message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.A_Const + * @static + * @param {pg_query.A_Const} message A_Const + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + A_Const.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.val = null; + object.location = 0; + } + if (message.val != null && message.hasOwnProperty("val")) + object.val = $root.pg_query.Node.toObject(message.val, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this A_Const to JSON. + * @function toJSON + * @memberof pg_query.A_Const + * @instance + * @returns {Object.} JSON object + */ + A_Const.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for A_Const + * @function getTypeUrl + * @memberof pg_query.A_Const + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + A_Const.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.A_Const"; + }; + + return A_Const; + })(); + + pg_query.FuncCall = (function() { + + /** + * Properties of a FuncCall. + * @memberof pg_query + * @interface IFuncCall + * @property {Array.|null} [funcname] FuncCall funcname + * @property {Array.|null} [args] FuncCall args + * @property {Array.|null} [agg_order] FuncCall agg_order + * @property {pg_query.INode|null} [agg_filter] FuncCall agg_filter + * @property {boolean|null} [agg_within_group] FuncCall agg_within_group + * @property {boolean|null} [agg_star] FuncCall agg_star + * @property {boolean|null} [agg_distinct] FuncCall agg_distinct + * @property {boolean|null} [func_variadic] FuncCall func_variadic + * @property {pg_query.IWindowDef|null} [over] FuncCall over + * @property {number|null} [location] FuncCall location + */ + + /** + * Constructs a new FuncCall. + * @memberof pg_query + * @classdesc Represents a FuncCall. + * @implements IFuncCall + * @constructor + * @param {pg_query.IFuncCall=} [properties] Properties to set + */ + function FuncCall(properties) { + this.funcname = []; + this.args = []; + this.agg_order = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FuncCall funcname. + * @member {Array.} funcname + * @memberof pg_query.FuncCall + * @instance + */ + FuncCall.prototype.funcname = $util.emptyArray; + + /** + * FuncCall args. + * @member {Array.} args + * @memberof pg_query.FuncCall + * @instance + */ + FuncCall.prototype.args = $util.emptyArray; + + /** + * FuncCall agg_order. + * @member {Array.} agg_order + * @memberof pg_query.FuncCall + * @instance + */ + FuncCall.prototype.agg_order = $util.emptyArray; + + /** + * FuncCall agg_filter. + * @member {pg_query.INode|null|undefined} agg_filter + * @memberof pg_query.FuncCall + * @instance + */ + FuncCall.prototype.agg_filter = null; + + /** + * FuncCall agg_within_group. + * @member {boolean} agg_within_group + * @memberof pg_query.FuncCall + * @instance + */ + FuncCall.prototype.agg_within_group = false; + + /** + * FuncCall agg_star. + * @member {boolean} agg_star + * @memberof pg_query.FuncCall + * @instance + */ + FuncCall.prototype.agg_star = false; + + /** + * FuncCall agg_distinct. + * @member {boolean} agg_distinct + * @memberof pg_query.FuncCall + * @instance + */ + FuncCall.prototype.agg_distinct = false; + + /** + * FuncCall func_variadic. + * @member {boolean} func_variadic + * @memberof pg_query.FuncCall + * @instance + */ + FuncCall.prototype.func_variadic = false; + + /** + * FuncCall over. + * @member {pg_query.IWindowDef|null|undefined} over + * @memberof pg_query.FuncCall + * @instance + */ + FuncCall.prototype.over = null; + + /** + * FuncCall location. + * @member {number} location + * @memberof pg_query.FuncCall + * @instance + */ + FuncCall.prototype.location = 0; + + /** + * Creates a new FuncCall instance using the specified properties. + * @function create + * @memberof pg_query.FuncCall + * @static + * @param {pg_query.IFuncCall=} [properties] Properties to set + * @returns {pg_query.FuncCall} FuncCall instance + */ + FuncCall.create = function create(properties) { + return new FuncCall(properties); + }; + + /** + * Encodes the specified FuncCall message. Does not implicitly {@link pg_query.FuncCall.verify|verify} messages. + * @function encode + * @memberof pg_query.FuncCall + * @static + * @param {pg_query.IFuncCall} message FuncCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FuncCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.funcname != null && message.funcname.length) + for (var i = 0; i < message.funcname.length; ++i) + $root.pg_query.Node.encode(message.funcname[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.agg_order != null && message.agg_order.length) + for (var i = 0; i < message.agg_order.length; ++i) + $root.pg_query.Node.encode(message.agg_order[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.agg_filter != null && Object.hasOwnProperty.call(message, "agg_filter")) + $root.pg_query.Node.encode(message.agg_filter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.agg_within_group != null && Object.hasOwnProperty.call(message, "agg_within_group")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.agg_within_group); + if (message.agg_star != null && Object.hasOwnProperty.call(message, "agg_star")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.agg_star); + if (message.agg_distinct != null && Object.hasOwnProperty.call(message, "agg_distinct")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.agg_distinct); + if (message.func_variadic != null && Object.hasOwnProperty.call(message, "func_variadic")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.func_variadic); + if (message.over != null && Object.hasOwnProperty.call(message, "over")) + $root.pg_query.WindowDef.encode(message.over, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.location); + return writer; + }; + + /** + * Encodes the specified FuncCall message, length delimited. Does not implicitly {@link pg_query.FuncCall.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.FuncCall + * @static + * @param {pg_query.IFuncCall} message FuncCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FuncCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FuncCall message from the specified reader or buffer. + * @function decode + * @memberof pg_query.FuncCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.FuncCall} FuncCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FuncCall.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.FuncCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.funcname && message.funcname.length)) + message.funcname = []; + message.funcname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.agg_order && message.agg_order.length)) + message.agg_order = []; + message.agg_order.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.agg_filter = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + message.agg_within_group = reader.bool(); + break; + } + case 6: { + message.agg_star = reader.bool(); + break; + } + case 7: { + message.agg_distinct = reader.bool(); + break; + } + case 8: { + message.func_variadic = reader.bool(); + break; + } + case 9: { + message.over = $root.pg_query.WindowDef.decode(reader, reader.uint32()); + break; + } + case 10: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FuncCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.FuncCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.FuncCall} FuncCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FuncCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FuncCall message. + * @function verify + * @memberof pg_query.FuncCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FuncCall.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.funcname != null && message.hasOwnProperty("funcname")) { + if (!Array.isArray(message.funcname)) + return "funcname: array expected"; + for (var i = 0; i < message.funcname.length; ++i) { + var error = $root.pg_query.Node.verify(message.funcname[i]); + if (error) + return "funcname." + error; + } + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.agg_order != null && message.hasOwnProperty("agg_order")) { + if (!Array.isArray(message.agg_order)) + return "agg_order: array expected"; + for (var i = 0; i < message.agg_order.length; ++i) { + var error = $root.pg_query.Node.verify(message.agg_order[i]); + if (error) + return "agg_order." + error; + } + } + if (message.agg_filter != null && message.hasOwnProperty("agg_filter")) { + var error = $root.pg_query.Node.verify(message.agg_filter); + if (error) + return "agg_filter." + error; + } + if (message.agg_within_group != null && message.hasOwnProperty("agg_within_group")) + if (typeof message.agg_within_group !== "boolean") + return "agg_within_group: boolean expected"; + if (message.agg_star != null && message.hasOwnProperty("agg_star")) + if (typeof message.agg_star !== "boolean") + return "agg_star: boolean expected"; + if (message.agg_distinct != null && message.hasOwnProperty("agg_distinct")) + if (typeof message.agg_distinct !== "boolean") + return "agg_distinct: boolean expected"; + if (message.func_variadic != null && message.hasOwnProperty("func_variadic")) + if (typeof message.func_variadic !== "boolean") + return "func_variadic: boolean expected"; + if (message.over != null && message.hasOwnProperty("over")) { + var error = $root.pg_query.WindowDef.verify(message.over); + if (error) + return "over." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a FuncCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.FuncCall + * @static + * @param {Object.} object Plain object + * @returns {pg_query.FuncCall} FuncCall + */ + FuncCall.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.FuncCall) + return object; + var message = new $root.pg_query.FuncCall(); + if (object.funcname) { + if (!Array.isArray(object.funcname)) + throw TypeError(".pg_query.FuncCall.funcname: array expected"); + message.funcname = []; + for (var i = 0; i < object.funcname.length; ++i) { + if (typeof object.funcname[i] !== "object") + throw TypeError(".pg_query.FuncCall.funcname: object expected"); + message.funcname[i] = $root.pg_query.Node.fromObject(object.funcname[i]); + } + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.FuncCall.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.FuncCall.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.agg_order) { + if (!Array.isArray(object.agg_order)) + throw TypeError(".pg_query.FuncCall.agg_order: array expected"); + message.agg_order = []; + for (var i = 0; i < object.agg_order.length; ++i) { + if (typeof object.agg_order[i] !== "object") + throw TypeError(".pg_query.FuncCall.agg_order: object expected"); + message.agg_order[i] = $root.pg_query.Node.fromObject(object.agg_order[i]); + } + } + if (object.agg_filter != null) { + if (typeof object.agg_filter !== "object") + throw TypeError(".pg_query.FuncCall.agg_filter: object expected"); + message.agg_filter = $root.pg_query.Node.fromObject(object.agg_filter); + } + if (object.agg_within_group != null) + message.agg_within_group = Boolean(object.agg_within_group); + if (object.agg_star != null) + message.agg_star = Boolean(object.agg_star); + if (object.agg_distinct != null) + message.agg_distinct = Boolean(object.agg_distinct); + if (object.func_variadic != null) + message.func_variadic = Boolean(object.func_variadic); + if (object.over != null) { + if (typeof object.over !== "object") + throw TypeError(".pg_query.FuncCall.over: object expected"); + message.over = $root.pg_query.WindowDef.fromObject(object.over); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a FuncCall message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.FuncCall + * @static + * @param {pg_query.FuncCall} message FuncCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FuncCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.funcname = []; + object.args = []; + object.agg_order = []; + } + if (options.defaults) { + object.agg_filter = null; + object.agg_within_group = false; + object.agg_star = false; + object.agg_distinct = false; + object.func_variadic = false; + object.over = null; + object.location = 0; + } + if (message.funcname && message.funcname.length) { + object.funcname = []; + for (var j = 0; j < message.funcname.length; ++j) + object.funcname[j] = $root.pg_query.Node.toObject(message.funcname[j], options); + } + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.agg_order && message.agg_order.length) { + object.agg_order = []; + for (var j = 0; j < message.agg_order.length; ++j) + object.agg_order[j] = $root.pg_query.Node.toObject(message.agg_order[j], options); + } + if (message.agg_filter != null && message.hasOwnProperty("agg_filter")) + object.agg_filter = $root.pg_query.Node.toObject(message.agg_filter, options); + if (message.agg_within_group != null && message.hasOwnProperty("agg_within_group")) + object.agg_within_group = message.agg_within_group; + if (message.agg_star != null && message.hasOwnProperty("agg_star")) + object.agg_star = message.agg_star; + if (message.agg_distinct != null && message.hasOwnProperty("agg_distinct")) + object.agg_distinct = message.agg_distinct; + if (message.func_variadic != null && message.hasOwnProperty("func_variadic")) + object.func_variadic = message.func_variadic; + if (message.over != null && message.hasOwnProperty("over")) + object.over = $root.pg_query.WindowDef.toObject(message.over, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this FuncCall to JSON. + * @function toJSON + * @memberof pg_query.FuncCall + * @instance + * @returns {Object.} JSON object + */ + FuncCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FuncCall + * @function getTypeUrl + * @memberof pg_query.FuncCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FuncCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.FuncCall"; + }; + + return FuncCall; + })(); + + pg_query.A_Star = (function() { + + /** + * Properties of a A_Star. + * @memberof pg_query + * @interface IA_Star + */ + + /** + * Constructs a new A_Star. + * @memberof pg_query + * @classdesc Represents a A_Star. + * @implements IA_Star + * @constructor + * @param {pg_query.IA_Star=} [properties] Properties to set + */ + function A_Star(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new A_Star instance using the specified properties. + * @function create + * @memberof pg_query.A_Star + * @static + * @param {pg_query.IA_Star=} [properties] Properties to set + * @returns {pg_query.A_Star} A_Star instance + */ + A_Star.create = function create(properties) { + return new A_Star(properties); + }; + + /** + * Encodes the specified A_Star message. Does not implicitly {@link pg_query.A_Star.verify|verify} messages. + * @function encode + * @memberof pg_query.A_Star + * @static + * @param {pg_query.IA_Star} message A_Star message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + A_Star.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified A_Star message, length delimited. Does not implicitly {@link pg_query.A_Star.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.A_Star + * @static + * @param {pg_query.IA_Star} message A_Star message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + A_Star.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a A_Star message from the specified reader or buffer. + * @function decode + * @memberof pg_query.A_Star + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.A_Star} A_Star + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + A_Star.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.A_Star(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a A_Star message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.A_Star + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.A_Star} A_Star + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + A_Star.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a A_Star message. + * @function verify + * @memberof pg_query.A_Star + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + A_Star.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a A_Star message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.A_Star + * @static + * @param {Object.} object Plain object + * @returns {pg_query.A_Star} A_Star + */ + A_Star.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.A_Star) + return object; + return new $root.pg_query.A_Star(); + }; + + /** + * Creates a plain object from a A_Star message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.A_Star + * @static + * @param {pg_query.A_Star} message A_Star + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + A_Star.toObject = function toObject() { + return {}; + }; + + /** + * Converts this A_Star to JSON. + * @function toJSON + * @memberof pg_query.A_Star + * @instance + * @returns {Object.} JSON object + */ + A_Star.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for A_Star + * @function getTypeUrl + * @memberof pg_query.A_Star + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + A_Star.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.A_Star"; + }; + + return A_Star; + })(); + + pg_query.A_Indices = (function() { + + /** + * Properties of a A_Indices. + * @memberof pg_query + * @interface IA_Indices + * @property {boolean|null} [is_slice] A_Indices is_slice + * @property {pg_query.INode|null} [lidx] A_Indices lidx + * @property {pg_query.INode|null} [uidx] A_Indices uidx + */ + + /** + * Constructs a new A_Indices. + * @memberof pg_query + * @classdesc Represents a A_Indices. + * @implements IA_Indices + * @constructor + * @param {pg_query.IA_Indices=} [properties] Properties to set + */ + function A_Indices(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * A_Indices is_slice. + * @member {boolean} is_slice + * @memberof pg_query.A_Indices + * @instance + */ + A_Indices.prototype.is_slice = false; + + /** + * A_Indices lidx. + * @member {pg_query.INode|null|undefined} lidx + * @memberof pg_query.A_Indices + * @instance + */ + A_Indices.prototype.lidx = null; + + /** + * A_Indices uidx. + * @member {pg_query.INode|null|undefined} uidx + * @memberof pg_query.A_Indices + * @instance + */ + A_Indices.prototype.uidx = null; + + /** + * Creates a new A_Indices instance using the specified properties. + * @function create + * @memberof pg_query.A_Indices + * @static + * @param {pg_query.IA_Indices=} [properties] Properties to set + * @returns {pg_query.A_Indices} A_Indices instance + */ + A_Indices.create = function create(properties) { + return new A_Indices(properties); + }; + + /** + * Encodes the specified A_Indices message. Does not implicitly {@link pg_query.A_Indices.verify|verify} messages. + * @function encode + * @memberof pg_query.A_Indices + * @static + * @param {pg_query.IA_Indices} message A_Indices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + A_Indices.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.is_slice != null && Object.hasOwnProperty.call(message, "is_slice")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.is_slice); + if (message.lidx != null && Object.hasOwnProperty.call(message, "lidx")) + $root.pg_query.Node.encode(message.lidx, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.uidx != null && Object.hasOwnProperty.call(message, "uidx")) + $root.pg_query.Node.encode(message.uidx, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified A_Indices message, length delimited. Does not implicitly {@link pg_query.A_Indices.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.A_Indices + * @static + * @param {pg_query.IA_Indices} message A_Indices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + A_Indices.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a A_Indices message from the specified reader or buffer. + * @function decode + * @memberof pg_query.A_Indices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.A_Indices} A_Indices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + A_Indices.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.A_Indices(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.is_slice = reader.bool(); + break; + } + case 2: { + message.lidx = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.uidx = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a A_Indices message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.A_Indices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.A_Indices} A_Indices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + A_Indices.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a A_Indices message. + * @function verify + * @memberof pg_query.A_Indices + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + A_Indices.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.is_slice != null && message.hasOwnProperty("is_slice")) + if (typeof message.is_slice !== "boolean") + return "is_slice: boolean expected"; + if (message.lidx != null && message.hasOwnProperty("lidx")) { + var error = $root.pg_query.Node.verify(message.lidx); + if (error) + return "lidx." + error; + } + if (message.uidx != null && message.hasOwnProperty("uidx")) { + var error = $root.pg_query.Node.verify(message.uidx); + if (error) + return "uidx." + error; + } + return null; + }; + + /** + * Creates a A_Indices message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.A_Indices + * @static + * @param {Object.} object Plain object + * @returns {pg_query.A_Indices} A_Indices + */ + A_Indices.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.A_Indices) + return object; + var message = new $root.pg_query.A_Indices(); + if (object.is_slice != null) + message.is_slice = Boolean(object.is_slice); + if (object.lidx != null) { + if (typeof object.lidx !== "object") + throw TypeError(".pg_query.A_Indices.lidx: object expected"); + message.lidx = $root.pg_query.Node.fromObject(object.lidx); + } + if (object.uidx != null) { + if (typeof object.uidx !== "object") + throw TypeError(".pg_query.A_Indices.uidx: object expected"); + message.uidx = $root.pg_query.Node.fromObject(object.uidx); + } + return message; + }; + + /** + * Creates a plain object from a A_Indices message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.A_Indices + * @static + * @param {pg_query.A_Indices} message A_Indices + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + A_Indices.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.is_slice = false; + object.lidx = null; + object.uidx = null; + } + if (message.is_slice != null && message.hasOwnProperty("is_slice")) + object.is_slice = message.is_slice; + if (message.lidx != null && message.hasOwnProperty("lidx")) + object.lidx = $root.pg_query.Node.toObject(message.lidx, options); + if (message.uidx != null && message.hasOwnProperty("uidx")) + object.uidx = $root.pg_query.Node.toObject(message.uidx, options); + return object; + }; + + /** + * Converts this A_Indices to JSON. + * @function toJSON + * @memberof pg_query.A_Indices + * @instance + * @returns {Object.} JSON object + */ + A_Indices.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for A_Indices + * @function getTypeUrl + * @memberof pg_query.A_Indices + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + A_Indices.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.A_Indices"; + }; + + return A_Indices; + })(); + + pg_query.A_Indirection = (function() { + + /** + * Properties of a A_Indirection. + * @memberof pg_query + * @interface IA_Indirection + * @property {pg_query.INode|null} [arg] A_Indirection arg + * @property {Array.|null} [indirection] A_Indirection indirection + */ + + /** + * Constructs a new A_Indirection. + * @memberof pg_query + * @classdesc Represents a A_Indirection. + * @implements IA_Indirection + * @constructor + * @param {pg_query.IA_Indirection=} [properties] Properties to set + */ + function A_Indirection(properties) { + this.indirection = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * A_Indirection arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.A_Indirection + * @instance + */ + A_Indirection.prototype.arg = null; + + /** + * A_Indirection indirection. + * @member {Array.} indirection + * @memberof pg_query.A_Indirection + * @instance + */ + A_Indirection.prototype.indirection = $util.emptyArray; + + /** + * Creates a new A_Indirection instance using the specified properties. + * @function create + * @memberof pg_query.A_Indirection + * @static + * @param {pg_query.IA_Indirection=} [properties] Properties to set + * @returns {pg_query.A_Indirection} A_Indirection instance + */ + A_Indirection.create = function create(properties) { + return new A_Indirection(properties); + }; + + /** + * Encodes the specified A_Indirection message. Does not implicitly {@link pg_query.A_Indirection.verify|verify} messages. + * @function encode + * @memberof pg_query.A_Indirection + * @static + * @param {pg_query.IA_Indirection} message A_Indirection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + A_Indirection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.indirection != null && message.indirection.length) + for (var i = 0; i < message.indirection.length; ++i) + $root.pg_query.Node.encode(message.indirection[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified A_Indirection message, length delimited. Does not implicitly {@link pg_query.A_Indirection.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.A_Indirection + * @static + * @param {pg_query.IA_Indirection} message A_Indirection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + A_Indirection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a A_Indirection message from the specified reader or buffer. + * @function decode + * @memberof pg_query.A_Indirection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.A_Indirection} A_Indirection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + A_Indirection.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.A_Indirection(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.indirection && message.indirection.length)) + message.indirection = []; + message.indirection.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a A_Indirection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.A_Indirection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.A_Indirection} A_Indirection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + A_Indirection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a A_Indirection message. + * @function verify + * @memberof pg_query.A_Indirection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + A_Indirection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.indirection != null && message.hasOwnProperty("indirection")) { + if (!Array.isArray(message.indirection)) + return "indirection: array expected"; + for (var i = 0; i < message.indirection.length; ++i) { + var error = $root.pg_query.Node.verify(message.indirection[i]); + if (error) + return "indirection." + error; + } + } + return null; + }; + + /** + * Creates a A_Indirection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.A_Indirection + * @static + * @param {Object.} object Plain object + * @returns {pg_query.A_Indirection} A_Indirection + */ + A_Indirection.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.A_Indirection) + return object; + var message = new $root.pg_query.A_Indirection(); + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.A_Indirection.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.indirection) { + if (!Array.isArray(object.indirection)) + throw TypeError(".pg_query.A_Indirection.indirection: array expected"); + message.indirection = []; + for (var i = 0; i < object.indirection.length; ++i) { + if (typeof object.indirection[i] !== "object") + throw TypeError(".pg_query.A_Indirection.indirection: object expected"); + message.indirection[i] = $root.pg_query.Node.fromObject(object.indirection[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a A_Indirection message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.A_Indirection + * @static + * @param {pg_query.A_Indirection} message A_Indirection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + A_Indirection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indirection = []; + if (options.defaults) + object.arg = null; + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.indirection && message.indirection.length) { + object.indirection = []; + for (var j = 0; j < message.indirection.length; ++j) + object.indirection[j] = $root.pg_query.Node.toObject(message.indirection[j], options); + } + return object; + }; + + /** + * Converts this A_Indirection to JSON. + * @function toJSON + * @memberof pg_query.A_Indirection + * @instance + * @returns {Object.} JSON object + */ + A_Indirection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for A_Indirection + * @function getTypeUrl + * @memberof pg_query.A_Indirection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + A_Indirection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.A_Indirection"; + }; + + return A_Indirection; + })(); + + pg_query.A_ArrayExpr = (function() { + + /** + * Properties of a A_ArrayExpr. + * @memberof pg_query + * @interface IA_ArrayExpr + * @property {Array.|null} [elements] A_ArrayExpr elements + * @property {number|null} [location] A_ArrayExpr location + */ + + /** + * Constructs a new A_ArrayExpr. + * @memberof pg_query + * @classdesc Represents a A_ArrayExpr. + * @implements IA_ArrayExpr + * @constructor + * @param {pg_query.IA_ArrayExpr=} [properties] Properties to set + */ + function A_ArrayExpr(properties) { + this.elements = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * A_ArrayExpr elements. + * @member {Array.} elements + * @memberof pg_query.A_ArrayExpr + * @instance + */ + A_ArrayExpr.prototype.elements = $util.emptyArray; + + /** + * A_ArrayExpr location. + * @member {number} location + * @memberof pg_query.A_ArrayExpr + * @instance + */ + A_ArrayExpr.prototype.location = 0; + + /** + * Creates a new A_ArrayExpr instance using the specified properties. + * @function create + * @memberof pg_query.A_ArrayExpr + * @static + * @param {pg_query.IA_ArrayExpr=} [properties] Properties to set + * @returns {pg_query.A_ArrayExpr} A_ArrayExpr instance + */ + A_ArrayExpr.create = function create(properties) { + return new A_ArrayExpr(properties); + }; + + /** + * Encodes the specified A_ArrayExpr message. Does not implicitly {@link pg_query.A_ArrayExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.A_ArrayExpr + * @static + * @param {pg_query.IA_ArrayExpr} message A_ArrayExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + A_ArrayExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.elements != null && message.elements.length) + for (var i = 0; i < message.elements.length; ++i) + $root.pg_query.Node.encode(message.elements[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.location); + return writer; + }; + + /** + * Encodes the specified A_ArrayExpr message, length delimited. Does not implicitly {@link pg_query.A_ArrayExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.A_ArrayExpr + * @static + * @param {pg_query.IA_ArrayExpr} message A_ArrayExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + A_ArrayExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a A_ArrayExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.A_ArrayExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.A_ArrayExpr} A_ArrayExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + A_ArrayExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.A_ArrayExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.elements && message.elements.length)) + message.elements = []; + message.elements.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a A_ArrayExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.A_ArrayExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.A_ArrayExpr} A_ArrayExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + A_ArrayExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a A_ArrayExpr message. + * @function verify + * @memberof pg_query.A_ArrayExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + A_ArrayExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.elements != null && message.hasOwnProperty("elements")) { + if (!Array.isArray(message.elements)) + return "elements: array expected"; + for (var i = 0; i < message.elements.length; ++i) { + var error = $root.pg_query.Node.verify(message.elements[i]); + if (error) + return "elements." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a A_ArrayExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.A_ArrayExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.A_ArrayExpr} A_ArrayExpr + */ + A_ArrayExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.A_ArrayExpr) + return object; + var message = new $root.pg_query.A_ArrayExpr(); + if (object.elements) { + if (!Array.isArray(object.elements)) + throw TypeError(".pg_query.A_ArrayExpr.elements: array expected"); + message.elements = []; + for (var i = 0; i < object.elements.length; ++i) { + if (typeof object.elements[i] !== "object") + throw TypeError(".pg_query.A_ArrayExpr.elements: object expected"); + message.elements[i] = $root.pg_query.Node.fromObject(object.elements[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a A_ArrayExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.A_ArrayExpr + * @static + * @param {pg_query.A_ArrayExpr} message A_ArrayExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + A_ArrayExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.elements = []; + if (options.defaults) + object.location = 0; + if (message.elements && message.elements.length) { + object.elements = []; + for (var j = 0; j < message.elements.length; ++j) + object.elements[j] = $root.pg_query.Node.toObject(message.elements[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this A_ArrayExpr to JSON. + * @function toJSON + * @memberof pg_query.A_ArrayExpr + * @instance + * @returns {Object.} JSON object + */ + A_ArrayExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for A_ArrayExpr + * @function getTypeUrl + * @memberof pg_query.A_ArrayExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + A_ArrayExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.A_ArrayExpr"; + }; + + return A_ArrayExpr; + })(); + + pg_query.ResTarget = (function() { + + /** + * Properties of a ResTarget. + * @memberof pg_query + * @interface IResTarget + * @property {string|null} [name] ResTarget name + * @property {Array.|null} [indirection] ResTarget indirection + * @property {pg_query.INode|null} [val] ResTarget val + * @property {number|null} [location] ResTarget location + */ + + /** + * Constructs a new ResTarget. + * @memberof pg_query + * @classdesc Represents a ResTarget. + * @implements IResTarget + * @constructor + * @param {pg_query.IResTarget=} [properties] Properties to set + */ + function ResTarget(properties) { + this.indirection = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResTarget name. + * @member {string} name + * @memberof pg_query.ResTarget + * @instance + */ + ResTarget.prototype.name = ""; + + /** + * ResTarget indirection. + * @member {Array.} indirection + * @memberof pg_query.ResTarget + * @instance + */ + ResTarget.prototype.indirection = $util.emptyArray; + + /** + * ResTarget val. + * @member {pg_query.INode|null|undefined} val + * @memberof pg_query.ResTarget + * @instance + */ + ResTarget.prototype.val = null; + + /** + * ResTarget location. + * @member {number} location + * @memberof pg_query.ResTarget + * @instance + */ + ResTarget.prototype.location = 0; + + /** + * Creates a new ResTarget instance using the specified properties. + * @function create + * @memberof pg_query.ResTarget + * @static + * @param {pg_query.IResTarget=} [properties] Properties to set + * @returns {pg_query.ResTarget} ResTarget instance + */ + ResTarget.create = function create(properties) { + return new ResTarget(properties); + }; + + /** + * Encodes the specified ResTarget message. Does not implicitly {@link pg_query.ResTarget.verify|verify} messages. + * @function encode + * @memberof pg_query.ResTarget + * @static + * @param {pg_query.IResTarget} message ResTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResTarget.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.indirection != null && message.indirection.length) + for (var i = 0; i < message.indirection.length; ++i) + $root.pg_query.Node.encode(message.indirection[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.val != null && Object.hasOwnProperty.call(message, "val")) + $root.pg_query.Node.encode(message.val, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.location); + return writer; + }; + + /** + * Encodes the specified ResTarget message, length delimited. Does not implicitly {@link pg_query.ResTarget.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ResTarget + * @static + * @param {pg_query.IResTarget} message ResTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResTarget.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResTarget message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ResTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ResTarget} ResTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResTarget.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ResTarget(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.indirection && message.indirection.length)) + message.indirection = []; + message.indirection.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.val = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResTarget message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ResTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ResTarget} ResTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResTarget.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResTarget message. + * @function verify + * @memberof pg_query.ResTarget + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResTarget.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.indirection != null && message.hasOwnProperty("indirection")) { + if (!Array.isArray(message.indirection)) + return "indirection: array expected"; + for (var i = 0; i < message.indirection.length; ++i) { + var error = $root.pg_query.Node.verify(message.indirection[i]); + if (error) + return "indirection." + error; + } + } + if (message.val != null && message.hasOwnProperty("val")) { + var error = $root.pg_query.Node.verify(message.val); + if (error) + return "val." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a ResTarget message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ResTarget + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ResTarget} ResTarget + */ + ResTarget.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ResTarget) + return object; + var message = new $root.pg_query.ResTarget(); + if (object.name != null) + message.name = String(object.name); + if (object.indirection) { + if (!Array.isArray(object.indirection)) + throw TypeError(".pg_query.ResTarget.indirection: array expected"); + message.indirection = []; + for (var i = 0; i < object.indirection.length; ++i) { + if (typeof object.indirection[i] !== "object") + throw TypeError(".pg_query.ResTarget.indirection: object expected"); + message.indirection[i] = $root.pg_query.Node.fromObject(object.indirection[i]); + } + } + if (object.val != null) { + if (typeof object.val !== "object") + throw TypeError(".pg_query.ResTarget.val: object expected"); + message.val = $root.pg_query.Node.fromObject(object.val); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a ResTarget message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ResTarget + * @static + * @param {pg_query.ResTarget} message ResTarget + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResTarget.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indirection = []; + if (options.defaults) { + object.name = ""; + object.val = null; + object.location = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.indirection && message.indirection.length) { + object.indirection = []; + for (var j = 0; j < message.indirection.length; ++j) + object.indirection[j] = $root.pg_query.Node.toObject(message.indirection[j], options); + } + if (message.val != null && message.hasOwnProperty("val")) + object.val = $root.pg_query.Node.toObject(message.val, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this ResTarget to JSON. + * @function toJSON + * @memberof pg_query.ResTarget + * @instance + * @returns {Object.} JSON object + */ + ResTarget.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResTarget + * @function getTypeUrl + * @memberof pg_query.ResTarget + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResTarget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ResTarget"; + }; + + return ResTarget; + })(); + + pg_query.MultiAssignRef = (function() { + + /** + * Properties of a MultiAssignRef. + * @memberof pg_query + * @interface IMultiAssignRef + * @property {pg_query.INode|null} [source] MultiAssignRef source + * @property {number|null} [colno] MultiAssignRef colno + * @property {number|null} [ncolumns] MultiAssignRef ncolumns + */ + + /** + * Constructs a new MultiAssignRef. + * @memberof pg_query + * @classdesc Represents a MultiAssignRef. + * @implements IMultiAssignRef + * @constructor + * @param {pg_query.IMultiAssignRef=} [properties] Properties to set + */ + function MultiAssignRef(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MultiAssignRef source. + * @member {pg_query.INode|null|undefined} source + * @memberof pg_query.MultiAssignRef + * @instance + */ + MultiAssignRef.prototype.source = null; + + /** + * MultiAssignRef colno. + * @member {number} colno + * @memberof pg_query.MultiAssignRef + * @instance + */ + MultiAssignRef.prototype.colno = 0; + + /** + * MultiAssignRef ncolumns. + * @member {number} ncolumns + * @memberof pg_query.MultiAssignRef + * @instance + */ + MultiAssignRef.prototype.ncolumns = 0; + + /** + * Creates a new MultiAssignRef instance using the specified properties. + * @function create + * @memberof pg_query.MultiAssignRef + * @static + * @param {pg_query.IMultiAssignRef=} [properties] Properties to set + * @returns {pg_query.MultiAssignRef} MultiAssignRef instance + */ + MultiAssignRef.create = function create(properties) { + return new MultiAssignRef(properties); + }; + + /** + * Encodes the specified MultiAssignRef message. Does not implicitly {@link pg_query.MultiAssignRef.verify|verify} messages. + * @function encode + * @memberof pg_query.MultiAssignRef + * @static + * @param {pg_query.IMultiAssignRef} message MultiAssignRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiAssignRef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + $root.pg_query.Node.encode(message.source, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.colno != null && Object.hasOwnProperty.call(message, "colno")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.colno); + if (message.ncolumns != null && Object.hasOwnProperty.call(message, "ncolumns")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ncolumns); + return writer; + }; + + /** + * Encodes the specified MultiAssignRef message, length delimited. Does not implicitly {@link pg_query.MultiAssignRef.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.MultiAssignRef + * @static + * @param {pg_query.IMultiAssignRef} message MultiAssignRef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MultiAssignRef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MultiAssignRef message from the specified reader or buffer. + * @function decode + * @memberof pg_query.MultiAssignRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.MultiAssignRef} MultiAssignRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiAssignRef.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.MultiAssignRef(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.colno = reader.int32(); + break; + } + case 3: { + message.ncolumns = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MultiAssignRef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.MultiAssignRef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.MultiAssignRef} MultiAssignRef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MultiAssignRef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MultiAssignRef message. + * @function verify + * @memberof pg_query.MultiAssignRef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MultiAssignRef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) { + var error = $root.pg_query.Node.verify(message.source); + if (error) + return "source." + error; + } + if (message.colno != null && message.hasOwnProperty("colno")) + if (!$util.isInteger(message.colno)) + return "colno: integer expected"; + if (message.ncolumns != null && message.hasOwnProperty("ncolumns")) + if (!$util.isInteger(message.ncolumns)) + return "ncolumns: integer expected"; + return null; + }; + + /** + * Creates a MultiAssignRef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.MultiAssignRef + * @static + * @param {Object.} object Plain object + * @returns {pg_query.MultiAssignRef} MultiAssignRef + */ + MultiAssignRef.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.MultiAssignRef) + return object; + var message = new $root.pg_query.MultiAssignRef(); + if (object.source != null) { + if (typeof object.source !== "object") + throw TypeError(".pg_query.MultiAssignRef.source: object expected"); + message.source = $root.pg_query.Node.fromObject(object.source); + } + if (object.colno != null) + message.colno = object.colno | 0; + if (object.ncolumns != null) + message.ncolumns = object.ncolumns | 0; + return message; + }; + + /** + * Creates a plain object from a MultiAssignRef message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.MultiAssignRef + * @static + * @param {pg_query.MultiAssignRef} message MultiAssignRef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MultiAssignRef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = null; + object.colno = 0; + object.ncolumns = 0; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = $root.pg_query.Node.toObject(message.source, options); + if (message.colno != null && message.hasOwnProperty("colno")) + object.colno = message.colno; + if (message.ncolumns != null && message.hasOwnProperty("ncolumns")) + object.ncolumns = message.ncolumns; + return object; + }; + + /** + * Converts this MultiAssignRef to JSON. + * @function toJSON + * @memberof pg_query.MultiAssignRef + * @instance + * @returns {Object.} JSON object + */ + MultiAssignRef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MultiAssignRef + * @function getTypeUrl + * @memberof pg_query.MultiAssignRef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MultiAssignRef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.MultiAssignRef"; + }; + + return MultiAssignRef; + })(); + + pg_query.TypeCast = (function() { + + /** + * Properties of a TypeCast. + * @memberof pg_query + * @interface ITypeCast + * @property {pg_query.INode|null} [arg] TypeCast arg + * @property {pg_query.ITypeName|null} [typeName] TypeCast typeName + * @property {number|null} [location] TypeCast location + */ + + /** + * Constructs a new TypeCast. + * @memberof pg_query + * @classdesc Represents a TypeCast. + * @implements ITypeCast + * @constructor + * @param {pg_query.ITypeCast=} [properties] Properties to set + */ + function TypeCast(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TypeCast arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.TypeCast + * @instance + */ + TypeCast.prototype.arg = null; + + /** + * TypeCast typeName. + * @member {pg_query.ITypeName|null|undefined} typeName + * @memberof pg_query.TypeCast + * @instance + */ + TypeCast.prototype.typeName = null; + + /** + * TypeCast location. + * @member {number} location + * @memberof pg_query.TypeCast + * @instance + */ + TypeCast.prototype.location = 0; + + /** + * Creates a new TypeCast instance using the specified properties. + * @function create + * @memberof pg_query.TypeCast + * @static + * @param {pg_query.ITypeCast=} [properties] Properties to set + * @returns {pg_query.TypeCast} TypeCast instance + */ + TypeCast.create = function create(properties) { + return new TypeCast(properties); + }; + + /** + * Encodes the specified TypeCast message. Does not implicitly {@link pg_query.TypeCast.verify|verify} messages. + * @function encode + * @memberof pg_query.TypeCast + * @static + * @param {pg_query.ITypeCast} message TypeCast message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeCast.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + $root.pg_query.TypeName.encode(message.typeName, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.location); + return writer; + }; + + /** + * Encodes the specified TypeCast message, length delimited. Does not implicitly {@link pg_query.TypeCast.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.TypeCast + * @static + * @param {pg_query.ITypeCast} message TypeCast message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeCast.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TypeCast message from the specified reader or buffer. + * @function decode + * @memberof pg_query.TypeCast + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.TypeCast} TypeCast + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeCast.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.TypeCast(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.typeName = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 3: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TypeCast message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.TypeCast + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.TypeCast} TypeCast + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeCast.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TypeCast message. + * @function verify + * @memberof pg_query.TypeCast + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TypeCast.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) { + var error = $root.pg_query.TypeName.verify(message.typeName); + if (error) + return "typeName." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a TypeCast message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.TypeCast + * @static + * @param {Object.} object Plain object + * @returns {pg_query.TypeCast} TypeCast + */ + TypeCast.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.TypeCast) + return object; + var message = new $root.pg_query.TypeCast(); + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.TypeCast.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.typeName != null) { + if (typeof object.typeName !== "object") + throw TypeError(".pg_query.TypeCast.typeName: object expected"); + message.typeName = $root.pg_query.TypeName.fromObject(object.typeName); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a TypeCast message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.TypeCast + * @static + * @param {pg_query.TypeCast} message TypeCast + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TypeCast.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.arg = null; + object.typeName = null; + object.location = 0; + } + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = $root.pg_query.TypeName.toObject(message.typeName, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this TypeCast to JSON. + * @function toJSON + * @memberof pg_query.TypeCast + * @instance + * @returns {Object.} JSON object + */ + TypeCast.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TypeCast + * @function getTypeUrl + * @memberof pg_query.TypeCast + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TypeCast.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.TypeCast"; + }; + + return TypeCast; + })(); + + pg_query.CollateClause = (function() { + + /** + * Properties of a CollateClause. + * @memberof pg_query + * @interface ICollateClause + * @property {pg_query.INode|null} [arg] CollateClause arg + * @property {Array.|null} [collname] CollateClause collname + * @property {number|null} [location] CollateClause location + */ + + /** + * Constructs a new CollateClause. + * @memberof pg_query + * @classdesc Represents a CollateClause. + * @implements ICollateClause + * @constructor + * @param {pg_query.ICollateClause=} [properties] Properties to set + */ + function CollateClause(properties) { + this.collname = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CollateClause arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.CollateClause + * @instance + */ + CollateClause.prototype.arg = null; + + /** + * CollateClause collname. + * @member {Array.} collname + * @memberof pg_query.CollateClause + * @instance + */ + CollateClause.prototype.collname = $util.emptyArray; + + /** + * CollateClause location. + * @member {number} location + * @memberof pg_query.CollateClause + * @instance + */ + CollateClause.prototype.location = 0; + + /** + * Creates a new CollateClause instance using the specified properties. + * @function create + * @memberof pg_query.CollateClause + * @static + * @param {pg_query.ICollateClause=} [properties] Properties to set + * @returns {pg_query.CollateClause} CollateClause instance + */ + CollateClause.create = function create(properties) { + return new CollateClause(properties); + }; + + /** + * Encodes the specified CollateClause message. Does not implicitly {@link pg_query.CollateClause.verify|verify} messages. + * @function encode + * @memberof pg_query.CollateClause + * @static + * @param {pg_query.ICollateClause} message CollateClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CollateClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.collname != null && message.collname.length) + for (var i = 0; i < message.collname.length; ++i) + $root.pg_query.Node.encode(message.collname[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.location); + return writer; + }; + + /** + * Encodes the specified CollateClause message, length delimited. Does not implicitly {@link pg_query.CollateClause.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CollateClause + * @static + * @param {pg_query.ICollateClause} message CollateClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CollateClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CollateClause message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CollateClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CollateClause} CollateClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CollateClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CollateClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.collname && message.collname.length)) + message.collname = []; + message.collname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CollateClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CollateClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CollateClause} CollateClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CollateClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CollateClause message. + * @function verify + * @memberof pg_query.CollateClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CollateClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.collname != null && message.hasOwnProperty("collname")) { + if (!Array.isArray(message.collname)) + return "collname: array expected"; + for (var i = 0; i < message.collname.length; ++i) { + var error = $root.pg_query.Node.verify(message.collname[i]); + if (error) + return "collname." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a CollateClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CollateClause + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CollateClause} CollateClause + */ + CollateClause.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CollateClause) + return object; + var message = new $root.pg_query.CollateClause(); + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.CollateClause.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + if (object.collname) { + if (!Array.isArray(object.collname)) + throw TypeError(".pg_query.CollateClause.collname: array expected"); + message.collname = []; + for (var i = 0; i < object.collname.length; ++i) { + if (typeof object.collname[i] !== "object") + throw TypeError(".pg_query.CollateClause.collname: object expected"); + message.collname[i] = $root.pg_query.Node.fromObject(object.collname[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a CollateClause message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CollateClause + * @static + * @param {pg_query.CollateClause} message CollateClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CollateClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.collname = []; + if (options.defaults) { + object.arg = null; + object.location = 0; + } + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.collname && message.collname.length) { + object.collname = []; + for (var j = 0; j < message.collname.length; ++j) + object.collname[j] = $root.pg_query.Node.toObject(message.collname[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this CollateClause to JSON. + * @function toJSON + * @memberof pg_query.CollateClause + * @instance + * @returns {Object.} JSON object + */ + CollateClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CollateClause + * @function getTypeUrl + * @memberof pg_query.CollateClause + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CollateClause.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CollateClause"; + }; + + return CollateClause; + })(); + + pg_query.SortBy = (function() { + + /** + * Properties of a SortBy. + * @memberof pg_query + * @interface ISortBy + * @property {pg_query.INode|null} [node] SortBy node + * @property {pg_query.SortByDir|null} [sortby_dir] SortBy sortby_dir + * @property {pg_query.SortByNulls|null} [sortby_nulls] SortBy sortby_nulls + * @property {Array.|null} [useOp] SortBy useOp + * @property {number|null} [location] SortBy location + */ + + /** + * Constructs a new SortBy. + * @memberof pg_query + * @classdesc Represents a SortBy. + * @implements ISortBy + * @constructor + * @param {pg_query.ISortBy=} [properties] Properties to set + */ + function SortBy(properties) { + this.useOp = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SortBy node. + * @member {pg_query.INode|null|undefined} node + * @memberof pg_query.SortBy + * @instance + */ + SortBy.prototype.node = null; + + /** + * SortBy sortby_dir. + * @member {pg_query.SortByDir} sortby_dir + * @memberof pg_query.SortBy + * @instance + */ + SortBy.prototype.sortby_dir = 0; + + /** + * SortBy sortby_nulls. + * @member {pg_query.SortByNulls} sortby_nulls + * @memberof pg_query.SortBy + * @instance + */ + SortBy.prototype.sortby_nulls = 0; + + /** + * SortBy useOp. + * @member {Array.} useOp + * @memberof pg_query.SortBy + * @instance + */ + SortBy.prototype.useOp = $util.emptyArray; + + /** + * SortBy location. + * @member {number} location + * @memberof pg_query.SortBy + * @instance + */ + SortBy.prototype.location = 0; + + /** + * Creates a new SortBy instance using the specified properties. + * @function create + * @memberof pg_query.SortBy + * @static + * @param {pg_query.ISortBy=} [properties] Properties to set + * @returns {pg_query.SortBy} SortBy instance + */ + SortBy.create = function create(properties) { + return new SortBy(properties); + }; + + /** + * Encodes the specified SortBy message. Does not implicitly {@link pg_query.SortBy.verify|verify} messages. + * @function encode + * @memberof pg_query.SortBy + * @static + * @param {pg_query.ISortBy} message SortBy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SortBy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.node != null && Object.hasOwnProperty.call(message, "node")) + $root.pg_query.Node.encode(message.node, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sortby_dir != null && Object.hasOwnProperty.call(message, "sortby_dir")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sortby_dir); + if (message.sortby_nulls != null && Object.hasOwnProperty.call(message, "sortby_nulls")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.sortby_nulls); + if (message.useOp != null && message.useOp.length) + for (var i = 0; i < message.useOp.length; ++i) + $root.pg_query.Node.encode(message.useOp[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified SortBy message, length delimited. Does not implicitly {@link pg_query.SortBy.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.SortBy + * @static + * @param {pg_query.ISortBy} message SortBy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SortBy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SortBy message from the specified reader or buffer. + * @function decode + * @memberof pg_query.SortBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.SortBy} SortBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SortBy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.SortBy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.node = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.sortby_dir = reader.int32(); + break; + } + case 3: { + message.sortby_nulls = reader.int32(); + break; + } + case 4: { + if (!(message.useOp && message.useOp.length)) + message.useOp = []; + message.useOp.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SortBy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.SortBy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.SortBy} SortBy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SortBy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SortBy message. + * @function verify + * @memberof pg_query.SortBy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SortBy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.node != null && message.hasOwnProperty("node")) { + var error = $root.pg_query.Node.verify(message.node); + if (error) + return "node." + error; + } + if (message.sortby_dir != null && message.hasOwnProperty("sortby_dir")) + switch (message.sortby_dir) { + default: + return "sortby_dir: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.sortby_nulls != null && message.hasOwnProperty("sortby_nulls")) + switch (message.sortby_nulls) { + default: + return "sortby_nulls: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.useOp != null && message.hasOwnProperty("useOp")) { + if (!Array.isArray(message.useOp)) + return "useOp: array expected"; + for (var i = 0; i < message.useOp.length; ++i) { + var error = $root.pg_query.Node.verify(message.useOp[i]); + if (error) + return "useOp." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a SortBy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.SortBy + * @static + * @param {Object.} object Plain object + * @returns {pg_query.SortBy} SortBy + */ + SortBy.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.SortBy) + return object; + var message = new $root.pg_query.SortBy(); + if (object.node != null) { + if (typeof object.node !== "object") + throw TypeError(".pg_query.SortBy.node: object expected"); + message.node = $root.pg_query.Node.fromObject(object.node); + } + switch (object.sortby_dir) { + default: + if (typeof object.sortby_dir === "number") { + message.sortby_dir = object.sortby_dir; + break; + } + break; + case "SORT_BY_DIR_UNDEFINED": + case 0: + message.sortby_dir = 0; + break; + case "SORTBY_DEFAULT": + case 1: + message.sortby_dir = 1; + break; + case "SORTBY_ASC": + case 2: + message.sortby_dir = 2; + break; + case "SORTBY_DESC": + case 3: + message.sortby_dir = 3; + break; + case "SORTBY_USING": + case 4: + message.sortby_dir = 4; + break; + } + switch (object.sortby_nulls) { + default: + if (typeof object.sortby_nulls === "number") { + message.sortby_nulls = object.sortby_nulls; + break; + } + break; + case "SORT_BY_NULLS_UNDEFINED": + case 0: + message.sortby_nulls = 0; + break; + case "SORTBY_NULLS_DEFAULT": + case 1: + message.sortby_nulls = 1; + break; + case "SORTBY_NULLS_FIRST": + case 2: + message.sortby_nulls = 2; + break; + case "SORTBY_NULLS_LAST": + case 3: + message.sortby_nulls = 3; + break; + } + if (object.useOp) { + if (!Array.isArray(object.useOp)) + throw TypeError(".pg_query.SortBy.useOp: array expected"); + message.useOp = []; + for (var i = 0; i < object.useOp.length; ++i) { + if (typeof object.useOp[i] !== "object") + throw TypeError(".pg_query.SortBy.useOp: object expected"); + message.useOp[i] = $root.pg_query.Node.fromObject(object.useOp[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a SortBy message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.SortBy + * @static + * @param {pg_query.SortBy} message SortBy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SortBy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.useOp = []; + if (options.defaults) { + object.node = null; + object.sortby_dir = options.enums === String ? "SORT_BY_DIR_UNDEFINED" : 0; + object.sortby_nulls = options.enums === String ? "SORT_BY_NULLS_UNDEFINED" : 0; + object.location = 0; + } + if (message.node != null && message.hasOwnProperty("node")) + object.node = $root.pg_query.Node.toObject(message.node, options); + if (message.sortby_dir != null && message.hasOwnProperty("sortby_dir")) + object.sortby_dir = options.enums === String ? $root.pg_query.SortByDir[message.sortby_dir] === undefined ? message.sortby_dir : $root.pg_query.SortByDir[message.sortby_dir] : message.sortby_dir; + if (message.sortby_nulls != null && message.hasOwnProperty("sortby_nulls")) + object.sortby_nulls = options.enums === String ? $root.pg_query.SortByNulls[message.sortby_nulls] === undefined ? message.sortby_nulls : $root.pg_query.SortByNulls[message.sortby_nulls] : message.sortby_nulls; + if (message.useOp && message.useOp.length) { + object.useOp = []; + for (var j = 0; j < message.useOp.length; ++j) + object.useOp[j] = $root.pg_query.Node.toObject(message.useOp[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this SortBy to JSON. + * @function toJSON + * @memberof pg_query.SortBy + * @instance + * @returns {Object.} JSON object + */ + SortBy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SortBy + * @function getTypeUrl + * @memberof pg_query.SortBy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SortBy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.SortBy"; + }; + + return SortBy; + })(); + + pg_query.WindowDef = (function() { + + /** + * Properties of a WindowDef. + * @memberof pg_query + * @interface IWindowDef + * @property {string|null} [name] WindowDef name + * @property {string|null} [refname] WindowDef refname + * @property {Array.|null} [partitionClause] WindowDef partitionClause + * @property {Array.|null} [orderClause] WindowDef orderClause + * @property {number|null} [frameOptions] WindowDef frameOptions + * @property {pg_query.INode|null} [startOffset] WindowDef startOffset + * @property {pg_query.INode|null} [endOffset] WindowDef endOffset + * @property {number|null} [location] WindowDef location + */ + + /** + * Constructs a new WindowDef. + * @memberof pg_query + * @classdesc Represents a WindowDef. + * @implements IWindowDef + * @constructor + * @param {pg_query.IWindowDef=} [properties] Properties to set + */ + function WindowDef(properties) { + this.partitionClause = []; + this.orderClause = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowDef name. + * @member {string} name + * @memberof pg_query.WindowDef + * @instance + */ + WindowDef.prototype.name = ""; + + /** + * WindowDef refname. + * @member {string} refname + * @memberof pg_query.WindowDef + * @instance + */ + WindowDef.prototype.refname = ""; + + /** + * WindowDef partitionClause. + * @member {Array.} partitionClause + * @memberof pg_query.WindowDef + * @instance + */ + WindowDef.prototype.partitionClause = $util.emptyArray; + + /** + * WindowDef orderClause. + * @member {Array.} orderClause + * @memberof pg_query.WindowDef + * @instance + */ + WindowDef.prototype.orderClause = $util.emptyArray; + + /** + * WindowDef frameOptions. + * @member {number} frameOptions + * @memberof pg_query.WindowDef + * @instance + */ + WindowDef.prototype.frameOptions = 0; + + /** + * WindowDef startOffset. + * @member {pg_query.INode|null|undefined} startOffset + * @memberof pg_query.WindowDef + * @instance + */ + WindowDef.prototype.startOffset = null; + + /** + * WindowDef endOffset. + * @member {pg_query.INode|null|undefined} endOffset + * @memberof pg_query.WindowDef + * @instance + */ + WindowDef.prototype.endOffset = null; + + /** + * WindowDef location. + * @member {number} location + * @memberof pg_query.WindowDef + * @instance + */ + WindowDef.prototype.location = 0; + + /** + * Creates a new WindowDef instance using the specified properties. + * @function create + * @memberof pg_query.WindowDef + * @static + * @param {pg_query.IWindowDef=} [properties] Properties to set + * @returns {pg_query.WindowDef} WindowDef instance + */ + WindowDef.create = function create(properties) { + return new WindowDef(properties); + }; + + /** + * Encodes the specified WindowDef message. Does not implicitly {@link pg_query.WindowDef.verify|verify} messages. + * @function encode + * @memberof pg_query.WindowDef + * @static + * @param {pg_query.IWindowDef} message WindowDef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowDef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.refname != null && Object.hasOwnProperty.call(message, "refname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.refname); + if (message.partitionClause != null && message.partitionClause.length) + for (var i = 0; i < message.partitionClause.length; ++i) + $root.pg_query.Node.encode(message.partitionClause[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.orderClause != null && message.orderClause.length) + for (var i = 0; i < message.orderClause.length; ++i) + $root.pg_query.Node.encode(message.orderClause[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.frameOptions != null && Object.hasOwnProperty.call(message, "frameOptions")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.frameOptions); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + $root.pg_query.Node.encode(message.startOffset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + $root.pg_query.Node.encode(message.endOffset, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.location); + return writer; + }; + + /** + * Encodes the specified WindowDef message, length delimited. Does not implicitly {@link pg_query.WindowDef.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.WindowDef + * @static + * @param {pg_query.IWindowDef} message WindowDef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowDef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowDef message from the specified reader or buffer. + * @function decode + * @memberof pg_query.WindowDef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.WindowDef} WindowDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowDef.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.WindowDef(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.refname = reader.string(); + break; + } + case 3: { + if (!(message.partitionClause && message.partitionClause.length)) + message.partitionClause = []; + message.partitionClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.orderClause && message.orderClause.length)) + message.orderClause = []; + message.orderClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.frameOptions = reader.int32(); + break; + } + case 6: { + message.startOffset = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 7: { + message.endOffset = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 8: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowDef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.WindowDef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.WindowDef} WindowDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowDef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowDef message. + * @function verify + * @memberof pg_query.WindowDef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowDef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.refname != null && message.hasOwnProperty("refname")) + if (!$util.isString(message.refname)) + return "refname: string expected"; + if (message.partitionClause != null && message.hasOwnProperty("partitionClause")) { + if (!Array.isArray(message.partitionClause)) + return "partitionClause: array expected"; + for (var i = 0; i < message.partitionClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.partitionClause[i]); + if (error) + return "partitionClause." + error; + } + } + if (message.orderClause != null && message.hasOwnProperty("orderClause")) { + if (!Array.isArray(message.orderClause)) + return "orderClause: array expected"; + for (var i = 0; i < message.orderClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.orderClause[i]); + if (error) + return "orderClause." + error; + } + } + if (message.frameOptions != null && message.hasOwnProperty("frameOptions")) + if (!$util.isInteger(message.frameOptions)) + return "frameOptions: integer expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) { + var error = $root.pg_query.Node.verify(message.startOffset); + if (error) + return "startOffset." + error; + } + if (message.endOffset != null && message.hasOwnProperty("endOffset")) { + var error = $root.pg_query.Node.verify(message.endOffset); + if (error) + return "endOffset." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a WindowDef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.WindowDef + * @static + * @param {Object.} object Plain object + * @returns {pg_query.WindowDef} WindowDef + */ + WindowDef.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.WindowDef) + return object; + var message = new $root.pg_query.WindowDef(); + if (object.name != null) + message.name = String(object.name); + if (object.refname != null) + message.refname = String(object.refname); + if (object.partitionClause) { + if (!Array.isArray(object.partitionClause)) + throw TypeError(".pg_query.WindowDef.partitionClause: array expected"); + message.partitionClause = []; + for (var i = 0; i < object.partitionClause.length; ++i) { + if (typeof object.partitionClause[i] !== "object") + throw TypeError(".pg_query.WindowDef.partitionClause: object expected"); + message.partitionClause[i] = $root.pg_query.Node.fromObject(object.partitionClause[i]); + } + } + if (object.orderClause) { + if (!Array.isArray(object.orderClause)) + throw TypeError(".pg_query.WindowDef.orderClause: array expected"); + message.orderClause = []; + for (var i = 0; i < object.orderClause.length; ++i) { + if (typeof object.orderClause[i] !== "object") + throw TypeError(".pg_query.WindowDef.orderClause: object expected"); + message.orderClause[i] = $root.pg_query.Node.fromObject(object.orderClause[i]); + } + } + if (object.frameOptions != null) + message.frameOptions = object.frameOptions | 0; + if (object.startOffset != null) { + if (typeof object.startOffset !== "object") + throw TypeError(".pg_query.WindowDef.startOffset: object expected"); + message.startOffset = $root.pg_query.Node.fromObject(object.startOffset); + } + if (object.endOffset != null) { + if (typeof object.endOffset !== "object") + throw TypeError(".pg_query.WindowDef.endOffset: object expected"); + message.endOffset = $root.pg_query.Node.fromObject(object.endOffset); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a WindowDef message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.WindowDef + * @static + * @param {pg_query.WindowDef} message WindowDef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowDef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.partitionClause = []; + object.orderClause = []; + } + if (options.defaults) { + object.name = ""; + object.refname = ""; + object.frameOptions = 0; + object.startOffset = null; + object.endOffset = null; + object.location = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.refname != null && message.hasOwnProperty("refname")) + object.refname = message.refname; + if (message.partitionClause && message.partitionClause.length) { + object.partitionClause = []; + for (var j = 0; j < message.partitionClause.length; ++j) + object.partitionClause[j] = $root.pg_query.Node.toObject(message.partitionClause[j], options); + } + if (message.orderClause && message.orderClause.length) { + object.orderClause = []; + for (var j = 0; j < message.orderClause.length; ++j) + object.orderClause[j] = $root.pg_query.Node.toObject(message.orderClause[j], options); + } + if (message.frameOptions != null && message.hasOwnProperty("frameOptions")) + object.frameOptions = message.frameOptions; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + object.startOffset = $root.pg_query.Node.toObject(message.startOffset, options); + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + object.endOffset = $root.pg_query.Node.toObject(message.endOffset, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this WindowDef to JSON. + * @function toJSON + * @memberof pg_query.WindowDef + * @instance + * @returns {Object.} JSON object + */ + WindowDef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowDef + * @function getTypeUrl + * @memberof pg_query.WindowDef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowDef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.WindowDef"; + }; + + return WindowDef; + })(); + + pg_query.RangeSubselect = (function() { + + /** + * Properties of a RangeSubselect. + * @memberof pg_query + * @interface IRangeSubselect + * @property {boolean|null} [lateral] RangeSubselect lateral + * @property {pg_query.INode|null} [subquery] RangeSubselect subquery + * @property {pg_query.IAlias|null} [alias] RangeSubselect alias + */ + + /** + * Constructs a new RangeSubselect. + * @memberof pg_query + * @classdesc Represents a RangeSubselect. + * @implements IRangeSubselect + * @constructor + * @param {pg_query.IRangeSubselect=} [properties] Properties to set + */ + function RangeSubselect(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RangeSubselect lateral. + * @member {boolean} lateral + * @memberof pg_query.RangeSubselect + * @instance + */ + RangeSubselect.prototype.lateral = false; + + /** + * RangeSubselect subquery. + * @member {pg_query.INode|null|undefined} subquery + * @memberof pg_query.RangeSubselect + * @instance + */ + RangeSubselect.prototype.subquery = null; + + /** + * RangeSubselect alias. + * @member {pg_query.IAlias|null|undefined} alias + * @memberof pg_query.RangeSubselect + * @instance + */ + RangeSubselect.prototype.alias = null; + + /** + * Creates a new RangeSubselect instance using the specified properties. + * @function create + * @memberof pg_query.RangeSubselect + * @static + * @param {pg_query.IRangeSubselect=} [properties] Properties to set + * @returns {pg_query.RangeSubselect} RangeSubselect instance + */ + RangeSubselect.create = function create(properties) { + return new RangeSubselect(properties); + }; + + /** + * Encodes the specified RangeSubselect message. Does not implicitly {@link pg_query.RangeSubselect.verify|verify} messages. + * @function encode + * @memberof pg_query.RangeSubselect + * @static + * @param {pg_query.IRangeSubselect} message RangeSubselect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeSubselect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lateral != null && Object.hasOwnProperty.call(message, "lateral")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.lateral); + if (message.subquery != null && Object.hasOwnProperty.call(message, "subquery")) + $root.pg_query.Node.encode(message.subquery, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + $root.pg_query.Alias.encode(message.alias, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RangeSubselect message, length delimited. Does not implicitly {@link pg_query.RangeSubselect.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RangeSubselect + * @static + * @param {pg_query.IRangeSubselect} message RangeSubselect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeSubselect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RangeSubselect message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RangeSubselect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RangeSubselect} RangeSubselect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeSubselect.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RangeSubselect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lateral = reader.bool(); + break; + } + case 2: { + message.subquery = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.alias = $root.pg_query.Alias.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RangeSubselect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RangeSubselect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RangeSubselect} RangeSubselect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeSubselect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RangeSubselect message. + * @function verify + * @memberof pg_query.RangeSubselect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RangeSubselect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lateral != null && message.hasOwnProperty("lateral")) + if (typeof message.lateral !== "boolean") + return "lateral: boolean expected"; + if (message.subquery != null && message.hasOwnProperty("subquery")) { + var error = $root.pg_query.Node.verify(message.subquery); + if (error) + return "subquery." + error; + } + if (message.alias != null && message.hasOwnProperty("alias")) { + var error = $root.pg_query.Alias.verify(message.alias); + if (error) + return "alias." + error; + } + return null; + }; + + /** + * Creates a RangeSubselect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RangeSubselect + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RangeSubselect} RangeSubselect + */ + RangeSubselect.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RangeSubselect) + return object; + var message = new $root.pg_query.RangeSubselect(); + if (object.lateral != null) + message.lateral = Boolean(object.lateral); + if (object.subquery != null) { + if (typeof object.subquery !== "object") + throw TypeError(".pg_query.RangeSubselect.subquery: object expected"); + message.subquery = $root.pg_query.Node.fromObject(object.subquery); + } + if (object.alias != null) { + if (typeof object.alias !== "object") + throw TypeError(".pg_query.RangeSubselect.alias: object expected"); + message.alias = $root.pg_query.Alias.fromObject(object.alias); + } + return message; + }; + + /** + * Creates a plain object from a RangeSubselect message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RangeSubselect + * @static + * @param {pg_query.RangeSubselect} message RangeSubselect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RangeSubselect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lateral = false; + object.subquery = null; + object.alias = null; + } + if (message.lateral != null && message.hasOwnProperty("lateral")) + object.lateral = message.lateral; + if (message.subquery != null && message.hasOwnProperty("subquery")) + object.subquery = $root.pg_query.Node.toObject(message.subquery, options); + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = $root.pg_query.Alias.toObject(message.alias, options); + return object; + }; + + /** + * Converts this RangeSubselect to JSON. + * @function toJSON + * @memberof pg_query.RangeSubselect + * @instance + * @returns {Object.} JSON object + */ + RangeSubselect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RangeSubselect + * @function getTypeUrl + * @memberof pg_query.RangeSubselect + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RangeSubselect.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RangeSubselect"; + }; + + return RangeSubselect; + })(); + + pg_query.RangeFunction = (function() { + + /** + * Properties of a RangeFunction. + * @memberof pg_query + * @interface IRangeFunction + * @property {boolean|null} [lateral] RangeFunction lateral + * @property {boolean|null} [ordinality] RangeFunction ordinality + * @property {boolean|null} [is_rowsfrom] RangeFunction is_rowsfrom + * @property {Array.|null} [functions] RangeFunction functions + * @property {pg_query.IAlias|null} [alias] RangeFunction alias + * @property {Array.|null} [coldeflist] RangeFunction coldeflist + */ + + /** + * Constructs a new RangeFunction. + * @memberof pg_query + * @classdesc Represents a RangeFunction. + * @implements IRangeFunction + * @constructor + * @param {pg_query.IRangeFunction=} [properties] Properties to set + */ + function RangeFunction(properties) { + this.functions = []; + this.coldeflist = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RangeFunction lateral. + * @member {boolean} lateral + * @memberof pg_query.RangeFunction + * @instance + */ + RangeFunction.prototype.lateral = false; + + /** + * RangeFunction ordinality. + * @member {boolean} ordinality + * @memberof pg_query.RangeFunction + * @instance + */ + RangeFunction.prototype.ordinality = false; + + /** + * RangeFunction is_rowsfrom. + * @member {boolean} is_rowsfrom + * @memberof pg_query.RangeFunction + * @instance + */ + RangeFunction.prototype.is_rowsfrom = false; + + /** + * RangeFunction functions. + * @member {Array.} functions + * @memberof pg_query.RangeFunction + * @instance + */ + RangeFunction.prototype.functions = $util.emptyArray; + + /** + * RangeFunction alias. + * @member {pg_query.IAlias|null|undefined} alias + * @memberof pg_query.RangeFunction + * @instance + */ + RangeFunction.prototype.alias = null; + + /** + * RangeFunction coldeflist. + * @member {Array.} coldeflist + * @memberof pg_query.RangeFunction + * @instance + */ + RangeFunction.prototype.coldeflist = $util.emptyArray; + + /** + * Creates a new RangeFunction instance using the specified properties. + * @function create + * @memberof pg_query.RangeFunction + * @static + * @param {pg_query.IRangeFunction=} [properties] Properties to set + * @returns {pg_query.RangeFunction} RangeFunction instance + */ + RangeFunction.create = function create(properties) { + return new RangeFunction(properties); + }; + + /** + * Encodes the specified RangeFunction message. Does not implicitly {@link pg_query.RangeFunction.verify|verify} messages. + * @function encode + * @memberof pg_query.RangeFunction + * @static + * @param {pg_query.IRangeFunction} message RangeFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeFunction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lateral != null && Object.hasOwnProperty.call(message, "lateral")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.lateral); + if (message.ordinality != null && Object.hasOwnProperty.call(message, "ordinality")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.ordinality); + if (message.is_rowsfrom != null && Object.hasOwnProperty.call(message, "is_rowsfrom")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.is_rowsfrom); + if (message.functions != null && message.functions.length) + for (var i = 0; i < message.functions.length; ++i) + $root.pg_query.Node.encode(message.functions[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + $root.pg_query.Alias.encode(message.alias, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.coldeflist != null && message.coldeflist.length) + for (var i = 0; i < message.coldeflist.length; ++i) + $root.pg_query.Node.encode(message.coldeflist[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RangeFunction message, length delimited. Does not implicitly {@link pg_query.RangeFunction.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RangeFunction + * @static + * @param {pg_query.IRangeFunction} message RangeFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeFunction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RangeFunction message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RangeFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RangeFunction} RangeFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeFunction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RangeFunction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lateral = reader.bool(); + break; + } + case 2: { + message.ordinality = reader.bool(); + break; + } + case 3: { + message.is_rowsfrom = reader.bool(); + break; + } + case 4: { + if (!(message.functions && message.functions.length)) + message.functions = []; + message.functions.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.alias = $root.pg_query.Alias.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.coldeflist && message.coldeflist.length)) + message.coldeflist = []; + message.coldeflist.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RangeFunction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RangeFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RangeFunction} RangeFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeFunction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RangeFunction message. + * @function verify + * @memberof pg_query.RangeFunction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RangeFunction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lateral != null && message.hasOwnProperty("lateral")) + if (typeof message.lateral !== "boolean") + return "lateral: boolean expected"; + if (message.ordinality != null && message.hasOwnProperty("ordinality")) + if (typeof message.ordinality !== "boolean") + return "ordinality: boolean expected"; + if (message.is_rowsfrom != null && message.hasOwnProperty("is_rowsfrom")) + if (typeof message.is_rowsfrom !== "boolean") + return "is_rowsfrom: boolean expected"; + if (message.functions != null && message.hasOwnProperty("functions")) { + if (!Array.isArray(message.functions)) + return "functions: array expected"; + for (var i = 0; i < message.functions.length; ++i) { + var error = $root.pg_query.Node.verify(message.functions[i]); + if (error) + return "functions." + error; + } + } + if (message.alias != null && message.hasOwnProperty("alias")) { + var error = $root.pg_query.Alias.verify(message.alias); + if (error) + return "alias." + error; + } + if (message.coldeflist != null && message.hasOwnProperty("coldeflist")) { + if (!Array.isArray(message.coldeflist)) + return "coldeflist: array expected"; + for (var i = 0; i < message.coldeflist.length; ++i) { + var error = $root.pg_query.Node.verify(message.coldeflist[i]); + if (error) + return "coldeflist." + error; + } + } + return null; + }; + + /** + * Creates a RangeFunction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RangeFunction + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RangeFunction} RangeFunction + */ + RangeFunction.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RangeFunction) + return object; + var message = new $root.pg_query.RangeFunction(); + if (object.lateral != null) + message.lateral = Boolean(object.lateral); + if (object.ordinality != null) + message.ordinality = Boolean(object.ordinality); + if (object.is_rowsfrom != null) + message.is_rowsfrom = Boolean(object.is_rowsfrom); + if (object.functions) { + if (!Array.isArray(object.functions)) + throw TypeError(".pg_query.RangeFunction.functions: array expected"); + message.functions = []; + for (var i = 0; i < object.functions.length; ++i) { + if (typeof object.functions[i] !== "object") + throw TypeError(".pg_query.RangeFunction.functions: object expected"); + message.functions[i] = $root.pg_query.Node.fromObject(object.functions[i]); + } + } + if (object.alias != null) { + if (typeof object.alias !== "object") + throw TypeError(".pg_query.RangeFunction.alias: object expected"); + message.alias = $root.pg_query.Alias.fromObject(object.alias); + } + if (object.coldeflist) { + if (!Array.isArray(object.coldeflist)) + throw TypeError(".pg_query.RangeFunction.coldeflist: array expected"); + message.coldeflist = []; + for (var i = 0; i < object.coldeflist.length; ++i) { + if (typeof object.coldeflist[i] !== "object") + throw TypeError(".pg_query.RangeFunction.coldeflist: object expected"); + message.coldeflist[i] = $root.pg_query.Node.fromObject(object.coldeflist[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RangeFunction message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RangeFunction + * @static + * @param {pg_query.RangeFunction} message RangeFunction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RangeFunction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.functions = []; + object.coldeflist = []; + } + if (options.defaults) { + object.lateral = false; + object.ordinality = false; + object.is_rowsfrom = false; + object.alias = null; + } + if (message.lateral != null && message.hasOwnProperty("lateral")) + object.lateral = message.lateral; + if (message.ordinality != null && message.hasOwnProperty("ordinality")) + object.ordinality = message.ordinality; + if (message.is_rowsfrom != null && message.hasOwnProperty("is_rowsfrom")) + object.is_rowsfrom = message.is_rowsfrom; + if (message.functions && message.functions.length) { + object.functions = []; + for (var j = 0; j < message.functions.length; ++j) + object.functions[j] = $root.pg_query.Node.toObject(message.functions[j], options); + } + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = $root.pg_query.Alias.toObject(message.alias, options); + if (message.coldeflist && message.coldeflist.length) { + object.coldeflist = []; + for (var j = 0; j < message.coldeflist.length; ++j) + object.coldeflist[j] = $root.pg_query.Node.toObject(message.coldeflist[j], options); + } + return object; + }; + + /** + * Converts this RangeFunction to JSON. + * @function toJSON + * @memberof pg_query.RangeFunction + * @instance + * @returns {Object.} JSON object + */ + RangeFunction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RangeFunction + * @function getTypeUrl + * @memberof pg_query.RangeFunction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RangeFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RangeFunction"; + }; + + return RangeFunction; + })(); + + pg_query.RangeTableSample = (function() { + + /** + * Properties of a RangeTableSample. + * @memberof pg_query + * @interface IRangeTableSample + * @property {pg_query.INode|null} [relation] RangeTableSample relation + * @property {Array.|null} [method] RangeTableSample method + * @property {Array.|null} [args] RangeTableSample args + * @property {pg_query.INode|null} [repeatable] RangeTableSample repeatable + * @property {number|null} [location] RangeTableSample location + */ + + /** + * Constructs a new RangeTableSample. + * @memberof pg_query + * @classdesc Represents a RangeTableSample. + * @implements IRangeTableSample + * @constructor + * @param {pg_query.IRangeTableSample=} [properties] Properties to set + */ + function RangeTableSample(properties) { + this.method = []; + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RangeTableSample relation. + * @member {pg_query.INode|null|undefined} relation + * @memberof pg_query.RangeTableSample + * @instance + */ + RangeTableSample.prototype.relation = null; + + /** + * RangeTableSample method. + * @member {Array.} method + * @memberof pg_query.RangeTableSample + * @instance + */ + RangeTableSample.prototype.method = $util.emptyArray; + + /** + * RangeTableSample args. + * @member {Array.} args + * @memberof pg_query.RangeTableSample + * @instance + */ + RangeTableSample.prototype.args = $util.emptyArray; + + /** + * RangeTableSample repeatable. + * @member {pg_query.INode|null|undefined} repeatable + * @memberof pg_query.RangeTableSample + * @instance + */ + RangeTableSample.prototype.repeatable = null; + + /** + * RangeTableSample location. + * @member {number} location + * @memberof pg_query.RangeTableSample + * @instance + */ + RangeTableSample.prototype.location = 0; + + /** + * Creates a new RangeTableSample instance using the specified properties. + * @function create + * @memberof pg_query.RangeTableSample + * @static + * @param {pg_query.IRangeTableSample=} [properties] Properties to set + * @returns {pg_query.RangeTableSample} RangeTableSample instance + */ + RangeTableSample.create = function create(properties) { + return new RangeTableSample(properties); + }; + + /** + * Encodes the specified RangeTableSample message. Does not implicitly {@link pg_query.RangeTableSample.verify|verify} messages. + * @function encode + * @memberof pg_query.RangeTableSample + * @static + * @param {pg_query.IRangeTableSample} message RangeTableSample message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeTableSample.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.Node.encode(message.relation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.pg_query.Node.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.repeatable != null && Object.hasOwnProperty.call(message, "repeatable")) + $root.pg_query.Node.encode(message.repeatable, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified RangeTableSample message, length delimited. Does not implicitly {@link pg_query.RangeTableSample.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RangeTableSample + * @static + * @param {pg_query.IRangeTableSample} message RangeTableSample message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeTableSample.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RangeTableSample message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RangeTableSample + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RangeTableSample} RangeTableSample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeTableSample.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RangeTableSample(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relation = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.repeatable = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RangeTableSample message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RangeTableSample + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RangeTableSample} RangeTableSample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeTableSample.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RangeTableSample message. + * @function verify + * @memberof pg_query.RangeTableSample + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RangeTableSample.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.Node.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.pg_query.Node.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.repeatable != null && message.hasOwnProperty("repeatable")) { + var error = $root.pg_query.Node.verify(message.repeatable); + if (error) + return "repeatable." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a RangeTableSample message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RangeTableSample + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RangeTableSample} RangeTableSample + */ + RangeTableSample.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RangeTableSample) + return object; + var message = new $root.pg_query.RangeTableSample(); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.RangeTableSample.relation: object expected"); + message.relation = $root.pg_query.Node.fromObject(object.relation); + } + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".pg_query.RangeTableSample.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".pg_query.RangeTableSample.method: object expected"); + message.method[i] = $root.pg_query.Node.fromObject(object.method[i]); + } + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.RangeTableSample.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.RangeTableSample.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.repeatable != null) { + if (typeof object.repeatable !== "object") + throw TypeError(".pg_query.RangeTableSample.repeatable: object expected"); + message.repeatable = $root.pg_query.Node.fromObject(object.repeatable); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a RangeTableSample message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RangeTableSample + * @static + * @param {pg_query.RangeTableSample} message RangeTableSample + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RangeTableSample.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.method = []; + object.args = []; + } + if (options.defaults) { + object.relation = null; + object.repeatable = null; + object.location = 0; + } + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.Node.toObject(message.relation, options); + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.pg_query.Node.toObject(message.method[j], options); + } + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.repeatable != null && message.hasOwnProperty("repeatable")) + object.repeatable = $root.pg_query.Node.toObject(message.repeatable, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this RangeTableSample to JSON. + * @function toJSON + * @memberof pg_query.RangeTableSample + * @instance + * @returns {Object.} JSON object + */ + RangeTableSample.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RangeTableSample + * @function getTypeUrl + * @memberof pg_query.RangeTableSample + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RangeTableSample.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RangeTableSample"; + }; + + return RangeTableSample; + })(); + + pg_query.RangeTableFunc = (function() { + + /** + * Properties of a RangeTableFunc. + * @memberof pg_query + * @interface IRangeTableFunc + * @property {boolean|null} [lateral] RangeTableFunc lateral + * @property {pg_query.INode|null} [docexpr] RangeTableFunc docexpr + * @property {pg_query.INode|null} [rowexpr] RangeTableFunc rowexpr + * @property {Array.|null} [namespaces] RangeTableFunc namespaces + * @property {Array.|null} [columns] RangeTableFunc columns + * @property {pg_query.IAlias|null} [alias] RangeTableFunc alias + * @property {number|null} [location] RangeTableFunc location + */ + + /** + * Constructs a new RangeTableFunc. + * @memberof pg_query + * @classdesc Represents a RangeTableFunc. + * @implements IRangeTableFunc + * @constructor + * @param {pg_query.IRangeTableFunc=} [properties] Properties to set + */ + function RangeTableFunc(properties) { + this.namespaces = []; + this.columns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RangeTableFunc lateral. + * @member {boolean} lateral + * @memberof pg_query.RangeTableFunc + * @instance + */ + RangeTableFunc.prototype.lateral = false; + + /** + * RangeTableFunc docexpr. + * @member {pg_query.INode|null|undefined} docexpr + * @memberof pg_query.RangeTableFunc + * @instance + */ + RangeTableFunc.prototype.docexpr = null; + + /** + * RangeTableFunc rowexpr. + * @member {pg_query.INode|null|undefined} rowexpr + * @memberof pg_query.RangeTableFunc + * @instance + */ + RangeTableFunc.prototype.rowexpr = null; + + /** + * RangeTableFunc namespaces. + * @member {Array.} namespaces + * @memberof pg_query.RangeTableFunc + * @instance + */ + RangeTableFunc.prototype.namespaces = $util.emptyArray; + + /** + * RangeTableFunc columns. + * @member {Array.} columns + * @memberof pg_query.RangeTableFunc + * @instance + */ + RangeTableFunc.prototype.columns = $util.emptyArray; + + /** + * RangeTableFunc alias. + * @member {pg_query.IAlias|null|undefined} alias + * @memberof pg_query.RangeTableFunc + * @instance + */ + RangeTableFunc.prototype.alias = null; + + /** + * RangeTableFunc location. + * @member {number} location + * @memberof pg_query.RangeTableFunc + * @instance + */ + RangeTableFunc.prototype.location = 0; + + /** + * Creates a new RangeTableFunc instance using the specified properties. + * @function create + * @memberof pg_query.RangeTableFunc + * @static + * @param {pg_query.IRangeTableFunc=} [properties] Properties to set + * @returns {pg_query.RangeTableFunc} RangeTableFunc instance + */ + RangeTableFunc.create = function create(properties) { + return new RangeTableFunc(properties); + }; + + /** + * Encodes the specified RangeTableFunc message. Does not implicitly {@link pg_query.RangeTableFunc.verify|verify} messages. + * @function encode + * @memberof pg_query.RangeTableFunc + * @static + * @param {pg_query.IRangeTableFunc} message RangeTableFunc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeTableFunc.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lateral != null && Object.hasOwnProperty.call(message, "lateral")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.lateral); + if (message.docexpr != null && Object.hasOwnProperty.call(message, "docexpr")) + $root.pg_query.Node.encode(message.docexpr, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.rowexpr != null && Object.hasOwnProperty.call(message, "rowexpr")) + $root.pg_query.Node.encode(message.rowexpr, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.namespaces != null && message.namespaces.length) + for (var i = 0; i < message.namespaces.length; ++i) + $root.pg_query.Node.encode(message.namespaces[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.columns != null && message.columns.length) + for (var i = 0; i < message.columns.length; ++i) + $root.pg_query.Node.encode(message.columns[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + $root.pg_query.Alias.encode(message.alias, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.location); + return writer; + }; + + /** + * Encodes the specified RangeTableFunc message, length delimited. Does not implicitly {@link pg_query.RangeTableFunc.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RangeTableFunc + * @static + * @param {pg_query.IRangeTableFunc} message RangeTableFunc message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeTableFunc.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RangeTableFunc message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RangeTableFunc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RangeTableFunc} RangeTableFunc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeTableFunc.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RangeTableFunc(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lateral = reader.bool(); + break; + } + case 2: { + message.docexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.rowexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.namespaces && message.namespaces.length)) + message.namespaces = []; + message.namespaces.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.columns && message.columns.length)) + message.columns = []; + message.columns.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.alias = $root.pg_query.Alias.decode(reader, reader.uint32()); + break; + } + case 7: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RangeTableFunc message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RangeTableFunc + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RangeTableFunc} RangeTableFunc + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeTableFunc.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RangeTableFunc message. + * @function verify + * @memberof pg_query.RangeTableFunc + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RangeTableFunc.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lateral != null && message.hasOwnProperty("lateral")) + if (typeof message.lateral !== "boolean") + return "lateral: boolean expected"; + if (message.docexpr != null && message.hasOwnProperty("docexpr")) { + var error = $root.pg_query.Node.verify(message.docexpr); + if (error) + return "docexpr." + error; + } + if (message.rowexpr != null && message.hasOwnProperty("rowexpr")) { + var error = $root.pg_query.Node.verify(message.rowexpr); + if (error) + return "rowexpr." + error; + } + if (message.namespaces != null && message.hasOwnProperty("namespaces")) { + if (!Array.isArray(message.namespaces)) + return "namespaces: array expected"; + for (var i = 0; i < message.namespaces.length; ++i) { + var error = $root.pg_query.Node.verify(message.namespaces[i]); + if (error) + return "namespaces." + error; + } + } + if (message.columns != null && message.hasOwnProperty("columns")) { + if (!Array.isArray(message.columns)) + return "columns: array expected"; + for (var i = 0; i < message.columns.length; ++i) { + var error = $root.pg_query.Node.verify(message.columns[i]); + if (error) + return "columns." + error; + } + } + if (message.alias != null && message.hasOwnProperty("alias")) { + var error = $root.pg_query.Alias.verify(message.alias); + if (error) + return "alias." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a RangeTableFunc message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RangeTableFunc + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RangeTableFunc} RangeTableFunc + */ + RangeTableFunc.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RangeTableFunc) + return object; + var message = new $root.pg_query.RangeTableFunc(); + if (object.lateral != null) + message.lateral = Boolean(object.lateral); + if (object.docexpr != null) { + if (typeof object.docexpr !== "object") + throw TypeError(".pg_query.RangeTableFunc.docexpr: object expected"); + message.docexpr = $root.pg_query.Node.fromObject(object.docexpr); + } + if (object.rowexpr != null) { + if (typeof object.rowexpr !== "object") + throw TypeError(".pg_query.RangeTableFunc.rowexpr: object expected"); + message.rowexpr = $root.pg_query.Node.fromObject(object.rowexpr); + } + if (object.namespaces) { + if (!Array.isArray(object.namespaces)) + throw TypeError(".pg_query.RangeTableFunc.namespaces: array expected"); + message.namespaces = []; + for (var i = 0; i < object.namespaces.length; ++i) { + if (typeof object.namespaces[i] !== "object") + throw TypeError(".pg_query.RangeTableFunc.namespaces: object expected"); + message.namespaces[i] = $root.pg_query.Node.fromObject(object.namespaces[i]); + } + } + if (object.columns) { + if (!Array.isArray(object.columns)) + throw TypeError(".pg_query.RangeTableFunc.columns: array expected"); + message.columns = []; + for (var i = 0; i < object.columns.length; ++i) { + if (typeof object.columns[i] !== "object") + throw TypeError(".pg_query.RangeTableFunc.columns: object expected"); + message.columns[i] = $root.pg_query.Node.fromObject(object.columns[i]); + } + } + if (object.alias != null) { + if (typeof object.alias !== "object") + throw TypeError(".pg_query.RangeTableFunc.alias: object expected"); + message.alias = $root.pg_query.Alias.fromObject(object.alias); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a RangeTableFunc message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RangeTableFunc + * @static + * @param {pg_query.RangeTableFunc} message RangeTableFunc + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RangeTableFunc.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.namespaces = []; + object.columns = []; + } + if (options.defaults) { + object.lateral = false; + object.docexpr = null; + object.rowexpr = null; + object.alias = null; + object.location = 0; + } + if (message.lateral != null && message.hasOwnProperty("lateral")) + object.lateral = message.lateral; + if (message.docexpr != null && message.hasOwnProperty("docexpr")) + object.docexpr = $root.pg_query.Node.toObject(message.docexpr, options); + if (message.rowexpr != null && message.hasOwnProperty("rowexpr")) + object.rowexpr = $root.pg_query.Node.toObject(message.rowexpr, options); + if (message.namespaces && message.namespaces.length) { + object.namespaces = []; + for (var j = 0; j < message.namespaces.length; ++j) + object.namespaces[j] = $root.pg_query.Node.toObject(message.namespaces[j], options); + } + if (message.columns && message.columns.length) { + object.columns = []; + for (var j = 0; j < message.columns.length; ++j) + object.columns[j] = $root.pg_query.Node.toObject(message.columns[j], options); + } + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = $root.pg_query.Alias.toObject(message.alias, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this RangeTableFunc to JSON. + * @function toJSON + * @memberof pg_query.RangeTableFunc + * @instance + * @returns {Object.} JSON object + */ + RangeTableFunc.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RangeTableFunc + * @function getTypeUrl + * @memberof pg_query.RangeTableFunc + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RangeTableFunc.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RangeTableFunc"; + }; + + return RangeTableFunc; + })(); + + pg_query.RangeTableFuncCol = (function() { + + /** + * Properties of a RangeTableFuncCol. + * @memberof pg_query + * @interface IRangeTableFuncCol + * @property {string|null} [colname] RangeTableFuncCol colname + * @property {pg_query.ITypeName|null} [typeName] RangeTableFuncCol typeName + * @property {boolean|null} [for_ordinality] RangeTableFuncCol for_ordinality + * @property {boolean|null} [is_not_null] RangeTableFuncCol is_not_null + * @property {pg_query.INode|null} [colexpr] RangeTableFuncCol colexpr + * @property {pg_query.INode|null} [coldefexpr] RangeTableFuncCol coldefexpr + * @property {number|null} [location] RangeTableFuncCol location + */ + + /** + * Constructs a new RangeTableFuncCol. + * @memberof pg_query + * @classdesc Represents a RangeTableFuncCol. + * @implements IRangeTableFuncCol + * @constructor + * @param {pg_query.IRangeTableFuncCol=} [properties] Properties to set + */ + function RangeTableFuncCol(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RangeTableFuncCol colname. + * @member {string} colname + * @memberof pg_query.RangeTableFuncCol + * @instance + */ + RangeTableFuncCol.prototype.colname = ""; + + /** + * RangeTableFuncCol typeName. + * @member {pg_query.ITypeName|null|undefined} typeName + * @memberof pg_query.RangeTableFuncCol + * @instance + */ + RangeTableFuncCol.prototype.typeName = null; + + /** + * RangeTableFuncCol for_ordinality. + * @member {boolean} for_ordinality + * @memberof pg_query.RangeTableFuncCol + * @instance + */ + RangeTableFuncCol.prototype.for_ordinality = false; + + /** + * RangeTableFuncCol is_not_null. + * @member {boolean} is_not_null + * @memberof pg_query.RangeTableFuncCol + * @instance + */ + RangeTableFuncCol.prototype.is_not_null = false; + + /** + * RangeTableFuncCol colexpr. + * @member {pg_query.INode|null|undefined} colexpr + * @memberof pg_query.RangeTableFuncCol + * @instance + */ + RangeTableFuncCol.prototype.colexpr = null; + + /** + * RangeTableFuncCol coldefexpr. + * @member {pg_query.INode|null|undefined} coldefexpr + * @memberof pg_query.RangeTableFuncCol + * @instance + */ + RangeTableFuncCol.prototype.coldefexpr = null; + + /** + * RangeTableFuncCol location. + * @member {number} location + * @memberof pg_query.RangeTableFuncCol + * @instance + */ + RangeTableFuncCol.prototype.location = 0; + + /** + * Creates a new RangeTableFuncCol instance using the specified properties. + * @function create + * @memberof pg_query.RangeTableFuncCol + * @static + * @param {pg_query.IRangeTableFuncCol=} [properties] Properties to set + * @returns {pg_query.RangeTableFuncCol} RangeTableFuncCol instance + */ + RangeTableFuncCol.create = function create(properties) { + return new RangeTableFuncCol(properties); + }; + + /** + * Encodes the specified RangeTableFuncCol message. Does not implicitly {@link pg_query.RangeTableFuncCol.verify|verify} messages. + * @function encode + * @memberof pg_query.RangeTableFuncCol + * @static + * @param {pg_query.IRangeTableFuncCol} message RangeTableFuncCol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeTableFuncCol.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.colname != null && Object.hasOwnProperty.call(message, "colname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.colname); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + $root.pg_query.TypeName.encode(message.typeName, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.for_ordinality != null && Object.hasOwnProperty.call(message, "for_ordinality")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.for_ordinality); + if (message.is_not_null != null && Object.hasOwnProperty.call(message, "is_not_null")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.is_not_null); + if (message.colexpr != null && Object.hasOwnProperty.call(message, "colexpr")) + $root.pg_query.Node.encode(message.colexpr, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.coldefexpr != null && Object.hasOwnProperty.call(message, "coldefexpr")) + $root.pg_query.Node.encode(message.coldefexpr, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.location); + return writer; + }; + + /** + * Encodes the specified RangeTableFuncCol message, length delimited. Does not implicitly {@link pg_query.RangeTableFuncCol.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RangeTableFuncCol + * @static + * @param {pg_query.IRangeTableFuncCol} message RangeTableFuncCol message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeTableFuncCol.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RangeTableFuncCol message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RangeTableFuncCol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RangeTableFuncCol} RangeTableFuncCol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeTableFuncCol.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RangeTableFuncCol(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.colname = reader.string(); + break; + } + case 2: { + message.typeName = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 3: { + message.for_ordinality = reader.bool(); + break; + } + case 4: { + message.is_not_null = reader.bool(); + break; + } + case 5: { + message.colexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 6: { + message.coldefexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 7: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RangeTableFuncCol message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RangeTableFuncCol + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RangeTableFuncCol} RangeTableFuncCol + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeTableFuncCol.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RangeTableFuncCol message. + * @function verify + * @memberof pg_query.RangeTableFuncCol + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RangeTableFuncCol.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.colname != null && message.hasOwnProperty("colname")) + if (!$util.isString(message.colname)) + return "colname: string expected"; + if (message.typeName != null && message.hasOwnProperty("typeName")) { + var error = $root.pg_query.TypeName.verify(message.typeName); + if (error) + return "typeName." + error; + } + if (message.for_ordinality != null && message.hasOwnProperty("for_ordinality")) + if (typeof message.for_ordinality !== "boolean") + return "for_ordinality: boolean expected"; + if (message.is_not_null != null && message.hasOwnProperty("is_not_null")) + if (typeof message.is_not_null !== "boolean") + return "is_not_null: boolean expected"; + if (message.colexpr != null && message.hasOwnProperty("colexpr")) { + var error = $root.pg_query.Node.verify(message.colexpr); + if (error) + return "colexpr." + error; + } + if (message.coldefexpr != null && message.hasOwnProperty("coldefexpr")) { + var error = $root.pg_query.Node.verify(message.coldefexpr); + if (error) + return "coldefexpr." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a RangeTableFuncCol message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RangeTableFuncCol + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RangeTableFuncCol} RangeTableFuncCol + */ + RangeTableFuncCol.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RangeTableFuncCol) + return object; + var message = new $root.pg_query.RangeTableFuncCol(); + if (object.colname != null) + message.colname = String(object.colname); + if (object.typeName != null) { + if (typeof object.typeName !== "object") + throw TypeError(".pg_query.RangeTableFuncCol.typeName: object expected"); + message.typeName = $root.pg_query.TypeName.fromObject(object.typeName); + } + if (object.for_ordinality != null) + message.for_ordinality = Boolean(object.for_ordinality); + if (object.is_not_null != null) + message.is_not_null = Boolean(object.is_not_null); + if (object.colexpr != null) { + if (typeof object.colexpr !== "object") + throw TypeError(".pg_query.RangeTableFuncCol.colexpr: object expected"); + message.colexpr = $root.pg_query.Node.fromObject(object.colexpr); + } + if (object.coldefexpr != null) { + if (typeof object.coldefexpr !== "object") + throw TypeError(".pg_query.RangeTableFuncCol.coldefexpr: object expected"); + message.coldefexpr = $root.pg_query.Node.fromObject(object.coldefexpr); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a RangeTableFuncCol message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RangeTableFuncCol + * @static + * @param {pg_query.RangeTableFuncCol} message RangeTableFuncCol + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RangeTableFuncCol.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.colname = ""; + object.typeName = null; + object.for_ordinality = false; + object.is_not_null = false; + object.colexpr = null; + object.coldefexpr = null; + object.location = 0; + } + if (message.colname != null && message.hasOwnProperty("colname")) + object.colname = message.colname; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = $root.pg_query.TypeName.toObject(message.typeName, options); + if (message.for_ordinality != null && message.hasOwnProperty("for_ordinality")) + object.for_ordinality = message.for_ordinality; + if (message.is_not_null != null && message.hasOwnProperty("is_not_null")) + object.is_not_null = message.is_not_null; + if (message.colexpr != null && message.hasOwnProperty("colexpr")) + object.colexpr = $root.pg_query.Node.toObject(message.colexpr, options); + if (message.coldefexpr != null && message.hasOwnProperty("coldefexpr")) + object.coldefexpr = $root.pg_query.Node.toObject(message.coldefexpr, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this RangeTableFuncCol to JSON. + * @function toJSON + * @memberof pg_query.RangeTableFuncCol + * @instance + * @returns {Object.} JSON object + */ + RangeTableFuncCol.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RangeTableFuncCol + * @function getTypeUrl + * @memberof pg_query.RangeTableFuncCol + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RangeTableFuncCol.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RangeTableFuncCol"; + }; + + return RangeTableFuncCol; + })(); + + pg_query.TypeName = (function() { + + /** + * Properties of a TypeName. + * @memberof pg_query + * @interface ITypeName + * @property {Array.|null} [names] TypeName names + * @property {number|null} [typeOid] TypeName typeOid + * @property {boolean|null} [setof] TypeName setof + * @property {boolean|null} [pct_type] TypeName pct_type + * @property {Array.|null} [typmods] TypeName typmods + * @property {number|null} [typemod] TypeName typemod + * @property {Array.|null} [arrayBounds] TypeName arrayBounds + * @property {number|null} [location] TypeName location + */ + + /** + * Constructs a new TypeName. + * @memberof pg_query + * @classdesc Represents a TypeName. + * @implements ITypeName + * @constructor + * @param {pg_query.ITypeName=} [properties] Properties to set + */ + function TypeName(properties) { + this.names = []; + this.typmods = []; + this.arrayBounds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TypeName names. + * @member {Array.} names + * @memberof pg_query.TypeName + * @instance + */ + TypeName.prototype.names = $util.emptyArray; + + /** + * TypeName typeOid. + * @member {number} typeOid + * @memberof pg_query.TypeName + * @instance + */ + TypeName.prototype.typeOid = 0; + + /** + * TypeName setof. + * @member {boolean} setof + * @memberof pg_query.TypeName + * @instance + */ + TypeName.prototype.setof = false; + + /** + * TypeName pct_type. + * @member {boolean} pct_type + * @memberof pg_query.TypeName + * @instance + */ + TypeName.prototype.pct_type = false; + + /** + * TypeName typmods. + * @member {Array.} typmods + * @memberof pg_query.TypeName + * @instance + */ + TypeName.prototype.typmods = $util.emptyArray; + + /** + * TypeName typemod. + * @member {number} typemod + * @memberof pg_query.TypeName + * @instance + */ + TypeName.prototype.typemod = 0; + + /** + * TypeName arrayBounds. + * @member {Array.} arrayBounds + * @memberof pg_query.TypeName + * @instance + */ + TypeName.prototype.arrayBounds = $util.emptyArray; + + /** + * TypeName location. + * @member {number} location + * @memberof pg_query.TypeName + * @instance + */ + TypeName.prototype.location = 0; + + /** + * Creates a new TypeName instance using the specified properties. + * @function create + * @memberof pg_query.TypeName + * @static + * @param {pg_query.ITypeName=} [properties] Properties to set + * @returns {pg_query.TypeName} TypeName instance + */ + TypeName.create = function create(properties) { + return new TypeName(properties); + }; + + /** + * Encodes the specified TypeName message. Does not implicitly {@link pg_query.TypeName.verify|verify} messages. + * @function encode + * @memberof pg_query.TypeName + * @static + * @param {pg_query.ITypeName} message TypeName message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeName.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + $root.pg_query.Node.encode(message.names[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.typeOid != null && Object.hasOwnProperty.call(message, "typeOid")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.typeOid); + if (message.setof != null && Object.hasOwnProperty.call(message, "setof")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.setof); + if (message.pct_type != null && Object.hasOwnProperty.call(message, "pct_type")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.pct_type); + if (message.typmods != null && message.typmods.length) + for (var i = 0; i < message.typmods.length; ++i) + $root.pg_query.Node.encode(message.typmods[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.typemod != null && Object.hasOwnProperty.call(message, "typemod")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.typemod); + if (message.arrayBounds != null && message.arrayBounds.length) + for (var i = 0; i < message.arrayBounds.length; ++i) + $root.pg_query.Node.encode(message.arrayBounds[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.location); + return writer; + }; + + /** + * Encodes the specified TypeName message, length delimited. Does not implicitly {@link pg_query.TypeName.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.TypeName + * @static + * @param {pg_query.ITypeName} message TypeName message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TypeName.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TypeName message from the specified reader or buffer. + * @function decode + * @memberof pg_query.TypeName + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.TypeName} TypeName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeName.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.TypeName(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.names && message.names.length)) + message.names = []; + message.names.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.typeOid = reader.uint32(); + break; + } + case 3: { + message.setof = reader.bool(); + break; + } + case 4: { + message.pct_type = reader.bool(); + break; + } + case 5: { + if (!(message.typmods && message.typmods.length)) + message.typmods = []; + message.typmods.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.typemod = reader.int32(); + break; + } + case 7: { + if (!(message.arrayBounds && message.arrayBounds.length)) + message.arrayBounds = []; + message.arrayBounds.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 8: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TypeName message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.TypeName + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.TypeName} TypeName + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TypeName.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TypeName message. + * @function verify + * @memberof pg_query.TypeName + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TypeName.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) { + var error = $root.pg_query.Node.verify(message.names[i]); + if (error) + return "names." + error; + } + } + if (message.typeOid != null && message.hasOwnProperty("typeOid")) + if (!$util.isInteger(message.typeOid)) + return "typeOid: integer expected"; + if (message.setof != null && message.hasOwnProperty("setof")) + if (typeof message.setof !== "boolean") + return "setof: boolean expected"; + if (message.pct_type != null && message.hasOwnProperty("pct_type")) + if (typeof message.pct_type !== "boolean") + return "pct_type: boolean expected"; + if (message.typmods != null && message.hasOwnProperty("typmods")) { + if (!Array.isArray(message.typmods)) + return "typmods: array expected"; + for (var i = 0; i < message.typmods.length; ++i) { + var error = $root.pg_query.Node.verify(message.typmods[i]); + if (error) + return "typmods." + error; + } + } + if (message.typemod != null && message.hasOwnProperty("typemod")) + if (!$util.isInteger(message.typemod)) + return "typemod: integer expected"; + if (message.arrayBounds != null && message.hasOwnProperty("arrayBounds")) { + if (!Array.isArray(message.arrayBounds)) + return "arrayBounds: array expected"; + for (var i = 0; i < message.arrayBounds.length; ++i) { + var error = $root.pg_query.Node.verify(message.arrayBounds[i]); + if (error) + return "arrayBounds." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a TypeName message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.TypeName + * @static + * @param {Object.} object Plain object + * @returns {pg_query.TypeName} TypeName + */ + TypeName.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.TypeName) + return object; + var message = new $root.pg_query.TypeName(); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".pg_query.TypeName.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) { + if (typeof object.names[i] !== "object") + throw TypeError(".pg_query.TypeName.names: object expected"); + message.names[i] = $root.pg_query.Node.fromObject(object.names[i]); + } + } + if (object.typeOid != null) + message.typeOid = object.typeOid >>> 0; + if (object.setof != null) + message.setof = Boolean(object.setof); + if (object.pct_type != null) + message.pct_type = Boolean(object.pct_type); + if (object.typmods) { + if (!Array.isArray(object.typmods)) + throw TypeError(".pg_query.TypeName.typmods: array expected"); + message.typmods = []; + for (var i = 0; i < object.typmods.length; ++i) { + if (typeof object.typmods[i] !== "object") + throw TypeError(".pg_query.TypeName.typmods: object expected"); + message.typmods[i] = $root.pg_query.Node.fromObject(object.typmods[i]); + } + } + if (object.typemod != null) + message.typemod = object.typemod | 0; + if (object.arrayBounds) { + if (!Array.isArray(object.arrayBounds)) + throw TypeError(".pg_query.TypeName.arrayBounds: array expected"); + message.arrayBounds = []; + for (var i = 0; i < object.arrayBounds.length; ++i) { + if (typeof object.arrayBounds[i] !== "object") + throw TypeError(".pg_query.TypeName.arrayBounds: object expected"); + message.arrayBounds[i] = $root.pg_query.Node.fromObject(object.arrayBounds[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a TypeName message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.TypeName + * @static + * @param {pg_query.TypeName} message TypeName + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TypeName.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.names = []; + object.typmods = []; + object.arrayBounds = []; + } + if (options.defaults) { + object.typeOid = 0; + object.setof = false; + object.pct_type = false; + object.typemod = 0; + object.location = 0; + } + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = $root.pg_query.Node.toObject(message.names[j], options); + } + if (message.typeOid != null && message.hasOwnProperty("typeOid")) + object.typeOid = message.typeOid; + if (message.setof != null && message.hasOwnProperty("setof")) + object.setof = message.setof; + if (message.pct_type != null && message.hasOwnProperty("pct_type")) + object.pct_type = message.pct_type; + if (message.typmods && message.typmods.length) { + object.typmods = []; + for (var j = 0; j < message.typmods.length; ++j) + object.typmods[j] = $root.pg_query.Node.toObject(message.typmods[j], options); + } + if (message.typemod != null && message.hasOwnProperty("typemod")) + object.typemod = message.typemod; + if (message.arrayBounds && message.arrayBounds.length) { + object.arrayBounds = []; + for (var j = 0; j < message.arrayBounds.length; ++j) + object.arrayBounds[j] = $root.pg_query.Node.toObject(message.arrayBounds[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this TypeName to JSON. + * @function toJSON + * @memberof pg_query.TypeName + * @instance + * @returns {Object.} JSON object + */ + TypeName.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TypeName + * @function getTypeUrl + * @memberof pg_query.TypeName + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TypeName.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.TypeName"; + }; + + return TypeName; + })(); + + pg_query.ColumnDef = (function() { + + /** + * Properties of a ColumnDef. + * @memberof pg_query + * @interface IColumnDef + * @property {string|null} [colname] ColumnDef colname + * @property {pg_query.ITypeName|null} [typeName] ColumnDef typeName + * @property {number|null} [inhcount] ColumnDef inhcount + * @property {boolean|null} [is_local] ColumnDef is_local + * @property {boolean|null} [is_not_null] ColumnDef is_not_null + * @property {boolean|null} [is_from_type] ColumnDef is_from_type + * @property {string|null} [storage] ColumnDef storage + * @property {pg_query.INode|null} [raw_default] ColumnDef raw_default + * @property {pg_query.INode|null} [cooked_default] ColumnDef cooked_default + * @property {string|null} [identity] ColumnDef identity + * @property {pg_query.IRangeVar|null} [identitySequence] ColumnDef identitySequence + * @property {string|null} [generated] ColumnDef generated + * @property {pg_query.ICollateClause|null} [collClause] ColumnDef collClause + * @property {number|null} [collOid] ColumnDef collOid + * @property {Array.|null} [constraints] ColumnDef constraints + * @property {Array.|null} [fdwoptions] ColumnDef fdwoptions + * @property {number|null} [location] ColumnDef location + */ + + /** + * Constructs a new ColumnDef. + * @memberof pg_query + * @classdesc Represents a ColumnDef. + * @implements IColumnDef + * @constructor + * @param {pg_query.IColumnDef=} [properties] Properties to set + */ + function ColumnDef(properties) { + this.constraints = []; + this.fdwoptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnDef colname. + * @member {string} colname + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.colname = ""; + + /** + * ColumnDef typeName. + * @member {pg_query.ITypeName|null|undefined} typeName + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.typeName = null; + + /** + * ColumnDef inhcount. + * @member {number} inhcount + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.inhcount = 0; + + /** + * ColumnDef is_local. + * @member {boolean} is_local + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.is_local = false; + + /** + * ColumnDef is_not_null. + * @member {boolean} is_not_null + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.is_not_null = false; + + /** + * ColumnDef is_from_type. + * @member {boolean} is_from_type + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.is_from_type = false; + + /** + * ColumnDef storage. + * @member {string} storage + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.storage = ""; + + /** + * ColumnDef raw_default. + * @member {pg_query.INode|null|undefined} raw_default + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.raw_default = null; + + /** + * ColumnDef cooked_default. + * @member {pg_query.INode|null|undefined} cooked_default + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.cooked_default = null; + + /** + * ColumnDef identity. + * @member {string} identity + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.identity = ""; + + /** + * ColumnDef identitySequence. + * @member {pg_query.IRangeVar|null|undefined} identitySequence + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.identitySequence = null; + + /** + * ColumnDef generated. + * @member {string} generated + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.generated = ""; + + /** + * ColumnDef collClause. + * @member {pg_query.ICollateClause|null|undefined} collClause + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.collClause = null; + + /** + * ColumnDef collOid. + * @member {number} collOid + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.collOid = 0; + + /** + * ColumnDef constraints. + * @member {Array.} constraints + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.constraints = $util.emptyArray; + + /** + * ColumnDef fdwoptions. + * @member {Array.} fdwoptions + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.fdwoptions = $util.emptyArray; + + /** + * ColumnDef location. + * @member {number} location + * @memberof pg_query.ColumnDef + * @instance + */ + ColumnDef.prototype.location = 0; + + /** + * Creates a new ColumnDef instance using the specified properties. + * @function create + * @memberof pg_query.ColumnDef + * @static + * @param {pg_query.IColumnDef=} [properties] Properties to set + * @returns {pg_query.ColumnDef} ColumnDef instance + */ + ColumnDef.create = function create(properties) { + return new ColumnDef(properties); + }; + + /** + * Encodes the specified ColumnDef message. Does not implicitly {@link pg_query.ColumnDef.verify|verify} messages. + * @function encode + * @memberof pg_query.ColumnDef + * @static + * @param {pg_query.IColumnDef} message ColumnDef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnDef.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.colname != null && Object.hasOwnProperty.call(message, "colname")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.colname); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + $root.pg_query.TypeName.encode(message.typeName, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inhcount != null && Object.hasOwnProperty.call(message, "inhcount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.inhcount); + if (message.is_local != null && Object.hasOwnProperty.call(message, "is_local")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.is_local); + if (message.is_not_null != null && Object.hasOwnProperty.call(message, "is_not_null")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.is_not_null); + if (message.is_from_type != null && Object.hasOwnProperty.call(message, "is_from_type")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.is_from_type); + if (message.storage != null && Object.hasOwnProperty.call(message, "storage")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.storage); + if (message.raw_default != null && Object.hasOwnProperty.call(message, "raw_default")) + $root.pg_query.Node.encode(message.raw_default, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.cooked_default != null && Object.hasOwnProperty.call(message, "cooked_default")) + $root.pg_query.Node.encode(message.cooked_default, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.identity); + if (message.identitySequence != null && Object.hasOwnProperty.call(message, "identitySequence")) + $root.pg_query.RangeVar.encode(message.identitySequence, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.generated != null && Object.hasOwnProperty.call(message, "generated")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.generated); + if (message.collClause != null && Object.hasOwnProperty.call(message, "collClause")) + $root.pg_query.CollateClause.encode(message.collClause, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.collOid != null && Object.hasOwnProperty.call(message, "collOid")) + writer.uint32(/* id 14, wireType 0 =*/112).uint32(message.collOid); + if (message.constraints != null && message.constraints.length) + for (var i = 0; i < message.constraints.length; ++i) + $root.pg_query.Node.encode(message.constraints[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.fdwoptions != null && message.fdwoptions.length) + for (var i = 0; i < message.fdwoptions.length; ++i) + $root.pg_query.Node.encode(message.fdwoptions[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.location); + return writer; + }; + + /** + * Encodes the specified ColumnDef message, length delimited. Does not implicitly {@link pg_query.ColumnDef.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ColumnDef + * @static + * @param {pg_query.IColumnDef} message ColumnDef message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnDef.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnDef message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ColumnDef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ColumnDef} ColumnDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnDef.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ColumnDef(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.colname = reader.string(); + break; + } + case 2: { + message.typeName = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 3: { + message.inhcount = reader.int32(); + break; + } + case 4: { + message.is_local = reader.bool(); + break; + } + case 5: { + message.is_not_null = reader.bool(); + break; + } + case 6: { + message.is_from_type = reader.bool(); + break; + } + case 7: { + message.storage = reader.string(); + break; + } + case 8: { + message.raw_default = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 9: { + message.cooked_default = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 10: { + message.identity = reader.string(); + break; + } + case 11: { + message.identitySequence = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 12: { + message.generated = reader.string(); + break; + } + case 13: { + message.collClause = $root.pg_query.CollateClause.decode(reader, reader.uint32()); + break; + } + case 14: { + message.collOid = reader.uint32(); + break; + } + case 15: { + if (!(message.constraints && message.constraints.length)) + message.constraints = []; + message.constraints.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 16: { + if (!(message.fdwoptions && message.fdwoptions.length)) + message.fdwoptions = []; + message.fdwoptions.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 17: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnDef message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ColumnDef + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ColumnDef} ColumnDef + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnDef.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnDef message. + * @function verify + * @memberof pg_query.ColumnDef + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnDef.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.colname != null && message.hasOwnProperty("colname")) + if (!$util.isString(message.colname)) + return "colname: string expected"; + if (message.typeName != null && message.hasOwnProperty("typeName")) { + var error = $root.pg_query.TypeName.verify(message.typeName); + if (error) + return "typeName." + error; + } + if (message.inhcount != null && message.hasOwnProperty("inhcount")) + if (!$util.isInteger(message.inhcount)) + return "inhcount: integer expected"; + if (message.is_local != null && message.hasOwnProperty("is_local")) + if (typeof message.is_local !== "boolean") + return "is_local: boolean expected"; + if (message.is_not_null != null && message.hasOwnProperty("is_not_null")) + if (typeof message.is_not_null !== "boolean") + return "is_not_null: boolean expected"; + if (message.is_from_type != null && message.hasOwnProperty("is_from_type")) + if (typeof message.is_from_type !== "boolean") + return "is_from_type: boolean expected"; + if (message.storage != null && message.hasOwnProperty("storage")) + if (!$util.isString(message.storage)) + return "storage: string expected"; + if (message.raw_default != null && message.hasOwnProperty("raw_default")) { + var error = $root.pg_query.Node.verify(message.raw_default); + if (error) + return "raw_default." + error; + } + if (message.cooked_default != null && message.hasOwnProperty("cooked_default")) { + var error = $root.pg_query.Node.verify(message.cooked_default); + if (error) + return "cooked_default." + error; + } + if (message.identity != null && message.hasOwnProperty("identity")) + if (!$util.isString(message.identity)) + return "identity: string expected"; + if (message.identitySequence != null && message.hasOwnProperty("identitySequence")) { + var error = $root.pg_query.RangeVar.verify(message.identitySequence); + if (error) + return "identitySequence." + error; + } + if (message.generated != null && message.hasOwnProperty("generated")) + if (!$util.isString(message.generated)) + return "generated: string expected"; + if (message.collClause != null && message.hasOwnProperty("collClause")) { + var error = $root.pg_query.CollateClause.verify(message.collClause); + if (error) + return "collClause." + error; + } + if (message.collOid != null && message.hasOwnProperty("collOid")) + if (!$util.isInteger(message.collOid)) + return "collOid: integer expected"; + if (message.constraints != null && message.hasOwnProperty("constraints")) { + if (!Array.isArray(message.constraints)) + return "constraints: array expected"; + for (var i = 0; i < message.constraints.length; ++i) { + var error = $root.pg_query.Node.verify(message.constraints[i]); + if (error) + return "constraints." + error; + } + } + if (message.fdwoptions != null && message.hasOwnProperty("fdwoptions")) { + if (!Array.isArray(message.fdwoptions)) + return "fdwoptions: array expected"; + for (var i = 0; i < message.fdwoptions.length; ++i) { + var error = $root.pg_query.Node.verify(message.fdwoptions[i]); + if (error) + return "fdwoptions." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a ColumnDef message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ColumnDef + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ColumnDef} ColumnDef + */ + ColumnDef.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ColumnDef) + return object; + var message = new $root.pg_query.ColumnDef(); + if (object.colname != null) + message.colname = String(object.colname); + if (object.typeName != null) { + if (typeof object.typeName !== "object") + throw TypeError(".pg_query.ColumnDef.typeName: object expected"); + message.typeName = $root.pg_query.TypeName.fromObject(object.typeName); + } + if (object.inhcount != null) + message.inhcount = object.inhcount | 0; + if (object.is_local != null) + message.is_local = Boolean(object.is_local); + if (object.is_not_null != null) + message.is_not_null = Boolean(object.is_not_null); + if (object.is_from_type != null) + message.is_from_type = Boolean(object.is_from_type); + if (object.storage != null) + message.storage = String(object.storage); + if (object.raw_default != null) { + if (typeof object.raw_default !== "object") + throw TypeError(".pg_query.ColumnDef.raw_default: object expected"); + message.raw_default = $root.pg_query.Node.fromObject(object.raw_default); + } + if (object.cooked_default != null) { + if (typeof object.cooked_default !== "object") + throw TypeError(".pg_query.ColumnDef.cooked_default: object expected"); + message.cooked_default = $root.pg_query.Node.fromObject(object.cooked_default); + } + if (object.identity != null) + message.identity = String(object.identity); + if (object.identitySequence != null) { + if (typeof object.identitySequence !== "object") + throw TypeError(".pg_query.ColumnDef.identitySequence: object expected"); + message.identitySequence = $root.pg_query.RangeVar.fromObject(object.identitySequence); + } + if (object.generated != null) + message.generated = String(object.generated); + if (object.collClause != null) { + if (typeof object.collClause !== "object") + throw TypeError(".pg_query.ColumnDef.collClause: object expected"); + message.collClause = $root.pg_query.CollateClause.fromObject(object.collClause); + } + if (object.collOid != null) + message.collOid = object.collOid >>> 0; + if (object.constraints) { + if (!Array.isArray(object.constraints)) + throw TypeError(".pg_query.ColumnDef.constraints: array expected"); + message.constraints = []; + for (var i = 0; i < object.constraints.length; ++i) { + if (typeof object.constraints[i] !== "object") + throw TypeError(".pg_query.ColumnDef.constraints: object expected"); + message.constraints[i] = $root.pg_query.Node.fromObject(object.constraints[i]); + } + } + if (object.fdwoptions) { + if (!Array.isArray(object.fdwoptions)) + throw TypeError(".pg_query.ColumnDef.fdwoptions: array expected"); + message.fdwoptions = []; + for (var i = 0; i < object.fdwoptions.length; ++i) { + if (typeof object.fdwoptions[i] !== "object") + throw TypeError(".pg_query.ColumnDef.fdwoptions: object expected"); + message.fdwoptions[i] = $root.pg_query.Node.fromObject(object.fdwoptions[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a ColumnDef message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ColumnDef + * @static + * @param {pg_query.ColumnDef} message ColumnDef + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnDef.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.constraints = []; + object.fdwoptions = []; + } + if (options.defaults) { + object.colname = ""; + object.typeName = null; + object.inhcount = 0; + object.is_local = false; + object.is_not_null = false; + object.is_from_type = false; + object.storage = ""; + object.raw_default = null; + object.cooked_default = null; + object.identity = ""; + object.identitySequence = null; + object.generated = ""; + object.collClause = null; + object.collOid = 0; + object.location = 0; + } + if (message.colname != null && message.hasOwnProperty("colname")) + object.colname = message.colname; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = $root.pg_query.TypeName.toObject(message.typeName, options); + if (message.inhcount != null && message.hasOwnProperty("inhcount")) + object.inhcount = message.inhcount; + if (message.is_local != null && message.hasOwnProperty("is_local")) + object.is_local = message.is_local; + if (message.is_not_null != null && message.hasOwnProperty("is_not_null")) + object.is_not_null = message.is_not_null; + if (message.is_from_type != null && message.hasOwnProperty("is_from_type")) + object.is_from_type = message.is_from_type; + if (message.storage != null && message.hasOwnProperty("storage")) + object.storage = message.storage; + if (message.raw_default != null && message.hasOwnProperty("raw_default")) + object.raw_default = $root.pg_query.Node.toObject(message.raw_default, options); + if (message.cooked_default != null && message.hasOwnProperty("cooked_default")) + object.cooked_default = $root.pg_query.Node.toObject(message.cooked_default, options); + if (message.identity != null && message.hasOwnProperty("identity")) + object.identity = message.identity; + if (message.identitySequence != null && message.hasOwnProperty("identitySequence")) + object.identitySequence = $root.pg_query.RangeVar.toObject(message.identitySequence, options); + if (message.generated != null && message.hasOwnProperty("generated")) + object.generated = message.generated; + if (message.collClause != null && message.hasOwnProperty("collClause")) + object.collClause = $root.pg_query.CollateClause.toObject(message.collClause, options); + if (message.collOid != null && message.hasOwnProperty("collOid")) + object.collOid = message.collOid; + if (message.constraints && message.constraints.length) { + object.constraints = []; + for (var j = 0; j < message.constraints.length; ++j) + object.constraints[j] = $root.pg_query.Node.toObject(message.constraints[j], options); + } + if (message.fdwoptions && message.fdwoptions.length) { + object.fdwoptions = []; + for (var j = 0; j < message.fdwoptions.length; ++j) + object.fdwoptions[j] = $root.pg_query.Node.toObject(message.fdwoptions[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this ColumnDef to JSON. + * @function toJSON + * @memberof pg_query.ColumnDef + * @instance + * @returns {Object.} JSON object + */ + ColumnDef.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ColumnDef + * @function getTypeUrl + * @memberof pg_query.ColumnDef + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ColumnDef.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ColumnDef"; + }; + + return ColumnDef; + })(); + + pg_query.IndexElem = (function() { + + /** + * Properties of an IndexElem. + * @memberof pg_query + * @interface IIndexElem + * @property {string|null} [name] IndexElem name + * @property {pg_query.INode|null} [expr] IndexElem expr + * @property {string|null} [indexcolname] IndexElem indexcolname + * @property {Array.|null} [collation] IndexElem collation + * @property {Array.|null} [opclass] IndexElem opclass + * @property {Array.|null} [opclassopts] IndexElem opclassopts + * @property {pg_query.SortByDir|null} [ordering] IndexElem ordering + * @property {pg_query.SortByNulls|null} [nulls_ordering] IndexElem nulls_ordering + */ + + /** + * Constructs a new IndexElem. + * @memberof pg_query + * @classdesc Represents an IndexElem. + * @implements IIndexElem + * @constructor + * @param {pg_query.IIndexElem=} [properties] Properties to set + */ + function IndexElem(properties) { + this.collation = []; + this.opclass = []; + this.opclassopts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndexElem name. + * @member {string} name + * @memberof pg_query.IndexElem + * @instance + */ + IndexElem.prototype.name = ""; + + /** + * IndexElem expr. + * @member {pg_query.INode|null|undefined} expr + * @memberof pg_query.IndexElem + * @instance + */ + IndexElem.prototype.expr = null; + + /** + * IndexElem indexcolname. + * @member {string} indexcolname + * @memberof pg_query.IndexElem + * @instance + */ + IndexElem.prototype.indexcolname = ""; + + /** + * IndexElem collation. + * @member {Array.} collation + * @memberof pg_query.IndexElem + * @instance + */ + IndexElem.prototype.collation = $util.emptyArray; + + /** + * IndexElem opclass. + * @member {Array.} opclass + * @memberof pg_query.IndexElem + * @instance + */ + IndexElem.prototype.opclass = $util.emptyArray; + + /** + * IndexElem opclassopts. + * @member {Array.} opclassopts + * @memberof pg_query.IndexElem + * @instance + */ + IndexElem.prototype.opclassopts = $util.emptyArray; + + /** + * IndexElem ordering. + * @member {pg_query.SortByDir} ordering + * @memberof pg_query.IndexElem + * @instance + */ + IndexElem.prototype.ordering = 0; + + /** + * IndexElem nulls_ordering. + * @member {pg_query.SortByNulls} nulls_ordering + * @memberof pg_query.IndexElem + * @instance + */ + IndexElem.prototype.nulls_ordering = 0; + + /** + * Creates a new IndexElem instance using the specified properties. + * @function create + * @memberof pg_query.IndexElem + * @static + * @param {pg_query.IIndexElem=} [properties] Properties to set + * @returns {pg_query.IndexElem} IndexElem instance + */ + IndexElem.create = function create(properties) { + return new IndexElem(properties); + }; + + /** + * Encodes the specified IndexElem message. Does not implicitly {@link pg_query.IndexElem.verify|verify} messages. + * @function encode + * @memberof pg_query.IndexElem + * @static + * @param {pg_query.IIndexElem} message IndexElem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexElem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.expr != null && Object.hasOwnProperty.call(message, "expr")) + $root.pg_query.Node.encode(message.expr, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.indexcolname != null && Object.hasOwnProperty.call(message, "indexcolname")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexcolname); + if (message.collation != null && message.collation.length) + for (var i = 0; i < message.collation.length; ++i) + $root.pg_query.Node.encode(message.collation[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.opclass != null && message.opclass.length) + for (var i = 0; i < message.opclass.length; ++i) + $root.pg_query.Node.encode(message.opclass[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.opclassopts != null && message.opclassopts.length) + for (var i = 0; i < message.opclassopts.length; ++i) + $root.pg_query.Node.encode(message.opclassopts[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ordering != null && Object.hasOwnProperty.call(message, "ordering")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.ordering); + if (message.nulls_ordering != null && Object.hasOwnProperty.call(message, "nulls_ordering")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.nulls_ordering); + return writer; + }; + + /** + * Encodes the specified IndexElem message, length delimited. Does not implicitly {@link pg_query.IndexElem.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.IndexElem + * @static + * @param {pg_query.IIndexElem} message IndexElem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexElem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IndexElem message from the specified reader or buffer. + * @function decode + * @memberof pg_query.IndexElem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.IndexElem} IndexElem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexElem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.IndexElem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.expr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.indexcolname = reader.string(); + break; + } + case 4: { + if (!(message.collation && message.collation.length)) + message.collation = []; + message.collation.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.opclass && message.opclass.length)) + message.opclass = []; + message.opclass.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.opclassopts && message.opclassopts.length)) + message.opclassopts = []; + message.opclassopts.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + message.ordering = reader.int32(); + break; + } + case 8: { + message.nulls_ordering = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IndexElem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.IndexElem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.IndexElem} IndexElem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexElem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IndexElem message. + * @function verify + * @memberof pg_query.IndexElem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndexElem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.expr != null && message.hasOwnProperty("expr")) { + var error = $root.pg_query.Node.verify(message.expr); + if (error) + return "expr." + error; + } + if (message.indexcolname != null && message.hasOwnProperty("indexcolname")) + if (!$util.isString(message.indexcolname)) + return "indexcolname: string expected"; + if (message.collation != null && message.hasOwnProperty("collation")) { + if (!Array.isArray(message.collation)) + return "collation: array expected"; + for (var i = 0; i < message.collation.length; ++i) { + var error = $root.pg_query.Node.verify(message.collation[i]); + if (error) + return "collation." + error; + } + } + if (message.opclass != null && message.hasOwnProperty("opclass")) { + if (!Array.isArray(message.opclass)) + return "opclass: array expected"; + for (var i = 0; i < message.opclass.length; ++i) { + var error = $root.pg_query.Node.verify(message.opclass[i]); + if (error) + return "opclass." + error; + } + } + if (message.opclassopts != null && message.hasOwnProperty("opclassopts")) { + if (!Array.isArray(message.opclassopts)) + return "opclassopts: array expected"; + for (var i = 0; i < message.opclassopts.length; ++i) { + var error = $root.pg_query.Node.verify(message.opclassopts[i]); + if (error) + return "opclassopts." + error; + } + } + if (message.ordering != null && message.hasOwnProperty("ordering")) + switch (message.ordering) { + default: + return "ordering: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.nulls_ordering != null && message.hasOwnProperty("nulls_ordering")) + switch (message.nulls_ordering) { + default: + return "nulls_ordering: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an IndexElem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.IndexElem + * @static + * @param {Object.} object Plain object + * @returns {pg_query.IndexElem} IndexElem + */ + IndexElem.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.IndexElem) + return object; + var message = new $root.pg_query.IndexElem(); + if (object.name != null) + message.name = String(object.name); + if (object.expr != null) { + if (typeof object.expr !== "object") + throw TypeError(".pg_query.IndexElem.expr: object expected"); + message.expr = $root.pg_query.Node.fromObject(object.expr); + } + if (object.indexcolname != null) + message.indexcolname = String(object.indexcolname); + if (object.collation) { + if (!Array.isArray(object.collation)) + throw TypeError(".pg_query.IndexElem.collation: array expected"); + message.collation = []; + for (var i = 0; i < object.collation.length; ++i) { + if (typeof object.collation[i] !== "object") + throw TypeError(".pg_query.IndexElem.collation: object expected"); + message.collation[i] = $root.pg_query.Node.fromObject(object.collation[i]); + } + } + if (object.opclass) { + if (!Array.isArray(object.opclass)) + throw TypeError(".pg_query.IndexElem.opclass: array expected"); + message.opclass = []; + for (var i = 0; i < object.opclass.length; ++i) { + if (typeof object.opclass[i] !== "object") + throw TypeError(".pg_query.IndexElem.opclass: object expected"); + message.opclass[i] = $root.pg_query.Node.fromObject(object.opclass[i]); + } + } + if (object.opclassopts) { + if (!Array.isArray(object.opclassopts)) + throw TypeError(".pg_query.IndexElem.opclassopts: array expected"); + message.opclassopts = []; + for (var i = 0; i < object.opclassopts.length; ++i) { + if (typeof object.opclassopts[i] !== "object") + throw TypeError(".pg_query.IndexElem.opclassopts: object expected"); + message.opclassopts[i] = $root.pg_query.Node.fromObject(object.opclassopts[i]); + } + } + switch (object.ordering) { + default: + if (typeof object.ordering === "number") { + message.ordering = object.ordering; + break; + } + break; + case "SORT_BY_DIR_UNDEFINED": + case 0: + message.ordering = 0; + break; + case "SORTBY_DEFAULT": + case 1: + message.ordering = 1; + break; + case "SORTBY_ASC": + case 2: + message.ordering = 2; + break; + case "SORTBY_DESC": + case 3: + message.ordering = 3; + break; + case "SORTBY_USING": + case 4: + message.ordering = 4; + break; + } + switch (object.nulls_ordering) { + default: + if (typeof object.nulls_ordering === "number") { + message.nulls_ordering = object.nulls_ordering; + break; + } + break; + case "SORT_BY_NULLS_UNDEFINED": + case 0: + message.nulls_ordering = 0; + break; + case "SORTBY_NULLS_DEFAULT": + case 1: + message.nulls_ordering = 1; + break; + case "SORTBY_NULLS_FIRST": + case 2: + message.nulls_ordering = 2; + break; + case "SORTBY_NULLS_LAST": + case 3: + message.nulls_ordering = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an IndexElem message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.IndexElem + * @static + * @param {pg_query.IndexElem} message IndexElem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexElem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.collation = []; + object.opclass = []; + object.opclassopts = []; + } + if (options.defaults) { + object.name = ""; + object.expr = null; + object.indexcolname = ""; + object.ordering = options.enums === String ? "SORT_BY_DIR_UNDEFINED" : 0; + object.nulls_ordering = options.enums === String ? "SORT_BY_NULLS_UNDEFINED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.expr != null && message.hasOwnProperty("expr")) + object.expr = $root.pg_query.Node.toObject(message.expr, options); + if (message.indexcolname != null && message.hasOwnProperty("indexcolname")) + object.indexcolname = message.indexcolname; + if (message.collation && message.collation.length) { + object.collation = []; + for (var j = 0; j < message.collation.length; ++j) + object.collation[j] = $root.pg_query.Node.toObject(message.collation[j], options); + } + if (message.opclass && message.opclass.length) { + object.opclass = []; + for (var j = 0; j < message.opclass.length; ++j) + object.opclass[j] = $root.pg_query.Node.toObject(message.opclass[j], options); + } + if (message.opclassopts && message.opclassopts.length) { + object.opclassopts = []; + for (var j = 0; j < message.opclassopts.length; ++j) + object.opclassopts[j] = $root.pg_query.Node.toObject(message.opclassopts[j], options); + } + if (message.ordering != null && message.hasOwnProperty("ordering")) + object.ordering = options.enums === String ? $root.pg_query.SortByDir[message.ordering] === undefined ? message.ordering : $root.pg_query.SortByDir[message.ordering] : message.ordering; + if (message.nulls_ordering != null && message.hasOwnProperty("nulls_ordering")) + object.nulls_ordering = options.enums === String ? $root.pg_query.SortByNulls[message.nulls_ordering] === undefined ? message.nulls_ordering : $root.pg_query.SortByNulls[message.nulls_ordering] : message.nulls_ordering; + return object; + }; + + /** + * Converts this IndexElem to JSON. + * @function toJSON + * @memberof pg_query.IndexElem + * @instance + * @returns {Object.} JSON object + */ + IndexElem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndexElem + * @function getTypeUrl + * @memberof pg_query.IndexElem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndexElem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.IndexElem"; + }; + + return IndexElem; + })(); + + pg_query.Constraint = (function() { + + /** + * Properties of a Constraint. + * @memberof pg_query + * @interface IConstraint + * @property {pg_query.ConstrType|null} [contype] Constraint contype + * @property {string|null} [conname] Constraint conname + * @property {boolean|null} [deferrable] Constraint deferrable + * @property {boolean|null} [initdeferred] Constraint initdeferred + * @property {number|null} [location] Constraint location + * @property {boolean|null} [is_no_inherit] Constraint is_no_inherit + * @property {pg_query.INode|null} [raw_expr] Constraint raw_expr + * @property {string|null} [cooked_expr] Constraint cooked_expr + * @property {string|null} [generated_when] Constraint generated_when + * @property {Array.|null} [keys] Constraint keys + * @property {Array.|null} [including] Constraint including + * @property {Array.|null} [exclusions] Constraint exclusions + * @property {Array.|null} [options] Constraint options + * @property {string|null} [indexname] Constraint indexname + * @property {string|null} [indexspace] Constraint indexspace + * @property {boolean|null} [reset_default_tblspc] Constraint reset_default_tblspc + * @property {string|null} [access_method] Constraint access_method + * @property {pg_query.INode|null} [where_clause] Constraint where_clause + * @property {pg_query.IRangeVar|null} [pktable] Constraint pktable + * @property {Array.|null} [fk_attrs] Constraint fk_attrs + * @property {Array.|null} [pk_attrs] Constraint pk_attrs + * @property {string|null} [fk_matchtype] Constraint fk_matchtype + * @property {string|null} [fk_upd_action] Constraint fk_upd_action + * @property {string|null} [fk_del_action] Constraint fk_del_action + * @property {Array.|null} [old_conpfeqop] Constraint old_conpfeqop + * @property {number|null} [old_pktable_oid] Constraint old_pktable_oid + * @property {boolean|null} [skip_validation] Constraint skip_validation + * @property {boolean|null} [initially_valid] Constraint initially_valid + */ + + /** + * Constructs a new Constraint. + * @memberof pg_query + * @classdesc Represents a Constraint. + * @implements IConstraint + * @constructor + * @param {pg_query.IConstraint=} [properties] Properties to set + */ + function Constraint(properties) { + this.keys = []; + this.including = []; + this.exclusions = []; + this.options = []; + this.fk_attrs = []; + this.pk_attrs = []; + this.old_conpfeqop = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Constraint contype. + * @member {pg_query.ConstrType} contype + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.contype = 0; + + /** + * Constraint conname. + * @member {string} conname + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.conname = ""; + + /** + * Constraint deferrable. + * @member {boolean} deferrable + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.deferrable = false; + + /** + * Constraint initdeferred. + * @member {boolean} initdeferred + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.initdeferred = false; + + /** + * Constraint location. + * @member {number} location + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.location = 0; + + /** + * Constraint is_no_inherit. + * @member {boolean} is_no_inherit + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.is_no_inherit = false; + + /** + * Constraint raw_expr. + * @member {pg_query.INode|null|undefined} raw_expr + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.raw_expr = null; + + /** + * Constraint cooked_expr. + * @member {string} cooked_expr + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.cooked_expr = ""; + + /** + * Constraint generated_when. + * @member {string} generated_when + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.generated_when = ""; + + /** + * Constraint keys. + * @member {Array.} keys + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.keys = $util.emptyArray; + + /** + * Constraint including. + * @member {Array.} including + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.including = $util.emptyArray; + + /** + * Constraint exclusions. + * @member {Array.} exclusions + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.exclusions = $util.emptyArray; + + /** + * Constraint options. + * @member {Array.} options + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.options = $util.emptyArray; + + /** + * Constraint indexname. + * @member {string} indexname + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.indexname = ""; + + /** + * Constraint indexspace. + * @member {string} indexspace + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.indexspace = ""; + + /** + * Constraint reset_default_tblspc. + * @member {boolean} reset_default_tblspc + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.reset_default_tblspc = false; + + /** + * Constraint access_method. + * @member {string} access_method + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.access_method = ""; + + /** + * Constraint where_clause. + * @member {pg_query.INode|null|undefined} where_clause + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.where_clause = null; + + /** + * Constraint pktable. + * @member {pg_query.IRangeVar|null|undefined} pktable + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.pktable = null; + + /** + * Constraint fk_attrs. + * @member {Array.} fk_attrs + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.fk_attrs = $util.emptyArray; + + /** + * Constraint pk_attrs. + * @member {Array.} pk_attrs + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.pk_attrs = $util.emptyArray; + + /** + * Constraint fk_matchtype. + * @member {string} fk_matchtype + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.fk_matchtype = ""; + + /** + * Constraint fk_upd_action. + * @member {string} fk_upd_action + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.fk_upd_action = ""; + + /** + * Constraint fk_del_action. + * @member {string} fk_del_action + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.fk_del_action = ""; + + /** + * Constraint old_conpfeqop. + * @member {Array.} old_conpfeqop + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.old_conpfeqop = $util.emptyArray; + + /** + * Constraint old_pktable_oid. + * @member {number} old_pktable_oid + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.old_pktable_oid = 0; + + /** + * Constraint skip_validation. + * @member {boolean} skip_validation + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.skip_validation = false; + + /** + * Constraint initially_valid. + * @member {boolean} initially_valid + * @memberof pg_query.Constraint + * @instance + */ + Constraint.prototype.initially_valid = false; + + /** + * Creates a new Constraint instance using the specified properties. + * @function create + * @memberof pg_query.Constraint + * @static + * @param {pg_query.IConstraint=} [properties] Properties to set + * @returns {pg_query.Constraint} Constraint instance + */ + Constraint.create = function create(properties) { + return new Constraint(properties); + }; + + /** + * Encodes the specified Constraint message. Does not implicitly {@link pg_query.Constraint.verify|verify} messages. + * @function encode + * @memberof pg_query.Constraint + * @static + * @param {pg_query.IConstraint} message Constraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Constraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contype != null && Object.hasOwnProperty.call(message, "contype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.contype); + if (message.conname != null && Object.hasOwnProperty.call(message, "conname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.conname); + if (message.deferrable != null && Object.hasOwnProperty.call(message, "deferrable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deferrable); + if (message.initdeferred != null && Object.hasOwnProperty.call(message, "initdeferred")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.initdeferred); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + if (message.is_no_inherit != null && Object.hasOwnProperty.call(message, "is_no_inherit")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.is_no_inherit); + if (message.raw_expr != null && Object.hasOwnProperty.call(message, "raw_expr")) + $root.pg_query.Node.encode(message.raw_expr, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cooked_expr != null && Object.hasOwnProperty.call(message, "cooked_expr")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.cooked_expr); + if (message.generated_when != null && Object.hasOwnProperty.call(message, "generated_when")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.generated_when); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.pg_query.Node.encode(message.keys[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.including != null && message.including.length) + for (var i = 0; i < message.including.length; ++i) + $root.pg_query.Node.encode(message.including[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.exclusions != null && message.exclusions.length) + for (var i = 0; i < message.exclusions.length; ++i) + $root.pg_query.Node.encode(message.exclusions[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.pg_query.Node.encode(message.options[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.indexname != null && Object.hasOwnProperty.call(message, "indexname")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.indexname); + if (message.indexspace != null && Object.hasOwnProperty.call(message, "indexspace")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.indexspace); + if (message.reset_default_tblspc != null && Object.hasOwnProperty.call(message, "reset_default_tblspc")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.reset_default_tblspc); + if (message.access_method != null && Object.hasOwnProperty.call(message, "access_method")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.access_method); + if (message.where_clause != null && Object.hasOwnProperty.call(message, "where_clause")) + $root.pg_query.Node.encode(message.where_clause, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.pktable != null && Object.hasOwnProperty.call(message, "pktable")) + $root.pg_query.RangeVar.encode(message.pktable, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.fk_attrs != null && message.fk_attrs.length) + for (var i = 0; i < message.fk_attrs.length; ++i) + $root.pg_query.Node.encode(message.fk_attrs[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.pk_attrs != null && message.pk_attrs.length) + for (var i = 0; i < message.pk_attrs.length; ++i) + $root.pg_query.Node.encode(message.pk_attrs[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.fk_matchtype != null && Object.hasOwnProperty.call(message, "fk_matchtype")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.fk_matchtype); + if (message.fk_upd_action != null && Object.hasOwnProperty.call(message, "fk_upd_action")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.fk_upd_action); + if (message.fk_del_action != null && Object.hasOwnProperty.call(message, "fk_del_action")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.fk_del_action); + if (message.old_conpfeqop != null && message.old_conpfeqop.length) + for (var i = 0; i < message.old_conpfeqop.length; ++i) + $root.pg_query.Node.encode(message.old_conpfeqop[i], writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.old_pktable_oid != null && Object.hasOwnProperty.call(message, "old_pktable_oid")) + writer.uint32(/* id 26, wireType 0 =*/208).uint32(message.old_pktable_oid); + if (message.skip_validation != null && Object.hasOwnProperty.call(message, "skip_validation")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.skip_validation); + if (message.initially_valid != null && Object.hasOwnProperty.call(message, "initially_valid")) + writer.uint32(/* id 28, wireType 0 =*/224).bool(message.initially_valid); + return writer; + }; + + /** + * Encodes the specified Constraint message, length delimited. Does not implicitly {@link pg_query.Constraint.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.Constraint + * @static + * @param {pg_query.IConstraint} message Constraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Constraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Constraint message from the specified reader or buffer. + * @function decode + * @memberof pg_query.Constraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.Constraint} Constraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Constraint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.Constraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.contype = reader.int32(); + break; + } + case 2: { + message.conname = reader.string(); + break; + } + case 3: { + message.deferrable = reader.bool(); + break; + } + case 4: { + message.initdeferred = reader.bool(); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + case 6: { + message.is_no_inherit = reader.bool(); + break; + } + case 7: { + message.raw_expr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 8: { + message.cooked_expr = reader.string(); + break; + } + case 9: { + message.generated_when = reader.string(); + break; + } + case 10: { + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message.including && message.including.length)) + message.including = []; + message.including.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 12: { + if (!(message.exclusions && message.exclusions.length)) + message.exclusions = []; + message.exclusions.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 13: { + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 14: { + message.indexname = reader.string(); + break; + } + case 15: { + message.indexspace = reader.string(); + break; + } + case 16: { + message.reset_default_tblspc = reader.bool(); + break; + } + case 17: { + message.access_method = reader.string(); + break; + } + case 18: { + message.where_clause = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 19: { + message.pktable = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 20: { + if (!(message.fk_attrs && message.fk_attrs.length)) + message.fk_attrs = []; + message.fk_attrs.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 21: { + if (!(message.pk_attrs && message.pk_attrs.length)) + message.pk_attrs = []; + message.pk_attrs.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 22: { + message.fk_matchtype = reader.string(); + break; + } + case 23: { + message.fk_upd_action = reader.string(); + break; + } + case 24: { + message.fk_del_action = reader.string(); + break; + } + case 25: { + if (!(message.old_conpfeqop && message.old_conpfeqop.length)) + message.old_conpfeqop = []; + message.old_conpfeqop.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 26: { + message.old_pktable_oid = reader.uint32(); + break; + } + case 27: { + message.skip_validation = reader.bool(); + break; + } + case 28: { + message.initially_valid = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Constraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.Constraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.Constraint} Constraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Constraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Constraint message. + * @function verify + * @memberof pg_query.Constraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Constraint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contype != null && message.hasOwnProperty("contype")) + switch (message.contype) { + default: + return "contype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + break; + } + if (message.conname != null && message.hasOwnProperty("conname")) + if (!$util.isString(message.conname)) + return "conname: string expected"; + if (message.deferrable != null && message.hasOwnProperty("deferrable")) + if (typeof message.deferrable !== "boolean") + return "deferrable: boolean expected"; + if (message.initdeferred != null && message.hasOwnProperty("initdeferred")) + if (typeof message.initdeferred !== "boolean") + return "initdeferred: boolean expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + if (message.is_no_inherit != null && message.hasOwnProperty("is_no_inherit")) + if (typeof message.is_no_inherit !== "boolean") + return "is_no_inherit: boolean expected"; + if (message.raw_expr != null && message.hasOwnProperty("raw_expr")) { + var error = $root.pg_query.Node.verify(message.raw_expr); + if (error) + return "raw_expr." + error; + } + if (message.cooked_expr != null && message.hasOwnProperty("cooked_expr")) + if (!$util.isString(message.cooked_expr)) + return "cooked_expr: string expected"; + if (message.generated_when != null && message.hasOwnProperty("generated_when")) + if (!$util.isString(message.generated_when)) + return "generated_when: string expected"; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.pg_query.Node.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + if (message.including != null && message.hasOwnProperty("including")) { + if (!Array.isArray(message.including)) + return "including: array expected"; + for (var i = 0; i < message.including.length; ++i) { + var error = $root.pg_query.Node.verify(message.including[i]); + if (error) + return "including." + error; + } + } + if (message.exclusions != null && message.hasOwnProperty("exclusions")) { + if (!Array.isArray(message.exclusions)) + return "exclusions: array expected"; + for (var i = 0; i < message.exclusions.length; ++i) { + var error = $root.pg_query.Node.verify(message.exclusions[i]); + if (error) + return "exclusions." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.pg_query.Node.verify(message.options[i]); + if (error) + return "options." + error; + } + } + if (message.indexname != null && message.hasOwnProperty("indexname")) + if (!$util.isString(message.indexname)) + return "indexname: string expected"; + if (message.indexspace != null && message.hasOwnProperty("indexspace")) + if (!$util.isString(message.indexspace)) + return "indexspace: string expected"; + if (message.reset_default_tblspc != null && message.hasOwnProperty("reset_default_tblspc")) + if (typeof message.reset_default_tblspc !== "boolean") + return "reset_default_tblspc: boolean expected"; + if (message.access_method != null && message.hasOwnProperty("access_method")) + if (!$util.isString(message.access_method)) + return "access_method: string expected"; + if (message.where_clause != null && message.hasOwnProperty("where_clause")) { + var error = $root.pg_query.Node.verify(message.where_clause); + if (error) + return "where_clause." + error; + } + if (message.pktable != null && message.hasOwnProperty("pktable")) { + var error = $root.pg_query.RangeVar.verify(message.pktable); + if (error) + return "pktable." + error; + } + if (message.fk_attrs != null && message.hasOwnProperty("fk_attrs")) { + if (!Array.isArray(message.fk_attrs)) + return "fk_attrs: array expected"; + for (var i = 0; i < message.fk_attrs.length; ++i) { + var error = $root.pg_query.Node.verify(message.fk_attrs[i]); + if (error) + return "fk_attrs." + error; + } + } + if (message.pk_attrs != null && message.hasOwnProperty("pk_attrs")) { + if (!Array.isArray(message.pk_attrs)) + return "pk_attrs: array expected"; + for (var i = 0; i < message.pk_attrs.length; ++i) { + var error = $root.pg_query.Node.verify(message.pk_attrs[i]); + if (error) + return "pk_attrs." + error; + } + } + if (message.fk_matchtype != null && message.hasOwnProperty("fk_matchtype")) + if (!$util.isString(message.fk_matchtype)) + return "fk_matchtype: string expected"; + if (message.fk_upd_action != null && message.hasOwnProperty("fk_upd_action")) + if (!$util.isString(message.fk_upd_action)) + return "fk_upd_action: string expected"; + if (message.fk_del_action != null && message.hasOwnProperty("fk_del_action")) + if (!$util.isString(message.fk_del_action)) + return "fk_del_action: string expected"; + if (message.old_conpfeqop != null && message.hasOwnProperty("old_conpfeqop")) { + if (!Array.isArray(message.old_conpfeqop)) + return "old_conpfeqop: array expected"; + for (var i = 0; i < message.old_conpfeqop.length; ++i) { + var error = $root.pg_query.Node.verify(message.old_conpfeqop[i]); + if (error) + return "old_conpfeqop." + error; + } + } + if (message.old_pktable_oid != null && message.hasOwnProperty("old_pktable_oid")) + if (!$util.isInteger(message.old_pktable_oid)) + return "old_pktable_oid: integer expected"; + if (message.skip_validation != null && message.hasOwnProperty("skip_validation")) + if (typeof message.skip_validation !== "boolean") + return "skip_validation: boolean expected"; + if (message.initially_valid != null && message.hasOwnProperty("initially_valid")) + if (typeof message.initially_valid !== "boolean") + return "initially_valid: boolean expected"; + return null; + }; + + /** + * Creates a Constraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.Constraint + * @static + * @param {Object.} object Plain object + * @returns {pg_query.Constraint} Constraint + */ + Constraint.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.Constraint) + return object; + var message = new $root.pg_query.Constraint(); + switch (object.contype) { + default: + if (typeof object.contype === "number") { + message.contype = object.contype; + break; + } + break; + case "CONSTR_TYPE_UNDEFINED": + case 0: + message.contype = 0; + break; + case "CONSTR_NULL": + case 1: + message.contype = 1; + break; + case "CONSTR_NOTNULL": + case 2: + message.contype = 2; + break; + case "CONSTR_DEFAULT": + case 3: + message.contype = 3; + break; + case "CONSTR_IDENTITY": + case 4: + message.contype = 4; + break; + case "CONSTR_GENERATED": + case 5: + message.contype = 5; + break; + case "CONSTR_CHECK": + case 6: + message.contype = 6; + break; + case "CONSTR_PRIMARY": + case 7: + message.contype = 7; + break; + case "CONSTR_UNIQUE": + case 8: + message.contype = 8; + break; + case "CONSTR_EXCLUSION": + case 9: + message.contype = 9; + break; + case "CONSTR_FOREIGN": + case 10: + message.contype = 10; + break; + case "CONSTR_ATTR_DEFERRABLE": + case 11: + message.contype = 11; + break; + case "CONSTR_ATTR_NOT_DEFERRABLE": + case 12: + message.contype = 12; + break; + case "CONSTR_ATTR_DEFERRED": + case 13: + message.contype = 13; + break; + case "CONSTR_ATTR_IMMEDIATE": + case 14: + message.contype = 14; + break; + } + if (object.conname != null) + message.conname = String(object.conname); + if (object.deferrable != null) + message.deferrable = Boolean(object.deferrable); + if (object.initdeferred != null) + message.initdeferred = Boolean(object.initdeferred); + if (object.location != null) + message.location = object.location | 0; + if (object.is_no_inherit != null) + message.is_no_inherit = Boolean(object.is_no_inherit); + if (object.raw_expr != null) { + if (typeof object.raw_expr !== "object") + throw TypeError(".pg_query.Constraint.raw_expr: object expected"); + message.raw_expr = $root.pg_query.Node.fromObject(object.raw_expr); + } + if (object.cooked_expr != null) + message.cooked_expr = String(object.cooked_expr); + if (object.generated_when != null) + message.generated_when = String(object.generated_when); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".pg_query.Constraint.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".pg_query.Constraint.keys: object expected"); + message.keys[i] = $root.pg_query.Node.fromObject(object.keys[i]); + } + } + if (object.including) { + if (!Array.isArray(object.including)) + throw TypeError(".pg_query.Constraint.including: array expected"); + message.including = []; + for (var i = 0; i < object.including.length; ++i) { + if (typeof object.including[i] !== "object") + throw TypeError(".pg_query.Constraint.including: object expected"); + message.including[i] = $root.pg_query.Node.fromObject(object.including[i]); + } + } + if (object.exclusions) { + if (!Array.isArray(object.exclusions)) + throw TypeError(".pg_query.Constraint.exclusions: array expected"); + message.exclusions = []; + for (var i = 0; i < object.exclusions.length; ++i) { + if (typeof object.exclusions[i] !== "object") + throw TypeError(".pg_query.Constraint.exclusions: object expected"); + message.exclusions[i] = $root.pg_query.Node.fromObject(object.exclusions[i]); + } + } + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".pg_query.Constraint.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".pg_query.Constraint.options: object expected"); + message.options[i] = $root.pg_query.Node.fromObject(object.options[i]); + } + } + if (object.indexname != null) + message.indexname = String(object.indexname); + if (object.indexspace != null) + message.indexspace = String(object.indexspace); + if (object.reset_default_tblspc != null) + message.reset_default_tblspc = Boolean(object.reset_default_tblspc); + if (object.access_method != null) + message.access_method = String(object.access_method); + if (object.where_clause != null) { + if (typeof object.where_clause !== "object") + throw TypeError(".pg_query.Constraint.where_clause: object expected"); + message.where_clause = $root.pg_query.Node.fromObject(object.where_clause); + } + if (object.pktable != null) { + if (typeof object.pktable !== "object") + throw TypeError(".pg_query.Constraint.pktable: object expected"); + message.pktable = $root.pg_query.RangeVar.fromObject(object.pktable); + } + if (object.fk_attrs) { + if (!Array.isArray(object.fk_attrs)) + throw TypeError(".pg_query.Constraint.fk_attrs: array expected"); + message.fk_attrs = []; + for (var i = 0; i < object.fk_attrs.length; ++i) { + if (typeof object.fk_attrs[i] !== "object") + throw TypeError(".pg_query.Constraint.fk_attrs: object expected"); + message.fk_attrs[i] = $root.pg_query.Node.fromObject(object.fk_attrs[i]); + } + } + if (object.pk_attrs) { + if (!Array.isArray(object.pk_attrs)) + throw TypeError(".pg_query.Constraint.pk_attrs: array expected"); + message.pk_attrs = []; + for (var i = 0; i < object.pk_attrs.length; ++i) { + if (typeof object.pk_attrs[i] !== "object") + throw TypeError(".pg_query.Constraint.pk_attrs: object expected"); + message.pk_attrs[i] = $root.pg_query.Node.fromObject(object.pk_attrs[i]); + } + } + if (object.fk_matchtype != null) + message.fk_matchtype = String(object.fk_matchtype); + if (object.fk_upd_action != null) + message.fk_upd_action = String(object.fk_upd_action); + if (object.fk_del_action != null) + message.fk_del_action = String(object.fk_del_action); + if (object.old_conpfeqop) { + if (!Array.isArray(object.old_conpfeqop)) + throw TypeError(".pg_query.Constraint.old_conpfeqop: array expected"); + message.old_conpfeqop = []; + for (var i = 0; i < object.old_conpfeqop.length; ++i) { + if (typeof object.old_conpfeqop[i] !== "object") + throw TypeError(".pg_query.Constraint.old_conpfeqop: object expected"); + message.old_conpfeqop[i] = $root.pg_query.Node.fromObject(object.old_conpfeqop[i]); + } + } + if (object.old_pktable_oid != null) + message.old_pktable_oid = object.old_pktable_oid >>> 0; + if (object.skip_validation != null) + message.skip_validation = Boolean(object.skip_validation); + if (object.initially_valid != null) + message.initially_valid = Boolean(object.initially_valid); + return message; + }; + + /** + * Creates a plain object from a Constraint message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.Constraint + * @static + * @param {pg_query.Constraint} message Constraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Constraint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.keys = []; + object.including = []; + object.exclusions = []; + object.options = []; + object.fk_attrs = []; + object.pk_attrs = []; + object.old_conpfeqop = []; + } + if (options.defaults) { + object.contype = options.enums === String ? "CONSTR_TYPE_UNDEFINED" : 0; + object.conname = ""; + object.deferrable = false; + object.initdeferred = false; + object.location = 0; + object.is_no_inherit = false; + object.raw_expr = null; + object.cooked_expr = ""; + object.generated_when = ""; + object.indexname = ""; + object.indexspace = ""; + object.reset_default_tblspc = false; + object.access_method = ""; + object.where_clause = null; + object.pktable = null; + object.fk_matchtype = ""; + object.fk_upd_action = ""; + object.fk_del_action = ""; + object.old_pktable_oid = 0; + object.skip_validation = false; + object.initially_valid = false; + } + if (message.contype != null && message.hasOwnProperty("contype")) + object.contype = options.enums === String ? $root.pg_query.ConstrType[message.contype] === undefined ? message.contype : $root.pg_query.ConstrType[message.contype] : message.contype; + if (message.conname != null && message.hasOwnProperty("conname")) + object.conname = message.conname; + if (message.deferrable != null && message.hasOwnProperty("deferrable")) + object.deferrable = message.deferrable; + if (message.initdeferred != null && message.hasOwnProperty("initdeferred")) + object.initdeferred = message.initdeferred; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.is_no_inherit != null && message.hasOwnProperty("is_no_inherit")) + object.is_no_inherit = message.is_no_inherit; + if (message.raw_expr != null && message.hasOwnProperty("raw_expr")) + object.raw_expr = $root.pg_query.Node.toObject(message.raw_expr, options); + if (message.cooked_expr != null && message.hasOwnProperty("cooked_expr")) + object.cooked_expr = message.cooked_expr; + if (message.generated_when != null && message.hasOwnProperty("generated_when")) + object.generated_when = message.generated_when; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.pg_query.Node.toObject(message.keys[j], options); + } + if (message.including && message.including.length) { + object.including = []; + for (var j = 0; j < message.including.length; ++j) + object.including[j] = $root.pg_query.Node.toObject(message.including[j], options); + } + if (message.exclusions && message.exclusions.length) { + object.exclusions = []; + for (var j = 0; j < message.exclusions.length; ++j) + object.exclusions[j] = $root.pg_query.Node.toObject(message.exclusions[j], options); + } + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.pg_query.Node.toObject(message.options[j], options); + } + if (message.indexname != null && message.hasOwnProperty("indexname")) + object.indexname = message.indexname; + if (message.indexspace != null && message.hasOwnProperty("indexspace")) + object.indexspace = message.indexspace; + if (message.reset_default_tblspc != null && message.hasOwnProperty("reset_default_tblspc")) + object.reset_default_tblspc = message.reset_default_tblspc; + if (message.access_method != null && message.hasOwnProperty("access_method")) + object.access_method = message.access_method; + if (message.where_clause != null && message.hasOwnProperty("where_clause")) + object.where_clause = $root.pg_query.Node.toObject(message.where_clause, options); + if (message.pktable != null && message.hasOwnProperty("pktable")) + object.pktable = $root.pg_query.RangeVar.toObject(message.pktable, options); + if (message.fk_attrs && message.fk_attrs.length) { + object.fk_attrs = []; + for (var j = 0; j < message.fk_attrs.length; ++j) + object.fk_attrs[j] = $root.pg_query.Node.toObject(message.fk_attrs[j], options); + } + if (message.pk_attrs && message.pk_attrs.length) { + object.pk_attrs = []; + for (var j = 0; j < message.pk_attrs.length; ++j) + object.pk_attrs[j] = $root.pg_query.Node.toObject(message.pk_attrs[j], options); + } + if (message.fk_matchtype != null && message.hasOwnProperty("fk_matchtype")) + object.fk_matchtype = message.fk_matchtype; + if (message.fk_upd_action != null && message.hasOwnProperty("fk_upd_action")) + object.fk_upd_action = message.fk_upd_action; + if (message.fk_del_action != null && message.hasOwnProperty("fk_del_action")) + object.fk_del_action = message.fk_del_action; + if (message.old_conpfeqop && message.old_conpfeqop.length) { + object.old_conpfeqop = []; + for (var j = 0; j < message.old_conpfeqop.length; ++j) + object.old_conpfeqop[j] = $root.pg_query.Node.toObject(message.old_conpfeqop[j], options); + } + if (message.old_pktable_oid != null && message.hasOwnProperty("old_pktable_oid")) + object.old_pktable_oid = message.old_pktable_oid; + if (message.skip_validation != null && message.hasOwnProperty("skip_validation")) + object.skip_validation = message.skip_validation; + if (message.initially_valid != null && message.hasOwnProperty("initially_valid")) + object.initially_valid = message.initially_valid; + return object; + }; + + /** + * Converts this Constraint to JSON. + * @function toJSON + * @memberof pg_query.Constraint + * @instance + * @returns {Object.} JSON object + */ + Constraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Constraint + * @function getTypeUrl + * @memberof pg_query.Constraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Constraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.Constraint"; + }; + + return Constraint; + })(); + + pg_query.DefElem = (function() { + + /** + * Properties of a DefElem. + * @memberof pg_query + * @interface IDefElem + * @property {string|null} [defnamespace] DefElem defnamespace + * @property {string|null} [defname] DefElem defname + * @property {pg_query.INode|null} [arg] DefElem arg + * @property {pg_query.DefElemAction|null} [defaction] DefElem defaction + * @property {number|null} [location] DefElem location + */ + + /** + * Constructs a new DefElem. + * @memberof pg_query + * @classdesc Represents a DefElem. + * @implements IDefElem + * @constructor + * @param {pg_query.IDefElem=} [properties] Properties to set + */ + function DefElem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DefElem defnamespace. + * @member {string} defnamespace + * @memberof pg_query.DefElem + * @instance + */ + DefElem.prototype.defnamespace = ""; + + /** + * DefElem defname. + * @member {string} defname + * @memberof pg_query.DefElem + * @instance + */ + DefElem.prototype.defname = ""; + + /** + * DefElem arg. + * @member {pg_query.INode|null|undefined} arg + * @memberof pg_query.DefElem + * @instance + */ + DefElem.prototype.arg = null; + + /** + * DefElem defaction. + * @member {pg_query.DefElemAction} defaction + * @memberof pg_query.DefElem + * @instance + */ + DefElem.prototype.defaction = 0; + + /** + * DefElem location. + * @member {number} location + * @memberof pg_query.DefElem + * @instance + */ + DefElem.prototype.location = 0; + + /** + * Creates a new DefElem instance using the specified properties. + * @function create + * @memberof pg_query.DefElem + * @static + * @param {pg_query.IDefElem=} [properties] Properties to set + * @returns {pg_query.DefElem} DefElem instance + */ + DefElem.create = function create(properties) { + return new DefElem(properties); + }; + + /** + * Encodes the specified DefElem message. Does not implicitly {@link pg_query.DefElem.verify|verify} messages. + * @function encode + * @memberof pg_query.DefElem + * @static + * @param {pg_query.IDefElem} message DefElem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefElem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defnamespace != null && Object.hasOwnProperty.call(message, "defnamespace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.defnamespace); + if (message.defname != null && Object.hasOwnProperty.call(message, "defname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.defname); + if (message.arg != null && Object.hasOwnProperty.call(message, "arg")) + $root.pg_query.Node.encode(message.arg, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.defaction != null && Object.hasOwnProperty.call(message, "defaction")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.defaction); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified DefElem message, length delimited. Does not implicitly {@link pg_query.DefElem.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.DefElem + * @static + * @param {pg_query.IDefElem} message DefElem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DefElem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DefElem message from the specified reader or buffer. + * @function decode + * @memberof pg_query.DefElem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.DefElem} DefElem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefElem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.DefElem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.defnamespace = reader.string(); + break; + } + case 2: { + message.defname = reader.string(); + break; + } + case 3: { + message.arg = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 4: { + message.defaction = reader.int32(); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DefElem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.DefElem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.DefElem} DefElem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DefElem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DefElem message. + * @function verify + * @memberof pg_query.DefElem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DefElem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defnamespace != null && message.hasOwnProperty("defnamespace")) + if (!$util.isString(message.defnamespace)) + return "defnamespace: string expected"; + if (message.defname != null && message.hasOwnProperty("defname")) + if (!$util.isString(message.defname)) + return "defname: string expected"; + if (message.arg != null && message.hasOwnProperty("arg")) { + var error = $root.pg_query.Node.verify(message.arg); + if (error) + return "arg." + error; + } + if (message.defaction != null && message.hasOwnProperty("defaction")) + switch (message.defaction) { + default: + return "defaction: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a DefElem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.DefElem + * @static + * @param {Object.} object Plain object + * @returns {pg_query.DefElem} DefElem + */ + DefElem.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.DefElem) + return object; + var message = new $root.pg_query.DefElem(); + if (object.defnamespace != null) + message.defnamespace = String(object.defnamespace); + if (object.defname != null) + message.defname = String(object.defname); + if (object.arg != null) { + if (typeof object.arg !== "object") + throw TypeError(".pg_query.DefElem.arg: object expected"); + message.arg = $root.pg_query.Node.fromObject(object.arg); + } + switch (object.defaction) { + default: + if (typeof object.defaction === "number") { + message.defaction = object.defaction; + break; + } + break; + case "DEF_ELEM_ACTION_UNDEFINED": + case 0: + message.defaction = 0; + break; + case "DEFELEM_UNSPEC": + case 1: + message.defaction = 1; + break; + case "DEFELEM_SET": + case 2: + message.defaction = 2; + break; + case "DEFELEM_ADD": + case 3: + message.defaction = 3; + break; + case "DEFELEM_DROP": + case 4: + message.defaction = 4; + break; + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a DefElem message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.DefElem + * @static + * @param {pg_query.DefElem} message DefElem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DefElem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.defnamespace = ""; + object.defname = ""; + object.arg = null; + object.defaction = options.enums === String ? "DEF_ELEM_ACTION_UNDEFINED" : 0; + object.location = 0; + } + if (message.defnamespace != null && message.hasOwnProperty("defnamespace")) + object.defnamespace = message.defnamespace; + if (message.defname != null && message.hasOwnProperty("defname")) + object.defname = message.defname; + if (message.arg != null && message.hasOwnProperty("arg")) + object.arg = $root.pg_query.Node.toObject(message.arg, options); + if (message.defaction != null && message.hasOwnProperty("defaction")) + object.defaction = options.enums === String ? $root.pg_query.DefElemAction[message.defaction] === undefined ? message.defaction : $root.pg_query.DefElemAction[message.defaction] : message.defaction; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this DefElem to JSON. + * @function toJSON + * @memberof pg_query.DefElem + * @instance + * @returns {Object.} JSON object + */ + DefElem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DefElem + * @function getTypeUrl + * @memberof pg_query.DefElem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DefElem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.DefElem"; + }; + + return DefElem; + })(); + + pg_query.RangeTblEntry = (function() { + + /** + * Properties of a RangeTblEntry. + * @memberof pg_query + * @interface IRangeTblEntry + * @property {pg_query.RTEKind|null} [rtekind] RangeTblEntry rtekind + * @property {number|null} [relid] RangeTblEntry relid + * @property {string|null} [relkind] RangeTblEntry relkind + * @property {number|null} [rellockmode] RangeTblEntry rellockmode + * @property {pg_query.ITableSampleClause|null} [tablesample] RangeTblEntry tablesample + * @property {pg_query.IQuery|null} [subquery] RangeTblEntry subquery + * @property {boolean|null} [security_barrier] RangeTblEntry security_barrier + * @property {pg_query.JoinType|null} [jointype] RangeTblEntry jointype + * @property {number|null} [joinmergedcols] RangeTblEntry joinmergedcols + * @property {Array.|null} [joinaliasvars] RangeTblEntry joinaliasvars + * @property {Array.|null} [joinleftcols] RangeTblEntry joinleftcols + * @property {Array.|null} [joinrightcols] RangeTblEntry joinrightcols + * @property {Array.|null} [functions] RangeTblEntry functions + * @property {boolean|null} [funcordinality] RangeTblEntry funcordinality + * @property {pg_query.ITableFunc|null} [tablefunc] RangeTblEntry tablefunc + * @property {Array.|null} [values_lists] RangeTblEntry values_lists + * @property {string|null} [ctename] RangeTblEntry ctename + * @property {number|null} [ctelevelsup] RangeTblEntry ctelevelsup + * @property {boolean|null} [self_reference] RangeTblEntry self_reference + * @property {Array.|null} [coltypes] RangeTblEntry coltypes + * @property {Array.|null} [coltypmods] RangeTblEntry coltypmods + * @property {Array.|null} [colcollations] RangeTblEntry colcollations + * @property {string|null} [enrname] RangeTblEntry enrname + * @property {number|null} [enrtuples] RangeTblEntry enrtuples + * @property {pg_query.IAlias|null} [alias] RangeTblEntry alias + * @property {pg_query.IAlias|null} [eref] RangeTblEntry eref + * @property {boolean|null} [lateral] RangeTblEntry lateral + * @property {boolean|null} [inh] RangeTblEntry inh + * @property {boolean|null} [inFromCl] RangeTblEntry inFromCl + * @property {number|null} [requiredPerms] RangeTblEntry requiredPerms + * @property {number|null} [checkAsUser] RangeTblEntry checkAsUser + * @property {Array.|null} [selectedCols] RangeTblEntry selectedCols + * @property {Array.|null} [insertedCols] RangeTblEntry insertedCols + * @property {Array.|null} [updatedCols] RangeTblEntry updatedCols + * @property {Array.|null} [extraUpdatedCols] RangeTblEntry extraUpdatedCols + * @property {Array.|null} [securityQuals] RangeTblEntry securityQuals + */ + + /** + * Constructs a new RangeTblEntry. + * @memberof pg_query + * @classdesc Represents a RangeTblEntry. + * @implements IRangeTblEntry + * @constructor + * @param {pg_query.IRangeTblEntry=} [properties] Properties to set + */ + function RangeTblEntry(properties) { + this.joinaliasvars = []; + this.joinleftcols = []; + this.joinrightcols = []; + this.functions = []; + this.values_lists = []; + this.coltypes = []; + this.coltypmods = []; + this.colcollations = []; + this.selectedCols = []; + this.insertedCols = []; + this.updatedCols = []; + this.extraUpdatedCols = []; + this.securityQuals = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RangeTblEntry rtekind. + * @member {pg_query.RTEKind} rtekind + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.rtekind = 0; + + /** + * RangeTblEntry relid. + * @member {number} relid + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.relid = 0; + + /** + * RangeTblEntry relkind. + * @member {string} relkind + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.relkind = ""; + + /** + * RangeTblEntry rellockmode. + * @member {number} rellockmode + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.rellockmode = 0; + + /** + * RangeTblEntry tablesample. + * @member {pg_query.ITableSampleClause|null|undefined} tablesample + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.tablesample = null; + + /** + * RangeTblEntry subquery. + * @member {pg_query.IQuery|null|undefined} subquery + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.subquery = null; + + /** + * RangeTblEntry security_barrier. + * @member {boolean} security_barrier + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.security_barrier = false; + + /** + * RangeTblEntry jointype. + * @member {pg_query.JoinType} jointype + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.jointype = 0; + + /** + * RangeTblEntry joinmergedcols. + * @member {number} joinmergedcols + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.joinmergedcols = 0; + + /** + * RangeTblEntry joinaliasvars. + * @member {Array.} joinaliasvars + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.joinaliasvars = $util.emptyArray; + + /** + * RangeTblEntry joinleftcols. + * @member {Array.} joinleftcols + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.joinleftcols = $util.emptyArray; + + /** + * RangeTblEntry joinrightcols. + * @member {Array.} joinrightcols + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.joinrightcols = $util.emptyArray; + + /** + * RangeTblEntry functions. + * @member {Array.} functions + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.functions = $util.emptyArray; + + /** + * RangeTblEntry funcordinality. + * @member {boolean} funcordinality + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.funcordinality = false; + + /** + * RangeTblEntry tablefunc. + * @member {pg_query.ITableFunc|null|undefined} tablefunc + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.tablefunc = null; + + /** + * RangeTblEntry values_lists. + * @member {Array.} values_lists + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.values_lists = $util.emptyArray; + + /** + * RangeTblEntry ctename. + * @member {string} ctename + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.ctename = ""; + + /** + * RangeTblEntry ctelevelsup. + * @member {number} ctelevelsup + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.ctelevelsup = 0; + + /** + * RangeTblEntry self_reference. + * @member {boolean} self_reference + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.self_reference = false; + + /** + * RangeTblEntry coltypes. + * @member {Array.} coltypes + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.coltypes = $util.emptyArray; + + /** + * RangeTblEntry coltypmods. + * @member {Array.} coltypmods + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.coltypmods = $util.emptyArray; + + /** + * RangeTblEntry colcollations. + * @member {Array.} colcollations + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.colcollations = $util.emptyArray; + + /** + * RangeTblEntry enrname. + * @member {string} enrname + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.enrname = ""; + + /** + * RangeTblEntry enrtuples. + * @member {number} enrtuples + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.enrtuples = 0; + + /** + * RangeTblEntry alias. + * @member {pg_query.IAlias|null|undefined} alias + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.alias = null; + + /** + * RangeTblEntry eref. + * @member {pg_query.IAlias|null|undefined} eref + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.eref = null; + + /** + * RangeTblEntry lateral. + * @member {boolean} lateral + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.lateral = false; + + /** + * RangeTblEntry inh. + * @member {boolean} inh + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.inh = false; + + /** + * RangeTblEntry inFromCl. + * @member {boolean} inFromCl + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.inFromCl = false; + + /** + * RangeTblEntry requiredPerms. + * @member {number} requiredPerms + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.requiredPerms = 0; + + /** + * RangeTblEntry checkAsUser. + * @member {number} checkAsUser + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.checkAsUser = 0; + + /** + * RangeTblEntry selectedCols. + * @member {Array.} selectedCols + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.selectedCols = $util.emptyArray; + + /** + * RangeTblEntry insertedCols. + * @member {Array.} insertedCols + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.insertedCols = $util.emptyArray; + + /** + * RangeTblEntry updatedCols. + * @member {Array.} updatedCols + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.updatedCols = $util.emptyArray; + + /** + * RangeTblEntry extraUpdatedCols. + * @member {Array.} extraUpdatedCols + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.extraUpdatedCols = $util.emptyArray; + + /** + * RangeTblEntry securityQuals. + * @member {Array.} securityQuals + * @memberof pg_query.RangeTblEntry + * @instance + */ + RangeTblEntry.prototype.securityQuals = $util.emptyArray; + + /** + * Creates a new RangeTblEntry instance using the specified properties. + * @function create + * @memberof pg_query.RangeTblEntry + * @static + * @param {pg_query.IRangeTblEntry=} [properties] Properties to set + * @returns {pg_query.RangeTblEntry} RangeTblEntry instance + */ + RangeTblEntry.create = function create(properties) { + return new RangeTblEntry(properties); + }; + + /** + * Encodes the specified RangeTblEntry message. Does not implicitly {@link pg_query.RangeTblEntry.verify|verify} messages. + * @function encode + * @memberof pg_query.RangeTblEntry + * @static + * @param {pg_query.IRangeTblEntry} message RangeTblEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeTblEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rtekind != null && Object.hasOwnProperty.call(message, "rtekind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.rtekind); + if (message.relid != null && Object.hasOwnProperty.call(message, "relid")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.relid); + if (message.relkind != null && Object.hasOwnProperty.call(message, "relkind")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.relkind); + if (message.rellockmode != null && Object.hasOwnProperty.call(message, "rellockmode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.rellockmode); + if (message.tablesample != null && Object.hasOwnProperty.call(message, "tablesample")) + $root.pg_query.TableSampleClause.encode(message.tablesample, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.subquery != null && Object.hasOwnProperty.call(message, "subquery")) + $root.pg_query.Query.encode(message.subquery, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.security_barrier != null && Object.hasOwnProperty.call(message, "security_barrier")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.security_barrier); + if (message.jointype != null && Object.hasOwnProperty.call(message, "jointype")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.jointype); + if (message.joinmergedcols != null && Object.hasOwnProperty.call(message, "joinmergedcols")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.joinmergedcols); + if (message.joinaliasvars != null && message.joinaliasvars.length) + for (var i = 0; i < message.joinaliasvars.length; ++i) + $root.pg_query.Node.encode(message.joinaliasvars[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.joinleftcols != null && message.joinleftcols.length) + for (var i = 0; i < message.joinleftcols.length; ++i) + $root.pg_query.Node.encode(message.joinleftcols[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.joinrightcols != null && message.joinrightcols.length) + for (var i = 0; i < message.joinrightcols.length; ++i) + $root.pg_query.Node.encode(message.joinrightcols[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.functions != null && message.functions.length) + for (var i = 0; i < message.functions.length; ++i) + $root.pg_query.Node.encode(message.functions[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.funcordinality != null && Object.hasOwnProperty.call(message, "funcordinality")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.funcordinality); + if (message.tablefunc != null && Object.hasOwnProperty.call(message, "tablefunc")) + $root.pg_query.TableFunc.encode(message.tablefunc, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.values_lists != null && message.values_lists.length) + for (var i = 0; i < message.values_lists.length; ++i) + $root.pg_query.Node.encode(message.values_lists[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.ctename != null && Object.hasOwnProperty.call(message, "ctename")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.ctename); + if (message.ctelevelsup != null && Object.hasOwnProperty.call(message, "ctelevelsup")) + writer.uint32(/* id 18, wireType 0 =*/144).uint32(message.ctelevelsup); + if (message.self_reference != null && Object.hasOwnProperty.call(message, "self_reference")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.self_reference); + if (message.coltypes != null && message.coltypes.length) + for (var i = 0; i < message.coltypes.length; ++i) + $root.pg_query.Node.encode(message.coltypes[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.coltypmods != null && message.coltypmods.length) + for (var i = 0; i < message.coltypmods.length; ++i) + $root.pg_query.Node.encode(message.coltypmods[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.colcollations != null && message.colcollations.length) + for (var i = 0; i < message.colcollations.length; ++i) + $root.pg_query.Node.encode(message.colcollations[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.enrname != null && Object.hasOwnProperty.call(message, "enrname")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.enrname); + if (message.enrtuples != null && Object.hasOwnProperty.call(message, "enrtuples")) + writer.uint32(/* id 24, wireType 1 =*/193).double(message.enrtuples); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + $root.pg_query.Alias.encode(message.alias, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.eref != null && Object.hasOwnProperty.call(message, "eref")) + $root.pg_query.Alias.encode(message.eref, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.lateral != null && Object.hasOwnProperty.call(message, "lateral")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.lateral); + if (message.inh != null && Object.hasOwnProperty.call(message, "inh")) + writer.uint32(/* id 28, wireType 0 =*/224).bool(message.inh); + if (message.inFromCl != null && Object.hasOwnProperty.call(message, "inFromCl")) + writer.uint32(/* id 29, wireType 0 =*/232).bool(message.inFromCl); + if (message.requiredPerms != null && Object.hasOwnProperty.call(message, "requiredPerms")) + writer.uint32(/* id 30, wireType 0 =*/240).uint32(message.requiredPerms); + if (message.checkAsUser != null && Object.hasOwnProperty.call(message, "checkAsUser")) + writer.uint32(/* id 31, wireType 0 =*/248).uint32(message.checkAsUser); + if (message.selectedCols != null && message.selectedCols.length) { + writer.uint32(/* id 32, wireType 2 =*/258).fork(); + for (var i = 0; i < message.selectedCols.length; ++i) + writer.uint64(message.selectedCols[i]); + writer.ldelim(); + } + if (message.insertedCols != null && message.insertedCols.length) { + writer.uint32(/* id 33, wireType 2 =*/266).fork(); + for (var i = 0; i < message.insertedCols.length; ++i) + writer.uint64(message.insertedCols[i]); + writer.ldelim(); + } + if (message.updatedCols != null && message.updatedCols.length) { + writer.uint32(/* id 34, wireType 2 =*/274).fork(); + for (var i = 0; i < message.updatedCols.length; ++i) + writer.uint64(message.updatedCols[i]); + writer.ldelim(); + } + if (message.extraUpdatedCols != null && message.extraUpdatedCols.length) { + writer.uint32(/* id 35, wireType 2 =*/282).fork(); + for (var i = 0; i < message.extraUpdatedCols.length; ++i) + writer.uint64(message.extraUpdatedCols[i]); + writer.ldelim(); + } + if (message.securityQuals != null && message.securityQuals.length) + for (var i = 0; i < message.securityQuals.length; ++i) + $root.pg_query.Node.encode(message.securityQuals[i], writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RangeTblEntry message, length delimited. Does not implicitly {@link pg_query.RangeTblEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RangeTblEntry + * @static + * @param {pg_query.IRangeTblEntry} message RangeTblEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeTblEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RangeTblEntry message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RangeTblEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RangeTblEntry} RangeTblEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeTblEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RangeTblEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rtekind = reader.int32(); + break; + } + case 2: { + message.relid = reader.uint32(); + break; + } + case 3: { + message.relkind = reader.string(); + break; + } + case 4: { + message.rellockmode = reader.int32(); + break; + } + case 5: { + message.tablesample = $root.pg_query.TableSampleClause.decode(reader, reader.uint32()); + break; + } + case 6: { + message.subquery = $root.pg_query.Query.decode(reader, reader.uint32()); + break; + } + case 7: { + message.security_barrier = reader.bool(); + break; + } + case 8: { + message.jointype = reader.int32(); + break; + } + case 9: { + message.joinmergedcols = reader.int32(); + break; + } + case 10: { + if (!(message.joinaliasvars && message.joinaliasvars.length)) + message.joinaliasvars = []; + message.joinaliasvars.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message.joinleftcols && message.joinleftcols.length)) + message.joinleftcols = []; + message.joinleftcols.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 12: { + if (!(message.joinrightcols && message.joinrightcols.length)) + message.joinrightcols = []; + message.joinrightcols.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 13: { + if (!(message.functions && message.functions.length)) + message.functions = []; + message.functions.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 14: { + message.funcordinality = reader.bool(); + break; + } + case 15: { + message.tablefunc = $root.pg_query.TableFunc.decode(reader, reader.uint32()); + break; + } + case 16: { + if (!(message.values_lists && message.values_lists.length)) + message.values_lists = []; + message.values_lists.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 17: { + message.ctename = reader.string(); + break; + } + case 18: { + message.ctelevelsup = reader.uint32(); + break; + } + case 19: { + message.self_reference = reader.bool(); + break; + } + case 20: { + if (!(message.coltypes && message.coltypes.length)) + message.coltypes = []; + message.coltypes.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 21: { + if (!(message.coltypmods && message.coltypmods.length)) + message.coltypmods = []; + message.coltypmods.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 22: { + if (!(message.colcollations && message.colcollations.length)) + message.colcollations = []; + message.colcollations.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 23: { + message.enrname = reader.string(); + break; + } + case 24: { + message.enrtuples = reader.double(); + break; + } + case 25: { + message.alias = $root.pg_query.Alias.decode(reader, reader.uint32()); + break; + } + case 26: { + message.eref = $root.pg_query.Alias.decode(reader, reader.uint32()); + break; + } + case 27: { + message.lateral = reader.bool(); + break; + } + case 28: { + message.inh = reader.bool(); + break; + } + case 29: { + message.inFromCl = reader.bool(); + break; + } + case 30: { + message.requiredPerms = reader.uint32(); + break; + } + case 31: { + message.checkAsUser = reader.uint32(); + break; + } + case 32: { + if (!(message.selectedCols && message.selectedCols.length)) + message.selectedCols = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.selectedCols.push(reader.uint64()); + } else + message.selectedCols.push(reader.uint64()); + break; + } + case 33: { + if (!(message.insertedCols && message.insertedCols.length)) + message.insertedCols = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.insertedCols.push(reader.uint64()); + } else + message.insertedCols.push(reader.uint64()); + break; + } + case 34: { + if (!(message.updatedCols && message.updatedCols.length)) + message.updatedCols = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.updatedCols.push(reader.uint64()); + } else + message.updatedCols.push(reader.uint64()); + break; + } + case 35: { + if (!(message.extraUpdatedCols && message.extraUpdatedCols.length)) + message.extraUpdatedCols = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.extraUpdatedCols.push(reader.uint64()); + } else + message.extraUpdatedCols.push(reader.uint64()); + break; + } + case 36: { + if (!(message.securityQuals && message.securityQuals.length)) + message.securityQuals = []; + message.securityQuals.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RangeTblEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RangeTblEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RangeTblEntry} RangeTblEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeTblEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RangeTblEntry message. + * @function verify + * @memberof pg_query.RangeTblEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RangeTblEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rtekind != null && message.hasOwnProperty("rtekind")) + switch (message.rtekind) { + default: + return "rtekind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.relid != null && message.hasOwnProperty("relid")) + if (!$util.isInteger(message.relid)) + return "relid: integer expected"; + if (message.relkind != null && message.hasOwnProperty("relkind")) + if (!$util.isString(message.relkind)) + return "relkind: string expected"; + if (message.rellockmode != null && message.hasOwnProperty("rellockmode")) + if (!$util.isInteger(message.rellockmode)) + return "rellockmode: integer expected"; + if (message.tablesample != null && message.hasOwnProperty("tablesample")) { + var error = $root.pg_query.TableSampleClause.verify(message.tablesample); + if (error) + return "tablesample." + error; + } + if (message.subquery != null && message.hasOwnProperty("subquery")) { + var error = $root.pg_query.Query.verify(message.subquery); + if (error) + return "subquery." + error; + } + if (message.security_barrier != null && message.hasOwnProperty("security_barrier")) + if (typeof message.security_barrier !== "boolean") + return "security_barrier: boolean expected"; + if (message.jointype != null && message.hasOwnProperty("jointype")) + switch (message.jointype) { + default: + return "jointype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.joinmergedcols != null && message.hasOwnProperty("joinmergedcols")) + if (!$util.isInteger(message.joinmergedcols)) + return "joinmergedcols: integer expected"; + if (message.joinaliasvars != null && message.hasOwnProperty("joinaliasvars")) { + if (!Array.isArray(message.joinaliasvars)) + return "joinaliasvars: array expected"; + for (var i = 0; i < message.joinaliasvars.length; ++i) { + var error = $root.pg_query.Node.verify(message.joinaliasvars[i]); + if (error) + return "joinaliasvars." + error; + } + } + if (message.joinleftcols != null && message.hasOwnProperty("joinleftcols")) { + if (!Array.isArray(message.joinleftcols)) + return "joinleftcols: array expected"; + for (var i = 0; i < message.joinleftcols.length; ++i) { + var error = $root.pg_query.Node.verify(message.joinleftcols[i]); + if (error) + return "joinleftcols." + error; + } + } + if (message.joinrightcols != null && message.hasOwnProperty("joinrightcols")) { + if (!Array.isArray(message.joinrightcols)) + return "joinrightcols: array expected"; + for (var i = 0; i < message.joinrightcols.length; ++i) { + var error = $root.pg_query.Node.verify(message.joinrightcols[i]); + if (error) + return "joinrightcols." + error; + } + } + if (message.functions != null && message.hasOwnProperty("functions")) { + if (!Array.isArray(message.functions)) + return "functions: array expected"; + for (var i = 0; i < message.functions.length; ++i) { + var error = $root.pg_query.Node.verify(message.functions[i]); + if (error) + return "functions." + error; + } + } + if (message.funcordinality != null && message.hasOwnProperty("funcordinality")) + if (typeof message.funcordinality !== "boolean") + return "funcordinality: boolean expected"; + if (message.tablefunc != null && message.hasOwnProperty("tablefunc")) { + var error = $root.pg_query.TableFunc.verify(message.tablefunc); + if (error) + return "tablefunc." + error; + } + if (message.values_lists != null && message.hasOwnProperty("values_lists")) { + if (!Array.isArray(message.values_lists)) + return "values_lists: array expected"; + for (var i = 0; i < message.values_lists.length; ++i) { + var error = $root.pg_query.Node.verify(message.values_lists[i]); + if (error) + return "values_lists." + error; + } + } + if (message.ctename != null && message.hasOwnProperty("ctename")) + if (!$util.isString(message.ctename)) + return "ctename: string expected"; + if (message.ctelevelsup != null && message.hasOwnProperty("ctelevelsup")) + if (!$util.isInteger(message.ctelevelsup)) + return "ctelevelsup: integer expected"; + if (message.self_reference != null && message.hasOwnProperty("self_reference")) + if (typeof message.self_reference !== "boolean") + return "self_reference: boolean expected"; + if (message.coltypes != null && message.hasOwnProperty("coltypes")) { + if (!Array.isArray(message.coltypes)) + return "coltypes: array expected"; + for (var i = 0; i < message.coltypes.length; ++i) { + var error = $root.pg_query.Node.verify(message.coltypes[i]); + if (error) + return "coltypes." + error; + } + } + if (message.coltypmods != null && message.hasOwnProperty("coltypmods")) { + if (!Array.isArray(message.coltypmods)) + return "coltypmods: array expected"; + for (var i = 0; i < message.coltypmods.length; ++i) { + var error = $root.pg_query.Node.verify(message.coltypmods[i]); + if (error) + return "coltypmods." + error; + } + } + if (message.colcollations != null && message.hasOwnProperty("colcollations")) { + if (!Array.isArray(message.colcollations)) + return "colcollations: array expected"; + for (var i = 0; i < message.colcollations.length; ++i) { + var error = $root.pg_query.Node.verify(message.colcollations[i]); + if (error) + return "colcollations." + error; + } + } + if (message.enrname != null && message.hasOwnProperty("enrname")) + if (!$util.isString(message.enrname)) + return "enrname: string expected"; + if (message.enrtuples != null && message.hasOwnProperty("enrtuples")) + if (typeof message.enrtuples !== "number") + return "enrtuples: number expected"; + if (message.alias != null && message.hasOwnProperty("alias")) { + var error = $root.pg_query.Alias.verify(message.alias); + if (error) + return "alias." + error; + } + if (message.eref != null && message.hasOwnProperty("eref")) { + var error = $root.pg_query.Alias.verify(message.eref); + if (error) + return "eref." + error; + } + if (message.lateral != null && message.hasOwnProperty("lateral")) + if (typeof message.lateral !== "boolean") + return "lateral: boolean expected"; + if (message.inh != null && message.hasOwnProperty("inh")) + if (typeof message.inh !== "boolean") + return "inh: boolean expected"; + if (message.inFromCl != null && message.hasOwnProperty("inFromCl")) + if (typeof message.inFromCl !== "boolean") + return "inFromCl: boolean expected"; + if (message.requiredPerms != null && message.hasOwnProperty("requiredPerms")) + if (!$util.isInteger(message.requiredPerms)) + return "requiredPerms: integer expected"; + if (message.checkAsUser != null && message.hasOwnProperty("checkAsUser")) + if (!$util.isInteger(message.checkAsUser)) + return "checkAsUser: integer expected"; + if (message.selectedCols != null && message.hasOwnProperty("selectedCols")) { + if (!Array.isArray(message.selectedCols)) + return "selectedCols: array expected"; + for (var i = 0; i < message.selectedCols.length; ++i) + if (!$util.isInteger(message.selectedCols[i]) && !(message.selectedCols[i] && $util.isInteger(message.selectedCols[i].low) && $util.isInteger(message.selectedCols[i].high))) + return "selectedCols: integer|Long[] expected"; + } + if (message.insertedCols != null && message.hasOwnProperty("insertedCols")) { + if (!Array.isArray(message.insertedCols)) + return "insertedCols: array expected"; + for (var i = 0; i < message.insertedCols.length; ++i) + if (!$util.isInteger(message.insertedCols[i]) && !(message.insertedCols[i] && $util.isInteger(message.insertedCols[i].low) && $util.isInteger(message.insertedCols[i].high))) + return "insertedCols: integer|Long[] expected"; + } + if (message.updatedCols != null && message.hasOwnProperty("updatedCols")) { + if (!Array.isArray(message.updatedCols)) + return "updatedCols: array expected"; + for (var i = 0; i < message.updatedCols.length; ++i) + if (!$util.isInteger(message.updatedCols[i]) && !(message.updatedCols[i] && $util.isInteger(message.updatedCols[i].low) && $util.isInteger(message.updatedCols[i].high))) + return "updatedCols: integer|Long[] expected"; + } + if (message.extraUpdatedCols != null && message.hasOwnProperty("extraUpdatedCols")) { + if (!Array.isArray(message.extraUpdatedCols)) + return "extraUpdatedCols: array expected"; + for (var i = 0; i < message.extraUpdatedCols.length; ++i) + if (!$util.isInteger(message.extraUpdatedCols[i]) && !(message.extraUpdatedCols[i] && $util.isInteger(message.extraUpdatedCols[i].low) && $util.isInteger(message.extraUpdatedCols[i].high))) + return "extraUpdatedCols: integer|Long[] expected"; + } + if (message.securityQuals != null && message.hasOwnProperty("securityQuals")) { + if (!Array.isArray(message.securityQuals)) + return "securityQuals: array expected"; + for (var i = 0; i < message.securityQuals.length; ++i) { + var error = $root.pg_query.Node.verify(message.securityQuals[i]); + if (error) + return "securityQuals." + error; + } + } + return null; + }; + + /** + * Creates a RangeTblEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RangeTblEntry + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RangeTblEntry} RangeTblEntry + */ + RangeTblEntry.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RangeTblEntry) + return object; + var message = new $root.pg_query.RangeTblEntry(); + switch (object.rtekind) { + default: + if (typeof object.rtekind === "number") { + message.rtekind = object.rtekind; + break; + } + break; + case "RTEKIND_UNDEFINED": + case 0: + message.rtekind = 0; + break; + case "RTE_RELATION": + case 1: + message.rtekind = 1; + break; + case "RTE_SUBQUERY": + case 2: + message.rtekind = 2; + break; + case "RTE_JOIN": + case 3: + message.rtekind = 3; + break; + case "RTE_FUNCTION": + case 4: + message.rtekind = 4; + break; + case "RTE_TABLEFUNC": + case 5: + message.rtekind = 5; + break; + case "RTE_VALUES": + case 6: + message.rtekind = 6; + break; + case "RTE_CTE": + case 7: + message.rtekind = 7; + break; + case "RTE_NAMEDTUPLESTORE": + case 8: + message.rtekind = 8; + break; + case "RTE_RESULT": + case 9: + message.rtekind = 9; + break; + } + if (object.relid != null) + message.relid = object.relid >>> 0; + if (object.relkind != null) + message.relkind = String(object.relkind); + if (object.rellockmode != null) + message.rellockmode = object.rellockmode | 0; + if (object.tablesample != null) { + if (typeof object.tablesample !== "object") + throw TypeError(".pg_query.RangeTblEntry.tablesample: object expected"); + message.tablesample = $root.pg_query.TableSampleClause.fromObject(object.tablesample); + } + if (object.subquery != null) { + if (typeof object.subquery !== "object") + throw TypeError(".pg_query.RangeTblEntry.subquery: object expected"); + message.subquery = $root.pg_query.Query.fromObject(object.subquery); + } + if (object.security_barrier != null) + message.security_barrier = Boolean(object.security_barrier); + switch (object.jointype) { + default: + if (typeof object.jointype === "number") { + message.jointype = object.jointype; + break; + } + break; + case "JOIN_TYPE_UNDEFINED": + case 0: + message.jointype = 0; + break; + case "JOIN_INNER": + case 1: + message.jointype = 1; + break; + case "JOIN_LEFT": + case 2: + message.jointype = 2; + break; + case "JOIN_FULL": + case 3: + message.jointype = 3; + break; + case "JOIN_RIGHT": + case 4: + message.jointype = 4; + break; + case "JOIN_SEMI": + case 5: + message.jointype = 5; + break; + case "JOIN_ANTI": + case 6: + message.jointype = 6; + break; + case "JOIN_UNIQUE_OUTER": + case 7: + message.jointype = 7; + break; + case "JOIN_UNIQUE_INNER": + case 8: + message.jointype = 8; + break; + } + if (object.joinmergedcols != null) + message.joinmergedcols = object.joinmergedcols | 0; + if (object.joinaliasvars) { + if (!Array.isArray(object.joinaliasvars)) + throw TypeError(".pg_query.RangeTblEntry.joinaliasvars: array expected"); + message.joinaliasvars = []; + for (var i = 0; i < object.joinaliasvars.length; ++i) { + if (typeof object.joinaliasvars[i] !== "object") + throw TypeError(".pg_query.RangeTblEntry.joinaliasvars: object expected"); + message.joinaliasvars[i] = $root.pg_query.Node.fromObject(object.joinaliasvars[i]); + } + } + if (object.joinleftcols) { + if (!Array.isArray(object.joinleftcols)) + throw TypeError(".pg_query.RangeTblEntry.joinleftcols: array expected"); + message.joinleftcols = []; + for (var i = 0; i < object.joinleftcols.length; ++i) { + if (typeof object.joinleftcols[i] !== "object") + throw TypeError(".pg_query.RangeTblEntry.joinleftcols: object expected"); + message.joinleftcols[i] = $root.pg_query.Node.fromObject(object.joinleftcols[i]); + } + } + if (object.joinrightcols) { + if (!Array.isArray(object.joinrightcols)) + throw TypeError(".pg_query.RangeTblEntry.joinrightcols: array expected"); + message.joinrightcols = []; + for (var i = 0; i < object.joinrightcols.length; ++i) { + if (typeof object.joinrightcols[i] !== "object") + throw TypeError(".pg_query.RangeTblEntry.joinrightcols: object expected"); + message.joinrightcols[i] = $root.pg_query.Node.fromObject(object.joinrightcols[i]); + } + } + if (object.functions) { + if (!Array.isArray(object.functions)) + throw TypeError(".pg_query.RangeTblEntry.functions: array expected"); + message.functions = []; + for (var i = 0; i < object.functions.length; ++i) { + if (typeof object.functions[i] !== "object") + throw TypeError(".pg_query.RangeTblEntry.functions: object expected"); + message.functions[i] = $root.pg_query.Node.fromObject(object.functions[i]); + } + } + if (object.funcordinality != null) + message.funcordinality = Boolean(object.funcordinality); + if (object.tablefunc != null) { + if (typeof object.tablefunc !== "object") + throw TypeError(".pg_query.RangeTblEntry.tablefunc: object expected"); + message.tablefunc = $root.pg_query.TableFunc.fromObject(object.tablefunc); + } + if (object.values_lists) { + if (!Array.isArray(object.values_lists)) + throw TypeError(".pg_query.RangeTblEntry.values_lists: array expected"); + message.values_lists = []; + for (var i = 0; i < object.values_lists.length; ++i) { + if (typeof object.values_lists[i] !== "object") + throw TypeError(".pg_query.RangeTblEntry.values_lists: object expected"); + message.values_lists[i] = $root.pg_query.Node.fromObject(object.values_lists[i]); + } + } + if (object.ctename != null) + message.ctename = String(object.ctename); + if (object.ctelevelsup != null) + message.ctelevelsup = object.ctelevelsup >>> 0; + if (object.self_reference != null) + message.self_reference = Boolean(object.self_reference); + if (object.coltypes) { + if (!Array.isArray(object.coltypes)) + throw TypeError(".pg_query.RangeTblEntry.coltypes: array expected"); + message.coltypes = []; + for (var i = 0; i < object.coltypes.length; ++i) { + if (typeof object.coltypes[i] !== "object") + throw TypeError(".pg_query.RangeTblEntry.coltypes: object expected"); + message.coltypes[i] = $root.pg_query.Node.fromObject(object.coltypes[i]); + } + } + if (object.coltypmods) { + if (!Array.isArray(object.coltypmods)) + throw TypeError(".pg_query.RangeTblEntry.coltypmods: array expected"); + message.coltypmods = []; + for (var i = 0; i < object.coltypmods.length; ++i) { + if (typeof object.coltypmods[i] !== "object") + throw TypeError(".pg_query.RangeTblEntry.coltypmods: object expected"); + message.coltypmods[i] = $root.pg_query.Node.fromObject(object.coltypmods[i]); + } + } + if (object.colcollations) { + if (!Array.isArray(object.colcollations)) + throw TypeError(".pg_query.RangeTblEntry.colcollations: array expected"); + message.colcollations = []; + for (var i = 0; i < object.colcollations.length; ++i) { + if (typeof object.colcollations[i] !== "object") + throw TypeError(".pg_query.RangeTblEntry.colcollations: object expected"); + message.colcollations[i] = $root.pg_query.Node.fromObject(object.colcollations[i]); + } + } + if (object.enrname != null) + message.enrname = String(object.enrname); + if (object.enrtuples != null) + message.enrtuples = Number(object.enrtuples); + if (object.alias != null) { + if (typeof object.alias !== "object") + throw TypeError(".pg_query.RangeTblEntry.alias: object expected"); + message.alias = $root.pg_query.Alias.fromObject(object.alias); + } + if (object.eref != null) { + if (typeof object.eref !== "object") + throw TypeError(".pg_query.RangeTblEntry.eref: object expected"); + message.eref = $root.pg_query.Alias.fromObject(object.eref); + } + if (object.lateral != null) + message.lateral = Boolean(object.lateral); + if (object.inh != null) + message.inh = Boolean(object.inh); + if (object.inFromCl != null) + message.inFromCl = Boolean(object.inFromCl); + if (object.requiredPerms != null) + message.requiredPerms = object.requiredPerms >>> 0; + if (object.checkAsUser != null) + message.checkAsUser = object.checkAsUser >>> 0; + if (object.selectedCols) { + if (!Array.isArray(object.selectedCols)) + throw TypeError(".pg_query.RangeTblEntry.selectedCols: array expected"); + message.selectedCols = []; + for (var i = 0; i < object.selectedCols.length; ++i) + if ($util.Long) + (message.selectedCols[i] = $util.Long.fromValue(object.selectedCols[i])).unsigned = true; + else if (typeof object.selectedCols[i] === "string") + message.selectedCols[i] = parseInt(object.selectedCols[i], 10); + else if (typeof object.selectedCols[i] === "number") + message.selectedCols[i] = object.selectedCols[i]; + else if (typeof object.selectedCols[i] === "object") + message.selectedCols[i] = new $util.LongBits(object.selectedCols[i].low >>> 0, object.selectedCols[i].high >>> 0).toNumber(true); + } + if (object.insertedCols) { + if (!Array.isArray(object.insertedCols)) + throw TypeError(".pg_query.RangeTblEntry.insertedCols: array expected"); + message.insertedCols = []; + for (var i = 0; i < object.insertedCols.length; ++i) + if ($util.Long) + (message.insertedCols[i] = $util.Long.fromValue(object.insertedCols[i])).unsigned = true; + else if (typeof object.insertedCols[i] === "string") + message.insertedCols[i] = parseInt(object.insertedCols[i], 10); + else if (typeof object.insertedCols[i] === "number") + message.insertedCols[i] = object.insertedCols[i]; + else if (typeof object.insertedCols[i] === "object") + message.insertedCols[i] = new $util.LongBits(object.insertedCols[i].low >>> 0, object.insertedCols[i].high >>> 0).toNumber(true); + } + if (object.updatedCols) { + if (!Array.isArray(object.updatedCols)) + throw TypeError(".pg_query.RangeTblEntry.updatedCols: array expected"); + message.updatedCols = []; + for (var i = 0; i < object.updatedCols.length; ++i) + if ($util.Long) + (message.updatedCols[i] = $util.Long.fromValue(object.updatedCols[i])).unsigned = true; + else if (typeof object.updatedCols[i] === "string") + message.updatedCols[i] = parseInt(object.updatedCols[i], 10); + else if (typeof object.updatedCols[i] === "number") + message.updatedCols[i] = object.updatedCols[i]; + else if (typeof object.updatedCols[i] === "object") + message.updatedCols[i] = new $util.LongBits(object.updatedCols[i].low >>> 0, object.updatedCols[i].high >>> 0).toNumber(true); + } + if (object.extraUpdatedCols) { + if (!Array.isArray(object.extraUpdatedCols)) + throw TypeError(".pg_query.RangeTblEntry.extraUpdatedCols: array expected"); + message.extraUpdatedCols = []; + for (var i = 0; i < object.extraUpdatedCols.length; ++i) + if ($util.Long) + (message.extraUpdatedCols[i] = $util.Long.fromValue(object.extraUpdatedCols[i])).unsigned = true; + else if (typeof object.extraUpdatedCols[i] === "string") + message.extraUpdatedCols[i] = parseInt(object.extraUpdatedCols[i], 10); + else if (typeof object.extraUpdatedCols[i] === "number") + message.extraUpdatedCols[i] = object.extraUpdatedCols[i]; + else if (typeof object.extraUpdatedCols[i] === "object") + message.extraUpdatedCols[i] = new $util.LongBits(object.extraUpdatedCols[i].low >>> 0, object.extraUpdatedCols[i].high >>> 0).toNumber(true); + } + if (object.securityQuals) { + if (!Array.isArray(object.securityQuals)) + throw TypeError(".pg_query.RangeTblEntry.securityQuals: array expected"); + message.securityQuals = []; + for (var i = 0; i < object.securityQuals.length; ++i) { + if (typeof object.securityQuals[i] !== "object") + throw TypeError(".pg_query.RangeTblEntry.securityQuals: object expected"); + message.securityQuals[i] = $root.pg_query.Node.fromObject(object.securityQuals[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RangeTblEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RangeTblEntry + * @static + * @param {pg_query.RangeTblEntry} message RangeTblEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RangeTblEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.joinaliasvars = []; + object.joinleftcols = []; + object.joinrightcols = []; + object.functions = []; + object.values_lists = []; + object.coltypes = []; + object.coltypmods = []; + object.colcollations = []; + object.selectedCols = []; + object.insertedCols = []; + object.updatedCols = []; + object.extraUpdatedCols = []; + object.securityQuals = []; + } + if (options.defaults) { + object.rtekind = options.enums === String ? "RTEKIND_UNDEFINED" : 0; + object.relid = 0; + object.relkind = ""; + object.rellockmode = 0; + object.tablesample = null; + object.subquery = null; + object.security_barrier = false; + object.jointype = options.enums === String ? "JOIN_TYPE_UNDEFINED" : 0; + object.joinmergedcols = 0; + object.funcordinality = false; + object.tablefunc = null; + object.ctename = ""; + object.ctelevelsup = 0; + object.self_reference = false; + object.enrname = ""; + object.enrtuples = 0; + object.alias = null; + object.eref = null; + object.lateral = false; + object.inh = false; + object.inFromCl = false; + object.requiredPerms = 0; + object.checkAsUser = 0; + } + if (message.rtekind != null && message.hasOwnProperty("rtekind")) + object.rtekind = options.enums === String ? $root.pg_query.RTEKind[message.rtekind] === undefined ? message.rtekind : $root.pg_query.RTEKind[message.rtekind] : message.rtekind; + if (message.relid != null && message.hasOwnProperty("relid")) + object.relid = message.relid; + if (message.relkind != null && message.hasOwnProperty("relkind")) + object.relkind = message.relkind; + if (message.rellockmode != null && message.hasOwnProperty("rellockmode")) + object.rellockmode = message.rellockmode; + if (message.tablesample != null && message.hasOwnProperty("tablesample")) + object.tablesample = $root.pg_query.TableSampleClause.toObject(message.tablesample, options); + if (message.subquery != null && message.hasOwnProperty("subquery")) + object.subquery = $root.pg_query.Query.toObject(message.subquery, options); + if (message.security_barrier != null && message.hasOwnProperty("security_barrier")) + object.security_barrier = message.security_barrier; + if (message.jointype != null && message.hasOwnProperty("jointype")) + object.jointype = options.enums === String ? $root.pg_query.JoinType[message.jointype] === undefined ? message.jointype : $root.pg_query.JoinType[message.jointype] : message.jointype; + if (message.joinmergedcols != null && message.hasOwnProperty("joinmergedcols")) + object.joinmergedcols = message.joinmergedcols; + if (message.joinaliasvars && message.joinaliasvars.length) { + object.joinaliasvars = []; + for (var j = 0; j < message.joinaliasvars.length; ++j) + object.joinaliasvars[j] = $root.pg_query.Node.toObject(message.joinaliasvars[j], options); + } + if (message.joinleftcols && message.joinleftcols.length) { + object.joinleftcols = []; + for (var j = 0; j < message.joinleftcols.length; ++j) + object.joinleftcols[j] = $root.pg_query.Node.toObject(message.joinleftcols[j], options); + } + if (message.joinrightcols && message.joinrightcols.length) { + object.joinrightcols = []; + for (var j = 0; j < message.joinrightcols.length; ++j) + object.joinrightcols[j] = $root.pg_query.Node.toObject(message.joinrightcols[j], options); + } + if (message.functions && message.functions.length) { + object.functions = []; + for (var j = 0; j < message.functions.length; ++j) + object.functions[j] = $root.pg_query.Node.toObject(message.functions[j], options); + } + if (message.funcordinality != null && message.hasOwnProperty("funcordinality")) + object.funcordinality = message.funcordinality; + if (message.tablefunc != null && message.hasOwnProperty("tablefunc")) + object.tablefunc = $root.pg_query.TableFunc.toObject(message.tablefunc, options); + if (message.values_lists && message.values_lists.length) { + object.values_lists = []; + for (var j = 0; j < message.values_lists.length; ++j) + object.values_lists[j] = $root.pg_query.Node.toObject(message.values_lists[j], options); + } + if (message.ctename != null && message.hasOwnProperty("ctename")) + object.ctename = message.ctename; + if (message.ctelevelsup != null && message.hasOwnProperty("ctelevelsup")) + object.ctelevelsup = message.ctelevelsup; + if (message.self_reference != null && message.hasOwnProperty("self_reference")) + object.self_reference = message.self_reference; + if (message.coltypes && message.coltypes.length) { + object.coltypes = []; + for (var j = 0; j < message.coltypes.length; ++j) + object.coltypes[j] = $root.pg_query.Node.toObject(message.coltypes[j], options); + } + if (message.coltypmods && message.coltypmods.length) { + object.coltypmods = []; + for (var j = 0; j < message.coltypmods.length; ++j) + object.coltypmods[j] = $root.pg_query.Node.toObject(message.coltypmods[j], options); + } + if (message.colcollations && message.colcollations.length) { + object.colcollations = []; + for (var j = 0; j < message.colcollations.length; ++j) + object.colcollations[j] = $root.pg_query.Node.toObject(message.colcollations[j], options); + } + if (message.enrname != null && message.hasOwnProperty("enrname")) + object.enrname = message.enrname; + if (message.enrtuples != null && message.hasOwnProperty("enrtuples")) + object.enrtuples = options.json && !isFinite(message.enrtuples) ? String(message.enrtuples) : message.enrtuples; + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = $root.pg_query.Alias.toObject(message.alias, options); + if (message.eref != null && message.hasOwnProperty("eref")) + object.eref = $root.pg_query.Alias.toObject(message.eref, options); + if (message.lateral != null && message.hasOwnProperty("lateral")) + object.lateral = message.lateral; + if (message.inh != null && message.hasOwnProperty("inh")) + object.inh = message.inh; + if (message.inFromCl != null && message.hasOwnProperty("inFromCl")) + object.inFromCl = message.inFromCl; + if (message.requiredPerms != null && message.hasOwnProperty("requiredPerms")) + object.requiredPerms = message.requiredPerms; + if (message.checkAsUser != null && message.hasOwnProperty("checkAsUser")) + object.checkAsUser = message.checkAsUser; + if (message.selectedCols && message.selectedCols.length) { + object.selectedCols = []; + for (var j = 0; j < message.selectedCols.length; ++j) + if (typeof message.selectedCols[j] === "number") + object.selectedCols[j] = options.longs === String ? String(message.selectedCols[j]) : message.selectedCols[j]; + else + object.selectedCols[j] = options.longs === String ? $util.Long.prototype.toString.call(message.selectedCols[j]) : options.longs === Number ? new $util.LongBits(message.selectedCols[j].low >>> 0, message.selectedCols[j].high >>> 0).toNumber(true) : message.selectedCols[j]; + } + if (message.insertedCols && message.insertedCols.length) { + object.insertedCols = []; + for (var j = 0; j < message.insertedCols.length; ++j) + if (typeof message.insertedCols[j] === "number") + object.insertedCols[j] = options.longs === String ? String(message.insertedCols[j]) : message.insertedCols[j]; + else + object.insertedCols[j] = options.longs === String ? $util.Long.prototype.toString.call(message.insertedCols[j]) : options.longs === Number ? new $util.LongBits(message.insertedCols[j].low >>> 0, message.insertedCols[j].high >>> 0).toNumber(true) : message.insertedCols[j]; + } + if (message.updatedCols && message.updatedCols.length) { + object.updatedCols = []; + for (var j = 0; j < message.updatedCols.length; ++j) + if (typeof message.updatedCols[j] === "number") + object.updatedCols[j] = options.longs === String ? String(message.updatedCols[j]) : message.updatedCols[j]; + else + object.updatedCols[j] = options.longs === String ? $util.Long.prototype.toString.call(message.updatedCols[j]) : options.longs === Number ? new $util.LongBits(message.updatedCols[j].low >>> 0, message.updatedCols[j].high >>> 0).toNumber(true) : message.updatedCols[j]; + } + if (message.extraUpdatedCols && message.extraUpdatedCols.length) { + object.extraUpdatedCols = []; + for (var j = 0; j < message.extraUpdatedCols.length; ++j) + if (typeof message.extraUpdatedCols[j] === "number") + object.extraUpdatedCols[j] = options.longs === String ? String(message.extraUpdatedCols[j]) : message.extraUpdatedCols[j]; + else + object.extraUpdatedCols[j] = options.longs === String ? $util.Long.prototype.toString.call(message.extraUpdatedCols[j]) : options.longs === Number ? new $util.LongBits(message.extraUpdatedCols[j].low >>> 0, message.extraUpdatedCols[j].high >>> 0).toNumber(true) : message.extraUpdatedCols[j]; + } + if (message.securityQuals && message.securityQuals.length) { + object.securityQuals = []; + for (var j = 0; j < message.securityQuals.length; ++j) + object.securityQuals[j] = $root.pg_query.Node.toObject(message.securityQuals[j], options); + } + return object; + }; + + /** + * Converts this RangeTblEntry to JSON. + * @function toJSON + * @memberof pg_query.RangeTblEntry + * @instance + * @returns {Object.} JSON object + */ + RangeTblEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RangeTblEntry + * @function getTypeUrl + * @memberof pg_query.RangeTblEntry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RangeTblEntry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RangeTblEntry"; + }; + + return RangeTblEntry; + })(); + + pg_query.RangeTblFunction = (function() { + + /** + * Properties of a RangeTblFunction. + * @memberof pg_query + * @interface IRangeTblFunction + * @property {pg_query.INode|null} [funcexpr] RangeTblFunction funcexpr + * @property {number|null} [funccolcount] RangeTblFunction funccolcount + * @property {Array.|null} [funccolnames] RangeTblFunction funccolnames + * @property {Array.|null} [funccoltypes] RangeTblFunction funccoltypes + * @property {Array.|null} [funccoltypmods] RangeTblFunction funccoltypmods + * @property {Array.|null} [funccolcollations] RangeTblFunction funccolcollations + * @property {Array.|null} [funcparams] RangeTblFunction funcparams + */ + + /** + * Constructs a new RangeTblFunction. + * @memberof pg_query + * @classdesc Represents a RangeTblFunction. + * @implements IRangeTblFunction + * @constructor + * @param {pg_query.IRangeTblFunction=} [properties] Properties to set + */ + function RangeTblFunction(properties) { + this.funccolnames = []; + this.funccoltypes = []; + this.funccoltypmods = []; + this.funccolcollations = []; + this.funcparams = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RangeTblFunction funcexpr. + * @member {pg_query.INode|null|undefined} funcexpr + * @memberof pg_query.RangeTblFunction + * @instance + */ + RangeTblFunction.prototype.funcexpr = null; + + /** + * RangeTblFunction funccolcount. + * @member {number} funccolcount + * @memberof pg_query.RangeTblFunction + * @instance + */ + RangeTblFunction.prototype.funccolcount = 0; + + /** + * RangeTblFunction funccolnames. + * @member {Array.} funccolnames + * @memberof pg_query.RangeTblFunction + * @instance + */ + RangeTblFunction.prototype.funccolnames = $util.emptyArray; + + /** + * RangeTblFunction funccoltypes. + * @member {Array.} funccoltypes + * @memberof pg_query.RangeTblFunction + * @instance + */ + RangeTblFunction.prototype.funccoltypes = $util.emptyArray; + + /** + * RangeTblFunction funccoltypmods. + * @member {Array.} funccoltypmods + * @memberof pg_query.RangeTblFunction + * @instance + */ + RangeTblFunction.prototype.funccoltypmods = $util.emptyArray; + + /** + * RangeTblFunction funccolcollations. + * @member {Array.} funccolcollations + * @memberof pg_query.RangeTblFunction + * @instance + */ + RangeTblFunction.prototype.funccolcollations = $util.emptyArray; + + /** + * RangeTblFunction funcparams. + * @member {Array.} funcparams + * @memberof pg_query.RangeTblFunction + * @instance + */ + RangeTblFunction.prototype.funcparams = $util.emptyArray; + + /** + * Creates a new RangeTblFunction instance using the specified properties. + * @function create + * @memberof pg_query.RangeTblFunction + * @static + * @param {pg_query.IRangeTblFunction=} [properties] Properties to set + * @returns {pg_query.RangeTblFunction} RangeTblFunction instance + */ + RangeTblFunction.create = function create(properties) { + return new RangeTblFunction(properties); + }; + + /** + * Encodes the specified RangeTblFunction message. Does not implicitly {@link pg_query.RangeTblFunction.verify|verify} messages. + * @function encode + * @memberof pg_query.RangeTblFunction + * @static + * @param {pg_query.IRangeTblFunction} message RangeTblFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeTblFunction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.funcexpr != null && Object.hasOwnProperty.call(message, "funcexpr")) + $root.pg_query.Node.encode(message.funcexpr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.funccolcount != null && Object.hasOwnProperty.call(message, "funccolcount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.funccolcount); + if (message.funccolnames != null && message.funccolnames.length) + for (var i = 0; i < message.funccolnames.length; ++i) + $root.pg_query.Node.encode(message.funccolnames[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.funccoltypes != null && message.funccoltypes.length) + for (var i = 0; i < message.funccoltypes.length; ++i) + $root.pg_query.Node.encode(message.funccoltypes[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.funccoltypmods != null && message.funccoltypmods.length) + for (var i = 0; i < message.funccoltypmods.length; ++i) + $root.pg_query.Node.encode(message.funccoltypmods[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.funccolcollations != null && message.funccolcollations.length) + for (var i = 0; i < message.funccolcollations.length; ++i) + $root.pg_query.Node.encode(message.funccolcollations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.funcparams != null && message.funcparams.length) { + writer.uint32(/* id 7, wireType 2 =*/58).fork(); + for (var i = 0; i < message.funcparams.length; ++i) + writer.uint64(message.funcparams[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified RangeTblFunction message, length delimited. Does not implicitly {@link pg_query.RangeTblFunction.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RangeTblFunction + * @static + * @param {pg_query.IRangeTblFunction} message RangeTblFunction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RangeTblFunction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RangeTblFunction message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RangeTblFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RangeTblFunction} RangeTblFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeTblFunction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RangeTblFunction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.funcexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 2: { + message.funccolcount = reader.int32(); + break; + } + case 3: { + if (!(message.funccolnames && message.funccolnames.length)) + message.funccolnames = []; + message.funccolnames.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.funccoltypes && message.funccoltypes.length)) + message.funccoltypes = []; + message.funccoltypes.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.funccoltypmods && message.funccoltypmods.length)) + message.funccoltypmods = []; + message.funccoltypmods.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.funccolcollations && message.funccolcollations.length)) + message.funccolcollations = []; + message.funccolcollations.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.funcparams && message.funcparams.length)) + message.funcparams = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.funcparams.push(reader.uint64()); + } else + message.funcparams.push(reader.uint64()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RangeTblFunction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RangeTblFunction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RangeTblFunction} RangeTblFunction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RangeTblFunction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RangeTblFunction message. + * @function verify + * @memberof pg_query.RangeTblFunction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RangeTblFunction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.funcexpr != null && message.hasOwnProperty("funcexpr")) { + var error = $root.pg_query.Node.verify(message.funcexpr); + if (error) + return "funcexpr." + error; + } + if (message.funccolcount != null && message.hasOwnProperty("funccolcount")) + if (!$util.isInteger(message.funccolcount)) + return "funccolcount: integer expected"; + if (message.funccolnames != null && message.hasOwnProperty("funccolnames")) { + if (!Array.isArray(message.funccolnames)) + return "funccolnames: array expected"; + for (var i = 0; i < message.funccolnames.length; ++i) { + var error = $root.pg_query.Node.verify(message.funccolnames[i]); + if (error) + return "funccolnames." + error; + } + } + if (message.funccoltypes != null && message.hasOwnProperty("funccoltypes")) { + if (!Array.isArray(message.funccoltypes)) + return "funccoltypes: array expected"; + for (var i = 0; i < message.funccoltypes.length; ++i) { + var error = $root.pg_query.Node.verify(message.funccoltypes[i]); + if (error) + return "funccoltypes." + error; + } + } + if (message.funccoltypmods != null && message.hasOwnProperty("funccoltypmods")) { + if (!Array.isArray(message.funccoltypmods)) + return "funccoltypmods: array expected"; + for (var i = 0; i < message.funccoltypmods.length; ++i) { + var error = $root.pg_query.Node.verify(message.funccoltypmods[i]); + if (error) + return "funccoltypmods." + error; + } + } + if (message.funccolcollations != null && message.hasOwnProperty("funccolcollations")) { + if (!Array.isArray(message.funccolcollations)) + return "funccolcollations: array expected"; + for (var i = 0; i < message.funccolcollations.length; ++i) { + var error = $root.pg_query.Node.verify(message.funccolcollations[i]); + if (error) + return "funccolcollations." + error; + } + } + if (message.funcparams != null && message.hasOwnProperty("funcparams")) { + if (!Array.isArray(message.funcparams)) + return "funcparams: array expected"; + for (var i = 0; i < message.funcparams.length; ++i) + if (!$util.isInteger(message.funcparams[i]) && !(message.funcparams[i] && $util.isInteger(message.funcparams[i].low) && $util.isInteger(message.funcparams[i].high))) + return "funcparams: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates a RangeTblFunction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RangeTblFunction + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RangeTblFunction} RangeTblFunction + */ + RangeTblFunction.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RangeTblFunction) + return object; + var message = new $root.pg_query.RangeTblFunction(); + if (object.funcexpr != null) { + if (typeof object.funcexpr !== "object") + throw TypeError(".pg_query.RangeTblFunction.funcexpr: object expected"); + message.funcexpr = $root.pg_query.Node.fromObject(object.funcexpr); + } + if (object.funccolcount != null) + message.funccolcount = object.funccolcount | 0; + if (object.funccolnames) { + if (!Array.isArray(object.funccolnames)) + throw TypeError(".pg_query.RangeTblFunction.funccolnames: array expected"); + message.funccolnames = []; + for (var i = 0; i < object.funccolnames.length; ++i) { + if (typeof object.funccolnames[i] !== "object") + throw TypeError(".pg_query.RangeTblFunction.funccolnames: object expected"); + message.funccolnames[i] = $root.pg_query.Node.fromObject(object.funccolnames[i]); + } + } + if (object.funccoltypes) { + if (!Array.isArray(object.funccoltypes)) + throw TypeError(".pg_query.RangeTblFunction.funccoltypes: array expected"); + message.funccoltypes = []; + for (var i = 0; i < object.funccoltypes.length; ++i) { + if (typeof object.funccoltypes[i] !== "object") + throw TypeError(".pg_query.RangeTblFunction.funccoltypes: object expected"); + message.funccoltypes[i] = $root.pg_query.Node.fromObject(object.funccoltypes[i]); + } + } + if (object.funccoltypmods) { + if (!Array.isArray(object.funccoltypmods)) + throw TypeError(".pg_query.RangeTblFunction.funccoltypmods: array expected"); + message.funccoltypmods = []; + for (var i = 0; i < object.funccoltypmods.length; ++i) { + if (typeof object.funccoltypmods[i] !== "object") + throw TypeError(".pg_query.RangeTblFunction.funccoltypmods: object expected"); + message.funccoltypmods[i] = $root.pg_query.Node.fromObject(object.funccoltypmods[i]); + } + } + if (object.funccolcollations) { + if (!Array.isArray(object.funccolcollations)) + throw TypeError(".pg_query.RangeTblFunction.funccolcollations: array expected"); + message.funccolcollations = []; + for (var i = 0; i < object.funccolcollations.length; ++i) { + if (typeof object.funccolcollations[i] !== "object") + throw TypeError(".pg_query.RangeTblFunction.funccolcollations: object expected"); + message.funccolcollations[i] = $root.pg_query.Node.fromObject(object.funccolcollations[i]); + } + } + if (object.funcparams) { + if (!Array.isArray(object.funcparams)) + throw TypeError(".pg_query.RangeTblFunction.funcparams: array expected"); + message.funcparams = []; + for (var i = 0; i < object.funcparams.length; ++i) + if ($util.Long) + (message.funcparams[i] = $util.Long.fromValue(object.funcparams[i])).unsigned = true; + else if (typeof object.funcparams[i] === "string") + message.funcparams[i] = parseInt(object.funcparams[i], 10); + else if (typeof object.funcparams[i] === "number") + message.funcparams[i] = object.funcparams[i]; + else if (typeof object.funcparams[i] === "object") + message.funcparams[i] = new $util.LongBits(object.funcparams[i].low >>> 0, object.funcparams[i].high >>> 0).toNumber(true); + } + return message; + }; + + /** + * Creates a plain object from a RangeTblFunction message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RangeTblFunction + * @static + * @param {pg_query.RangeTblFunction} message RangeTblFunction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RangeTblFunction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.funccolnames = []; + object.funccoltypes = []; + object.funccoltypmods = []; + object.funccolcollations = []; + object.funcparams = []; + } + if (options.defaults) { + object.funcexpr = null; + object.funccolcount = 0; + } + if (message.funcexpr != null && message.hasOwnProperty("funcexpr")) + object.funcexpr = $root.pg_query.Node.toObject(message.funcexpr, options); + if (message.funccolcount != null && message.hasOwnProperty("funccolcount")) + object.funccolcount = message.funccolcount; + if (message.funccolnames && message.funccolnames.length) { + object.funccolnames = []; + for (var j = 0; j < message.funccolnames.length; ++j) + object.funccolnames[j] = $root.pg_query.Node.toObject(message.funccolnames[j], options); + } + if (message.funccoltypes && message.funccoltypes.length) { + object.funccoltypes = []; + for (var j = 0; j < message.funccoltypes.length; ++j) + object.funccoltypes[j] = $root.pg_query.Node.toObject(message.funccoltypes[j], options); + } + if (message.funccoltypmods && message.funccoltypmods.length) { + object.funccoltypmods = []; + for (var j = 0; j < message.funccoltypmods.length; ++j) + object.funccoltypmods[j] = $root.pg_query.Node.toObject(message.funccoltypmods[j], options); + } + if (message.funccolcollations && message.funccolcollations.length) { + object.funccolcollations = []; + for (var j = 0; j < message.funccolcollations.length; ++j) + object.funccolcollations[j] = $root.pg_query.Node.toObject(message.funccolcollations[j], options); + } + if (message.funcparams && message.funcparams.length) { + object.funcparams = []; + for (var j = 0; j < message.funcparams.length; ++j) + if (typeof message.funcparams[j] === "number") + object.funcparams[j] = options.longs === String ? String(message.funcparams[j]) : message.funcparams[j]; + else + object.funcparams[j] = options.longs === String ? $util.Long.prototype.toString.call(message.funcparams[j]) : options.longs === Number ? new $util.LongBits(message.funcparams[j].low >>> 0, message.funcparams[j].high >>> 0).toNumber(true) : message.funcparams[j]; + } + return object; + }; + + /** + * Converts this RangeTblFunction to JSON. + * @function toJSON + * @memberof pg_query.RangeTblFunction + * @instance + * @returns {Object.} JSON object + */ + RangeTblFunction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RangeTblFunction + * @function getTypeUrl + * @memberof pg_query.RangeTblFunction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RangeTblFunction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RangeTblFunction"; + }; + + return RangeTblFunction; + })(); + + pg_query.TableSampleClause = (function() { + + /** + * Properties of a TableSampleClause. + * @memberof pg_query + * @interface ITableSampleClause + * @property {number|null} [tsmhandler] TableSampleClause tsmhandler + * @property {Array.|null} [args] TableSampleClause args + * @property {pg_query.INode|null} [repeatable] TableSampleClause repeatable + */ + + /** + * Constructs a new TableSampleClause. + * @memberof pg_query + * @classdesc Represents a TableSampleClause. + * @implements ITableSampleClause + * @constructor + * @param {pg_query.ITableSampleClause=} [properties] Properties to set + */ + function TableSampleClause(properties) { + this.args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableSampleClause tsmhandler. + * @member {number} tsmhandler + * @memberof pg_query.TableSampleClause + * @instance + */ + TableSampleClause.prototype.tsmhandler = 0; + + /** + * TableSampleClause args. + * @member {Array.} args + * @memberof pg_query.TableSampleClause + * @instance + */ + TableSampleClause.prototype.args = $util.emptyArray; + + /** + * TableSampleClause repeatable. + * @member {pg_query.INode|null|undefined} repeatable + * @memberof pg_query.TableSampleClause + * @instance + */ + TableSampleClause.prototype.repeatable = null; + + /** + * Creates a new TableSampleClause instance using the specified properties. + * @function create + * @memberof pg_query.TableSampleClause + * @static + * @param {pg_query.ITableSampleClause=} [properties] Properties to set + * @returns {pg_query.TableSampleClause} TableSampleClause instance + */ + TableSampleClause.create = function create(properties) { + return new TableSampleClause(properties); + }; + + /** + * Encodes the specified TableSampleClause message. Does not implicitly {@link pg_query.TableSampleClause.verify|verify} messages. + * @function encode + * @memberof pg_query.TableSampleClause + * @static + * @param {pg_query.ITableSampleClause} message TableSampleClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableSampleClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tsmhandler != null && Object.hasOwnProperty.call(message, "tsmhandler")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.tsmhandler); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + $root.pg_query.Node.encode(message.args[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.repeatable != null && Object.hasOwnProperty.call(message, "repeatable")) + $root.pg_query.Node.encode(message.repeatable, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableSampleClause message, length delimited. Does not implicitly {@link pg_query.TableSampleClause.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.TableSampleClause + * @static + * @param {pg_query.ITableSampleClause} message TableSampleClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableSampleClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableSampleClause message from the specified reader or buffer. + * @function decode + * @memberof pg_query.TableSampleClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.TableSampleClause} TableSampleClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableSampleClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.TableSampleClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tsmhandler = reader.uint32(); + break; + } + case 2: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.repeatable = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableSampleClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.TableSampleClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.TableSampleClause} TableSampleClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableSampleClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableSampleClause message. + * @function verify + * @memberof pg_query.TableSampleClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableSampleClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tsmhandler != null && message.hasOwnProperty("tsmhandler")) + if (!$util.isInteger(message.tsmhandler)) + return "tsmhandler: integer expected"; + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) { + var error = $root.pg_query.Node.verify(message.args[i]); + if (error) + return "args." + error; + } + } + if (message.repeatable != null && message.hasOwnProperty("repeatable")) { + var error = $root.pg_query.Node.verify(message.repeatable); + if (error) + return "repeatable." + error; + } + return null; + }; + + /** + * Creates a TableSampleClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.TableSampleClause + * @static + * @param {Object.} object Plain object + * @returns {pg_query.TableSampleClause} TableSampleClause + */ + TableSampleClause.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.TableSampleClause) + return object; + var message = new $root.pg_query.TableSampleClause(); + if (object.tsmhandler != null) + message.tsmhandler = object.tsmhandler >>> 0; + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".pg_query.TableSampleClause.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) { + if (typeof object.args[i] !== "object") + throw TypeError(".pg_query.TableSampleClause.args: object expected"); + message.args[i] = $root.pg_query.Node.fromObject(object.args[i]); + } + } + if (object.repeatable != null) { + if (typeof object.repeatable !== "object") + throw TypeError(".pg_query.TableSampleClause.repeatable: object expected"); + message.repeatable = $root.pg_query.Node.fromObject(object.repeatable); + } + return message; + }; + + /** + * Creates a plain object from a TableSampleClause message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.TableSampleClause + * @static + * @param {pg_query.TableSampleClause} message TableSampleClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableSampleClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.args = []; + if (options.defaults) { + object.tsmhandler = 0; + object.repeatable = null; + } + if (message.tsmhandler != null && message.hasOwnProperty("tsmhandler")) + object.tsmhandler = message.tsmhandler; + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = $root.pg_query.Node.toObject(message.args[j], options); + } + if (message.repeatable != null && message.hasOwnProperty("repeatable")) + object.repeatable = $root.pg_query.Node.toObject(message.repeatable, options); + return object; + }; + + /** + * Converts this TableSampleClause to JSON. + * @function toJSON + * @memberof pg_query.TableSampleClause + * @instance + * @returns {Object.} JSON object + */ + TableSampleClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableSampleClause + * @function getTypeUrl + * @memberof pg_query.TableSampleClause + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableSampleClause.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.TableSampleClause"; + }; + + return TableSampleClause; + })(); + + pg_query.WithCheckOption = (function() { + + /** + * Properties of a WithCheckOption. + * @memberof pg_query + * @interface IWithCheckOption + * @property {pg_query.WCOKind|null} [kind] WithCheckOption kind + * @property {string|null} [relname] WithCheckOption relname + * @property {string|null} [polname] WithCheckOption polname + * @property {pg_query.INode|null} [qual] WithCheckOption qual + * @property {boolean|null} [cascaded] WithCheckOption cascaded + */ + + /** + * Constructs a new WithCheckOption. + * @memberof pg_query + * @classdesc Represents a WithCheckOption. + * @implements IWithCheckOption + * @constructor + * @param {pg_query.IWithCheckOption=} [properties] Properties to set + */ + function WithCheckOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WithCheckOption kind. + * @member {pg_query.WCOKind} kind + * @memberof pg_query.WithCheckOption + * @instance + */ + WithCheckOption.prototype.kind = 0; + + /** + * WithCheckOption relname. + * @member {string} relname + * @memberof pg_query.WithCheckOption + * @instance + */ + WithCheckOption.prototype.relname = ""; + + /** + * WithCheckOption polname. + * @member {string} polname + * @memberof pg_query.WithCheckOption + * @instance + */ + WithCheckOption.prototype.polname = ""; + + /** + * WithCheckOption qual. + * @member {pg_query.INode|null|undefined} qual + * @memberof pg_query.WithCheckOption + * @instance + */ + WithCheckOption.prototype.qual = null; + + /** + * WithCheckOption cascaded. + * @member {boolean} cascaded + * @memberof pg_query.WithCheckOption + * @instance + */ + WithCheckOption.prototype.cascaded = false; + + /** + * Creates a new WithCheckOption instance using the specified properties. + * @function create + * @memberof pg_query.WithCheckOption + * @static + * @param {pg_query.IWithCheckOption=} [properties] Properties to set + * @returns {pg_query.WithCheckOption} WithCheckOption instance + */ + WithCheckOption.create = function create(properties) { + return new WithCheckOption(properties); + }; + + /** + * Encodes the specified WithCheckOption message. Does not implicitly {@link pg_query.WithCheckOption.verify|verify} messages. + * @function encode + * @memberof pg_query.WithCheckOption + * @static + * @param {pg_query.IWithCheckOption} message WithCheckOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WithCheckOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.relname != null && Object.hasOwnProperty.call(message, "relname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.relname); + if (message.polname != null && Object.hasOwnProperty.call(message, "polname")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.polname); + if (message.qual != null && Object.hasOwnProperty.call(message, "qual")) + $root.pg_query.Node.encode(message.qual, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.cascaded != null && Object.hasOwnProperty.call(message, "cascaded")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.cascaded); + return writer; + }; + + /** + * Encodes the specified WithCheckOption message, length delimited. Does not implicitly {@link pg_query.WithCheckOption.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.WithCheckOption + * @static + * @param {pg_query.IWithCheckOption} message WithCheckOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WithCheckOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WithCheckOption message from the specified reader or buffer. + * @function decode + * @memberof pg_query.WithCheckOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.WithCheckOption} WithCheckOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WithCheckOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.WithCheckOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.relname = reader.string(); + break; + } + case 3: { + message.polname = reader.string(); + break; + } + case 4: { + message.qual = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + message.cascaded = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WithCheckOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.WithCheckOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.WithCheckOption} WithCheckOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WithCheckOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WithCheckOption message. + * @function verify + * @memberof pg_query.WithCheckOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WithCheckOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.relname != null && message.hasOwnProperty("relname")) + if (!$util.isString(message.relname)) + return "relname: string expected"; + if (message.polname != null && message.hasOwnProperty("polname")) + if (!$util.isString(message.polname)) + return "polname: string expected"; + if (message.qual != null && message.hasOwnProperty("qual")) { + var error = $root.pg_query.Node.verify(message.qual); + if (error) + return "qual." + error; + } + if (message.cascaded != null && message.hasOwnProperty("cascaded")) + if (typeof message.cascaded !== "boolean") + return "cascaded: boolean expected"; + return null; + }; + + /** + * Creates a WithCheckOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.WithCheckOption + * @static + * @param {Object.} object Plain object + * @returns {pg_query.WithCheckOption} WithCheckOption + */ + WithCheckOption.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.WithCheckOption) + return object; + var message = new $root.pg_query.WithCheckOption(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "WCOKIND_UNDEFINED": + case 0: + message.kind = 0; + break; + case "WCO_VIEW_CHECK": + case 1: + message.kind = 1; + break; + case "WCO_RLS_INSERT_CHECK": + case 2: + message.kind = 2; + break; + case "WCO_RLS_UPDATE_CHECK": + case 3: + message.kind = 3; + break; + case "WCO_RLS_CONFLICT_CHECK": + case 4: + message.kind = 4; + break; + } + if (object.relname != null) + message.relname = String(object.relname); + if (object.polname != null) + message.polname = String(object.polname); + if (object.qual != null) { + if (typeof object.qual !== "object") + throw TypeError(".pg_query.WithCheckOption.qual: object expected"); + message.qual = $root.pg_query.Node.fromObject(object.qual); + } + if (object.cascaded != null) + message.cascaded = Boolean(object.cascaded); + return message; + }; + + /** + * Creates a plain object from a WithCheckOption message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.WithCheckOption + * @static + * @param {pg_query.WithCheckOption} message WithCheckOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WithCheckOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = options.enums === String ? "WCOKIND_UNDEFINED" : 0; + object.relname = ""; + object.polname = ""; + object.qual = null; + object.cascaded = false; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.pg_query.WCOKind[message.kind] === undefined ? message.kind : $root.pg_query.WCOKind[message.kind] : message.kind; + if (message.relname != null && message.hasOwnProperty("relname")) + object.relname = message.relname; + if (message.polname != null && message.hasOwnProperty("polname")) + object.polname = message.polname; + if (message.qual != null && message.hasOwnProperty("qual")) + object.qual = $root.pg_query.Node.toObject(message.qual, options); + if (message.cascaded != null && message.hasOwnProperty("cascaded")) + object.cascaded = message.cascaded; + return object; + }; + + /** + * Converts this WithCheckOption to JSON. + * @function toJSON + * @memberof pg_query.WithCheckOption + * @instance + * @returns {Object.} JSON object + */ + WithCheckOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WithCheckOption + * @function getTypeUrl + * @memberof pg_query.WithCheckOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WithCheckOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.WithCheckOption"; + }; + + return WithCheckOption; + })(); + + pg_query.SortGroupClause = (function() { + + /** + * Properties of a SortGroupClause. + * @memberof pg_query + * @interface ISortGroupClause + * @property {number|null} [tleSortGroupRef] SortGroupClause tleSortGroupRef + * @property {number|null} [eqop] SortGroupClause eqop + * @property {number|null} [sortop] SortGroupClause sortop + * @property {boolean|null} [nulls_first] SortGroupClause nulls_first + * @property {boolean|null} [hashable] SortGroupClause hashable + */ + + /** + * Constructs a new SortGroupClause. + * @memberof pg_query + * @classdesc Represents a SortGroupClause. + * @implements ISortGroupClause + * @constructor + * @param {pg_query.ISortGroupClause=} [properties] Properties to set + */ + function SortGroupClause(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SortGroupClause tleSortGroupRef. + * @member {number} tleSortGroupRef + * @memberof pg_query.SortGroupClause + * @instance + */ + SortGroupClause.prototype.tleSortGroupRef = 0; + + /** + * SortGroupClause eqop. + * @member {number} eqop + * @memberof pg_query.SortGroupClause + * @instance + */ + SortGroupClause.prototype.eqop = 0; + + /** + * SortGroupClause sortop. + * @member {number} sortop + * @memberof pg_query.SortGroupClause + * @instance + */ + SortGroupClause.prototype.sortop = 0; + + /** + * SortGroupClause nulls_first. + * @member {boolean} nulls_first + * @memberof pg_query.SortGroupClause + * @instance + */ + SortGroupClause.prototype.nulls_first = false; + + /** + * SortGroupClause hashable. + * @member {boolean} hashable + * @memberof pg_query.SortGroupClause + * @instance + */ + SortGroupClause.prototype.hashable = false; + + /** + * Creates a new SortGroupClause instance using the specified properties. + * @function create + * @memberof pg_query.SortGroupClause + * @static + * @param {pg_query.ISortGroupClause=} [properties] Properties to set + * @returns {pg_query.SortGroupClause} SortGroupClause instance + */ + SortGroupClause.create = function create(properties) { + return new SortGroupClause(properties); + }; + + /** + * Encodes the specified SortGroupClause message. Does not implicitly {@link pg_query.SortGroupClause.verify|verify} messages. + * @function encode + * @memberof pg_query.SortGroupClause + * @static + * @param {pg_query.ISortGroupClause} message SortGroupClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SortGroupClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tleSortGroupRef != null && Object.hasOwnProperty.call(message, "tleSortGroupRef")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.tleSortGroupRef); + if (message.eqop != null && Object.hasOwnProperty.call(message, "eqop")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.eqop); + if (message.sortop != null && Object.hasOwnProperty.call(message, "sortop")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.sortop); + if (message.nulls_first != null && Object.hasOwnProperty.call(message, "nulls_first")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.nulls_first); + if (message.hashable != null && Object.hasOwnProperty.call(message, "hashable")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.hashable); + return writer; + }; + + /** + * Encodes the specified SortGroupClause message, length delimited. Does not implicitly {@link pg_query.SortGroupClause.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.SortGroupClause + * @static + * @param {pg_query.ISortGroupClause} message SortGroupClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SortGroupClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SortGroupClause message from the specified reader or buffer. + * @function decode + * @memberof pg_query.SortGroupClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.SortGroupClause} SortGroupClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SortGroupClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.SortGroupClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tleSortGroupRef = reader.uint32(); + break; + } + case 2: { + message.eqop = reader.uint32(); + break; + } + case 3: { + message.sortop = reader.uint32(); + break; + } + case 4: { + message.nulls_first = reader.bool(); + break; + } + case 5: { + message.hashable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SortGroupClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.SortGroupClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.SortGroupClause} SortGroupClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SortGroupClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SortGroupClause message. + * @function verify + * @memberof pg_query.SortGroupClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SortGroupClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tleSortGroupRef != null && message.hasOwnProperty("tleSortGroupRef")) + if (!$util.isInteger(message.tleSortGroupRef)) + return "tleSortGroupRef: integer expected"; + if (message.eqop != null && message.hasOwnProperty("eqop")) + if (!$util.isInteger(message.eqop)) + return "eqop: integer expected"; + if (message.sortop != null && message.hasOwnProperty("sortop")) + if (!$util.isInteger(message.sortop)) + return "sortop: integer expected"; + if (message.nulls_first != null && message.hasOwnProperty("nulls_first")) + if (typeof message.nulls_first !== "boolean") + return "nulls_first: boolean expected"; + if (message.hashable != null && message.hasOwnProperty("hashable")) + if (typeof message.hashable !== "boolean") + return "hashable: boolean expected"; + return null; + }; + + /** + * Creates a SortGroupClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.SortGroupClause + * @static + * @param {Object.} object Plain object + * @returns {pg_query.SortGroupClause} SortGroupClause + */ + SortGroupClause.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.SortGroupClause) + return object; + var message = new $root.pg_query.SortGroupClause(); + if (object.tleSortGroupRef != null) + message.tleSortGroupRef = object.tleSortGroupRef >>> 0; + if (object.eqop != null) + message.eqop = object.eqop >>> 0; + if (object.sortop != null) + message.sortop = object.sortop >>> 0; + if (object.nulls_first != null) + message.nulls_first = Boolean(object.nulls_first); + if (object.hashable != null) + message.hashable = Boolean(object.hashable); + return message; + }; + + /** + * Creates a plain object from a SortGroupClause message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.SortGroupClause + * @static + * @param {pg_query.SortGroupClause} message SortGroupClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SortGroupClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tleSortGroupRef = 0; + object.eqop = 0; + object.sortop = 0; + object.nulls_first = false; + object.hashable = false; + } + if (message.tleSortGroupRef != null && message.hasOwnProperty("tleSortGroupRef")) + object.tleSortGroupRef = message.tleSortGroupRef; + if (message.eqop != null && message.hasOwnProperty("eqop")) + object.eqop = message.eqop; + if (message.sortop != null && message.hasOwnProperty("sortop")) + object.sortop = message.sortop; + if (message.nulls_first != null && message.hasOwnProperty("nulls_first")) + object.nulls_first = message.nulls_first; + if (message.hashable != null && message.hasOwnProperty("hashable")) + object.hashable = message.hashable; + return object; + }; + + /** + * Converts this SortGroupClause to JSON. + * @function toJSON + * @memberof pg_query.SortGroupClause + * @instance + * @returns {Object.} JSON object + */ + SortGroupClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SortGroupClause + * @function getTypeUrl + * @memberof pg_query.SortGroupClause + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SortGroupClause.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.SortGroupClause"; + }; + + return SortGroupClause; + })(); + + pg_query.GroupingSet = (function() { + + /** + * Properties of a GroupingSet. + * @memberof pg_query + * @interface IGroupingSet + * @property {pg_query.GroupingSetKind|null} [kind] GroupingSet kind + * @property {Array.|null} [content] GroupingSet content + * @property {number|null} [location] GroupingSet location + */ + + /** + * Constructs a new GroupingSet. + * @memberof pg_query + * @classdesc Represents a GroupingSet. + * @implements IGroupingSet + * @constructor + * @param {pg_query.IGroupingSet=} [properties] Properties to set + */ + function GroupingSet(properties) { + this.content = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroupingSet kind. + * @member {pg_query.GroupingSetKind} kind + * @memberof pg_query.GroupingSet + * @instance + */ + GroupingSet.prototype.kind = 0; + + /** + * GroupingSet content. + * @member {Array.} content + * @memberof pg_query.GroupingSet + * @instance + */ + GroupingSet.prototype.content = $util.emptyArray; + + /** + * GroupingSet location. + * @member {number} location + * @memberof pg_query.GroupingSet + * @instance + */ + GroupingSet.prototype.location = 0; + + /** + * Creates a new GroupingSet instance using the specified properties. + * @function create + * @memberof pg_query.GroupingSet + * @static + * @param {pg_query.IGroupingSet=} [properties] Properties to set + * @returns {pg_query.GroupingSet} GroupingSet instance + */ + GroupingSet.create = function create(properties) { + return new GroupingSet(properties); + }; + + /** + * Encodes the specified GroupingSet message. Does not implicitly {@link pg_query.GroupingSet.verify|verify} messages. + * @function encode + * @memberof pg_query.GroupingSet + * @static + * @param {pg_query.IGroupingSet} message GroupingSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupingSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.content != null && message.content.length) + for (var i = 0; i < message.content.length; ++i) + $root.pg_query.Node.encode(message.content[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.location); + return writer; + }; + + /** + * Encodes the specified GroupingSet message, length delimited. Does not implicitly {@link pg_query.GroupingSet.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.GroupingSet + * @static + * @param {pg_query.IGroupingSet} message GroupingSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroupingSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroupingSet message from the specified reader or buffer. + * @function decode + * @memberof pg_query.GroupingSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.GroupingSet} GroupingSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupingSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.GroupingSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + if (!(message.content && message.content.length)) + message.content = []; + message.content.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroupingSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.GroupingSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.GroupingSet} GroupingSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroupingSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroupingSet message. + * @function verify + * @memberof pg_query.GroupingSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroupingSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.content != null && message.hasOwnProperty("content")) { + if (!Array.isArray(message.content)) + return "content: array expected"; + for (var i = 0; i < message.content.length; ++i) { + var error = $root.pg_query.Node.verify(message.content[i]); + if (error) + return "content." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a GroupingSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.GroupingSet + * @static + * @param {Object.} object Plain object + * @returns {pg_query.GroupingSet} GroupingSet + */ + GroupingSet.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.GroupingSet) + return object; + var message = new $root.pg_query.GroupingSet(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "GROUPING_SET_KIND_UNDEFINED": + case 0: + message.kind = 0; + break; + case "GROUPING_SET_EMPTY": + case 1: + message.kind = 1; + break; + case "GROUPING_SET_SIMPLE": + case 2: + message.kind = 2; + break; + case "GROUPING_SET_ROLLUP": + case 3: + message.kind = 3; + break; + case "GROUPING_SET_CUBE": + case 4: + message.kind = 4; + break; + case "GROUPING_SET_SETS": + case 5: + message.kind = 5; + break; + } + if (object.content) { + if (!Array.isArray(object.content)) + throw TypeError(".pg_query.GroupingSet.content: array expected"); + message.content = []; + for (var i = 0; i < object.content.length; ++i) { + if (typeof object.content[i] !== "object") + throw TypeError(".pg_query.GroupingSet.content: object expected"); + message.content[i] = $root.pg_query.Node.fromObject(object.content[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a GroupingSet message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.GroupingSet + * @static + * @param {pg_query.GroupingSet} message GroupingSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupingSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.content = []; + if (options.defaults) { + object.kind = options.enums === String ? "GROUPING_SET_KIND_UNDEFINED" : 0; + object.location = 0; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.pg_query.GroupingSetKind[message.kind] === undefined ? message.kind : $root.pg_query.GroupingSetKind[message.kind] : message.kind; + if (message.content && message.content.length) { + object.content = []; + for (var j = 0; j < message.content.length; ++j) + object.content[j] = $root.pg_query.Node.toObject(message.content[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this GroupingSet to JSON. + * @function toJSON + * @memberof pg_query.GroupingSet + * @instance + * @returns {Object.} JSON object + */ + GroupingSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroupingSet + * @function getTypeUrl + * @memberof pg_query.GroupingSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroupingSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.GroupingSet"; + }; + + return GroupingSet; + })(); + + pg_query.WindowClause = (function() { + + /** + * Properties of a WindowClause. + * @memberof pg_query + * @interface IWindowClause + * @property {string|null} [name] WindowClause name + * @property {string|null} [refname] WindowClause refname + * @property {Array.|null} [partitionClause] WindowClause partitionClause + * @property {Array.|null} [orderClause] WindowClause orderClause + * @property {number|null} [frameOptions] WindowClause frameOptions + * @property {pg_query.INode|null} [startOffset] WindowClause startOffset + * @property {pg_query.INode|null} [endOffset] WindowClause endOffset + * @property {number|null} [startInRangeFunc] WindowClause startInRangeFunc + * @property {number|null} [endInRangeFunc] WindowClause endInRangeFunc + * @property {number|null} [inRangeColl] WindowClause inRangeColl + * @property {boolean|null} [inRangeAsc] WindowClause inRangeAsc + * @property {boolean|null} [inRangeNullsFirst] WindowClause inRangeNullsFirst + * @property {number|null} [winref] WindowClause winref + * @property {boolean|null} [copiedOrder] WindowClause copiedOrder + */ + + /** + * Constructs a new WindowClause. + * @memberof pg_query + * @classdesc Represents a WindowClause. + * @implements IWindowClause + * @constructor + * @param {pg_query.IWindowClause=} [properties] Properties to set + */ + function WindowClause(properties) { + this.partitionClause = []; + this.orderClause = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WindowClause name. + * @member {string} name + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.name = ""; + + /** + * WindowClause refname. + * @member {string} refname + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.refname = ""; + + /** + * WindowClause partitionClause. + * @member {Array.} partitionClause + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.partitionClause = $util.emptyArray; + + /** + * WindowClause orderClause. + * @member {Array.} orderClause + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.orderClause = $util.emptyArray; + + /** + * WindowClause frameOptions. + * @member {number} frameOptions + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.frameOptions = 0; + + /** + * WindowClause startOffset. + * @member {pg_query.INode|null|undefined} startOffset + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.startOffset = null; + + /** + * WindowClause endOffset. + * @member {pg_query.INode|null|undefined} endOffset + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.endOffset = null; + + /** + * WindowClause startInRangeFunc. + * @member {number} startInRangeFunc + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.startInRangeFunc = 0; + + /** + * WindowClause endInRangeFunc. + * @member {number} endInRangeFunc + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.endInRangeFunc = 0; + + /** + * WindowClause inRangeColl. + * @member {number} inRangeColl + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.inRangeColl = 0; + + /** + * WindowClause inRangeAsc. + * @member {boolean} inRangeAsc + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.inRangeAsc = false; + + /** + * WindowClause inRangeNullsFirst. + * @member {boolean} inRangeNullsFirst + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.inRangeNullsFirst = false; + + /** + * WindowClause winref. + * @member {number} winref + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.winref = 0; + + /** + * WindowClause copiedOrder. + * @member {boolean} copiedOrder + * @memberof pg_query.WindowClause + * @instance + */ + WindowClause.prototype.copiedOrder = false; + + /** + * Creates a new WindowClause instance using the specified properties. + * @function create + * @memberof pg_query.WindowClause + * @static + * @param {pg_query.IWindowClause=} [properties] Properties to set + * @returns {pg_query.WindowClause} WindowClause instance + */ + WindowClause.create = function create(properties) { + return new WindowClause(properties); + }; + + /** + * Encodes the specified WindowClause message. Does not implicitly {@link pg_query.WindowClause.verify|verify} messages. + * @function encode + * @memberof pg_query.WindowClause + * @static + * @param {pg_query.IWindowClause} message WindowClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.refname != null && Object.hasOwnProperty.call(message, "refname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.refname); + if (message.partitionClause != null && message.partitionClause.length) + for (var i = 0; i < message.partitionClause.length; ++i) + $root.pg_query.Node.encode(message.partitionClause[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.orderClause != null && message.orderClause.length) + for (var i = 0; i < message.orderClause.length; ++i) + $root.pg_query.Node.encode(message.orderClause[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.frameOptions != null && Object.hasOwnProperty.call(message, "frameOptions")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.frameOptions); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + $root.pg_query.Node.encode(message.startOffset, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + $root.pg_query.Node.encode(message.endOffset, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.startInRangeFunc != null && Object.hasOwnProperty.call(message, "startInRangeFunc")) + writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.startInRangeFunc); + if (message.endInRangeFunc != null && Object.hasOwnProperty.call(message, "endInRangeFunc")) + writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.endInRangeFunc); + if (message.inRangeColl != null && Object.hasOwnProperty.call(message, "inRangeColl")) + writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.inRangeColl); + if (message.inRangeAsc != null && Object.hasOwnProperty.call(message, "inRangeAsc")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.inRangeAsc); + if (message.inRangeNullsFirst != null && Object.hasOwnProperty.call(message, "inRangeNullsFirst")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.inRangeNullsFirst); + if (message.winref != null && Object.hasOwnProperty.call(message, "winref")) + writer.uint32(/* id 13, wireType 0 =*/104).uint32(message.winref); + if (message.copiedOrder != null && Object.hasOwnProperty.call(message, "copiedOrder")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.copiedOrder); + return writer; + }; + + /** + * Encodes the specified WindowClause message, length delimited. Does not implicitly {@link pg_query.WindowClause.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.WindowClause + * @static + * @param {pg_query.IWindowClause} message WindowClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowClause message from the specified reader or buffer. + * @function decode + * @memberof pg_query.WindowClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.WindowClause} WindowClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.WindowClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.refname = reader.string(); + break; + } + case 3: { + if (!(message.partitionClause && message.partitionClause.length)) + message.partitionClause = []; + message.partitionClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.orderClause && message.orderClause.length)) + message.orderClause = []; + message.orderClause.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.frameOptions = reader.int32(); + break; + } + case 6: { + message.startOffset = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 7: { + message.endOffset = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 8: { + message.startInRangeFunc = reader.uint32(); + break; + } + case 9: { + message.endInRangeFunc = reader.uint32(); + break; + } + case 10: { + message.inRangeColl = reader.uint32(); + break; + } + case 11: { + message.inRangeAsc = reader.bool(); + break; + } + case 12: { + message.inRangeNullsFirst = reader.bool(); + break; + } + case 13: { + message.winref = reader.uint32(); + break; + } + case 14: { + message.copiedOrder = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.WindowClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.WindowClause} WindowClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowClause message. + * @function verify + * @memberof pg_query.WindowClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.refname != null && message.hasOwnProperty("refname")) + if (!$util.isString(message.refname)) + return "refname: string expected"; + if (message.partitionClause != null && message.hasOwnProperty("partitionClause")) { + if (!Array.isArray(message.partitionClause)) + return "partitionClause: array expected"; + for (var i = 0; i < message.partitionClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.partitionClause[i]); + if (error) + return "partitionClause." + error; + } + } + if (message.orderClause != null && message.hasOwnProperty("orderClause")) { + if (!Array.isArray(message.orderClause)) + return "orderClause: array expected"; + for (var i = 0; i < message.orderClause.length; ++i) { + var error = $root.pg_query.Node.verify(message.orderClause[i]); + if (error) + return "orderClause." + error; + } + } + if (message.frameOptions != null && message.hasOwnProperty("frameOptions")) + if (!$util.isInteger(message.frameOptions)) + return "frameOptions: integer expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) { + var error = $root.pg_query.Node.verify(message.startOffset); + if (error) + return "startOffset." + error; + } + if (message.endOffset != null && message.hasOwnProperty("endOffset")) { + var error = $root.pg_query.Node.verify(message.endOffset); + if (error) + return "endOffset." + error; + } + if (message.startInRangeFunc != null && message.hasOwnProperty("startInRangeFunc")) + if (!$util.isInteger(message.startInRangeFunc)) + return "startInRangeFunc: integer expected"; + if (message.endInRangeFunc != null && message.hasOwnProperty("endInRangeFunc")) + if (!$util.isInteger(message.endInRangeFunc)) + return "endInRangeFunc: integer expected"; + if (message.inRangeColl != null && message.hasOwnProperty("inRangeColl")) + if (!$util.isInteger(message.inRangeColl)) + return "inRangeColl: integer expected"; + if (message.inRangeAsc != null && message.hasOwnProperty("inRangeAsc")) + if (typeof message.inRangeAsc !== "boolean") + return "inRangeAsc: boolean expected"; + if (message.inRangeNullsFirst != null && message.hasOwnProperty("inRangeNullsFirst")) + if (typeof message.inRangeNullsFirst !== "boolean") + return "inRangeNullsFirst: boolean expected"; + if (message.winref != null && message.hasOwnProperty("winref")) + if (!$util.isInteger(message.winref)) + return "winref: integer expected"; + if (message.copiedOrder != null && message.hasOwnProperty("copiedOrder")) + if (typeof message.copiedOrder !== "boolean") + return "copiedOrder: boolean expected"; + return null; + }; + + /** + * Creates a WindowClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.WindowClause + * @static + * @param {Object.} object Plain object + * @returns {pg_query.WindowClause} WindowClause + */ + WindowClause.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.WindowClause) + return object; + var message = new $root.pg_query.WindowClause(); + if (object.name != null) + message.name = String(object.name); + if (object.refname != null) + message.refname = String(object.refname); + if (object.partitionClause) { + if (!Array.isArray(object.partitionClause)) + throw TypeError(".pg_query.WindowClause.partitionClause: array expected"); + message.partitionClause = []; + for (var i = 0; i < object.partitionClause.length; ++i) { + if (typeof object.partitionClause[i] !== "object") + throw TypeError(".pg_query.WindowClause.partitionClause: object expected"); + message.partitionClause[i] = $root.pg_query.Node.fromObject(object.partitionClause[i]); + } + } + if (object.orderClause) { + if (!Array.isArray(object.orderClause)) + throw TypeError(".pg_query.WindowClause.orderClause: array expected"); + message.orderClause = []; + for (var i = 0; i < object.orderClause.length; ++i) { + if (typeof object.orderClause[i] !== "object") + throw TypeError(".pg_query.WindowClause.orderClause: object expected"); + message.orderClause[i] = $root.pg_query.Node.fromObject(object.orderClause[i]); + } + } + if (object.frameOptions != null) + message.frameOptions = object.frameOptions | 0; + if (object.startOffset != null) { + if (typeof object.startOffset !== "object") + throw TypeError(".pg_query.WindowClause.startOffset: object expected"); + message.startOffset = $root.pg_query.Node.fromObject(object.startOffset); + } + if (object.endOffset != null) { + if (typeof object.endOffset !== "object") + throw TypeError(".pg_query.WindowClause.endOffset: object expected"); + message.endOffset = $root.pg_query.Node.fromObject(object.endOffset); + } + if (object.startInRangeFunc != null) + message.startInRangeFunc = object.startInRangeFunc >>> 0; + if (object.endInRangeFunc != null) + message.endInRangeFunc = object.endInRangeFunc >>> 0; + if (object.inRangeColl != null) + message.inRangeColl = object.inRangeColl >>> 0; + if (object.inRangeAsc != null) + message.inRangeAsc = Boolean(object.inRangeAsc); + if (object.inRangeNullsFirst != null) + message.inRangeNullsFirst = Boolean(object.inRangeNullsFirst); + if (object.winref != null) + message.winref = object.winref >>> 0; + if (object.copiedOrder != null) + message.copiedOrder = Boolean(object.copiedOrder); + return message; + }; + + /** + * Creates a plain object from a WindowClause message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.WindowClause + * @static + * @param {pg_query.WindowClause} message WindowClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.partitionClause = []; + object.orderClause = []; + } + if (options.defaults) { + object.name = ""; + object.refname = ""; + object.frameOptions = 0; + object.startOffset = null; + object.endOffset = null; + object.startInRangeFunc = 0; + object.endInRangeFunc = 0; + object.inRangeColl = 0; + object.inRangeAsc = false; + object.inRangeNullsFirst = false; + object.winref = 0; + object.copiedOrder = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.refname != null && message.hasOwnProperty("refname")) + object.refname = message.refname; + if (message.partitionClause && message.partitionClause.length) { + object.partitionClause = []; + for (var j = 0; j < message.partitionClause.length; ++j) + object.partitionClause[j] = $root.pg_query.Node.toObject(message.partitionClause[j], options); + } + if (message.orderClause && message.orderClause.length) { + object.orderClause = []; + for (var j = 0; j < message.orderClause.length; ++j) + object.orderClause[j] = $root.pg_query.Node.toObject(message.orderClause[j], options); + } + if (message.frameOptions != null && message.hasOwnProperty("frameOptions")) + object.frameOptions = message.frameOptions; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + object.startOffset = $root.pg_query.Node.toObject(message.startOffset, options); + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + object.endOffset = $root.pg_query.Node.toObject(message.endOffset, options); + if (message.startInRangeFunc != null && message.hasOwnProperty("startInRangeFunc")) + object.startInRangeFunc = message.startInRangeFunc; + if (message.endInRangeFunc != null && message.hasOwnProperty("endInRangeFunc")) + object.endInRangeFunc = message.endInRangeFunc; + if (message.inRangeColl != null && message.hasOwnProperty("inRangeColl")) + object.inRangeColl = message.inRangeColl; + if (message.inRangeAsc != null && message.hasOwnProperty("inRangeAsc")) + object.inRangeAsc = message.inRangeAsc; + if (message.inRangeNullsFirst != null && message.hasOwnProperty("inRangeNullsFirst")) + object.inRangeNullsFirst = message.inRangeNullsFirst; + if (message.winref != null && message.hasOwnProperty("winref")) + object.winref = message.winref; + if (message.copiedOrder != null && message.hasOwnProperty("copiedOrder")) + object.copiedOrder = message.copiedOrder; + return object; + }; + + /** + * Converts this WindowClause to JSON. + * @function toJSON + * @memberof pg_query.WindowClause + * @instance + * @returns {Object.} JSON object + */ + WindowClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowClause + * @function getTypeUrl + * @memberof pg_query.WindowClause + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowClause.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.WindowClause"; + }; + + return WindowClause; + })(); + + pg_query.ObjectWithArgs = (function() { + + /** + * Properties of an ObjectWithArgs. + * @memberof pg_query + * @interface IObjectWithArgs + * @property {Array.|null} [objname] ObjectWithArgs objname + * @property {Array.|null} [objargs] ObjectWithArgs objargs + * @property {boolean|null} [args_unspecified] ObjectWithArgs args_unspecified + */ + + /** + * Constructs a new ObjectWithArgs. + * @memberof pg_query + * @classdesc Represents an ObjectWithArgs. + * @implements IObjectWithArgs + * @constructor + * @param {pg_query.IObjectWithArgs=} [properties] Properties to set + */ + function ObjectWithArgs(properties) { + this.objname = []; + this.objargs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ObjectWithArgs objname. + * @member {Array.} objname + * @memberof pg_query.ObjectWithArgs + * @instance + */ + ObjectWithArgs.prototype.objname = $util.emptyArray; + + /** + * ObjectWithArgs objargs. + * @member {Array.} objargs + * @memberof pg_query.ObjectWithArgs + * @instance + */ + ObjectWithArgs.prototype.objargs = $util.emptyArray; + + /** + * ObjectWithArgs args_unspecified. + * @member {boolean} args_unspecified + * @memberof pg_query.ObjectWithArgs + * @instance + */ + ObjectWithArgs.prototype.args_unspecified = false; + + /** + * Creates a new ObjectWithArgs instance using the specified properties. + * @function create + * @memberof pg_query.ObjectWithArgs + * @static + * @param {pg_query.IObjectWithArgs=} [properties] Properties to set + * @returns {pg_query.ObjectWithArgs} ObjectWithArgs instance + */ + ObjectWithArgs.create = function create(properties) { + return new ObjectWithArgs(properties); + }; + + /** + * Encodes the specified ObjectWithArgs message. Does not implicitly {@link pg_query.ObjectWithArgs.verify|verify} messages. + * @function encode + * @memberof pg_query.ObjectWithArgs + * @static + * @param {pg_query.IObjectWithArgs} message ObjectWithArgs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectWithArgs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.objname != null && message.objname.length) + for (var i = 0; i < message.objname.length; ++i) + $root.pg_query.Node.encode(message.objname[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.objargs != null && message.objargs.length) + for (var i = 0; i < message.objargs.length; ++i) + $root.pg_query.Node.encode(message.objargs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.args_unspecified != null && Object.hasOwnProperty.call(message, "args_unspecified")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.args_unspecified); + return writer; + }; + + /** + * Encodes the specified ObjectWithArgs message, length delimited. Does not implicitly {@link pg_query.ObjectWithArgs.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ObjectWithArgs + * @static + * @param {pg_query.IObjectWithArgs} message ObjectWithArgs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObjectWithArgs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObjectWithArgs message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ObjectWithArgs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ObjectWithArgs} ObjectWithArgs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectWithArgs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ObjectWithArgs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.objname && message.objname.length)) + message.objname = []; + message.objname.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.objargs && message.objargs.length)) + message.objargs = []; + message.objargs.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.args_unspecified = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObjectWithArgs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ObjectWithArgs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ObjectWithArgs} ObjectWithArgs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObjectWithArgs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObjectWithArgs message. + * @function verify + * @memberof pg_query.ObjectWithArgs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObjectWithArgs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.objname != null && message.hasOwnProperty("objname")) { + if (!Array.isArray(message.objname)) + return "objname: array expected"; + for (var i = 0; i < message.objname.length; ++i) { + var error = $root.pg_query.Node.verify(message.objname[i]); + if (error) + return "objname." + error; + } + } + if (message.objargs != null && message.hasOwnProperty("objargs")) { + if (!Array.isArray(message.objargs)) + return "objargs: array expected"; + for (var i = 0; i < message.objargs.length; ++i) { + var error = $root.pg_query.Node.verify(message.objargs[i]); + if (error) + return "objargs." + error; + } + } + if (message.args_unspecified != null && message.hasOwnProperty("args_unspecified")) + if (typeof message.args_unspecified !== "boolean") + return "args_unspecified: boolean expected"; + return null; + }; + + /** + * Creates an ObjectWithArgs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ObjectWithArgs + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ObjectWithArgs} ObjectWithArgs + */ + ObjectWithArgs.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ObjectWithArgs) + return object; + var message = new $root.pg_query.ObjectWithArgs(); + if (object.objname) { + if (!Array.isArray(object.objname)) + throw TypeError(".pg_query.ObjectWithArgs.objname: array expected"); + message.objname = []; + for (var i = 0; i < object.objname.length; ++i) { + if (typeof object.objname[i] !== "object") + throw TypeError(".pg_query.ObjectWithArgs.objname: object expected"); + message.objname[i] = $root.pg_query.Node.fromObject(object.objname[i]); + } + } + if (object.objargs) { + if (!Array.isArray(object.objargs)) + throw TypeError(".pg_query.ObjectWithArgs.objargs: array expected"); + message.objargs = []; + for (var i = 0; i < object.objargs.length; ++i) { + if (typeof object.objargs[i] !== "object") + throw TypeError(".pg_query.ObjectWithArgs.objargs: object expected"); + message.objargs[i] = $root.pg_query.Node.fromObject(object.objargs[i]); + } + } + if (object.args_unspecified != null) + message.args_unspecified = Boolean(object.args_unspecified); + return message; + }; + + /** + * Creates a plain object from an ObjectWithArgs message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ObjectWithArgs + * @static + * @param {pg_query.ObjectWithArgs} message ObjectWithArgs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObjectWithArgs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.objname = []; + object.objargs = []; + } + if (options.defaults) + object.args_unspecified = false; + if (message.objname && message.objname.length) { + object.objname = []; + for (var j = 0; j < message.objname.length; ++j) + object.objname[j] = $root.pg_query.Node.toObject(message.objname[j], options); + } + if (message.objargs && message.objargs.length) { + object.objargs = []; + for (var j = 0; j < message.objargs.length; ++j) + object.objargs[j] = $root.pg_query.Node.toObject(message.objargs[j], options); + } + if (message.args_unspecified != null && message.hasOwnProperty("args_unspecified")) + object.args_unspecified = message.args_unspecified; + return object; + }; + + /** + * Converts this ObjectWithArgs to JSON. + * @function toJSON + * @memberof pg_query.ObjectWithArgs + * @instance + * @returns {Object.} JSON object + */ + ObjectWithArgs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ObjectWithArgs + * @function getTypeUrl + * @memberof pg_query.ObjectWithArgs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ObjectWithArgs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ObjectWithArgs"; + }; + + return ObjectWithArgs; + })(); + + pg_query.AccessPriv = (function() { + + /** + * Properties of an AccessPriv. + * @memberof pg_query + * @interface IAccessPriv + * @property {string|null} [priv_name] AccessPriv priv_name + * @property {Array.|null} [cols] AccessPriv cols + */ + + /** + * Constructs a new AccessPriv. + * @memberof pg_query + * @classdesc Represents an AccessPriv. + * @implements IAccessPriv + * @constructor + * @param {pg_query.IAccessPriv=} [properties] Properties to set + */ + function AccessPriv(properties) { + this.cols = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessPriv priv_name. + * @member {string} priv_name + * @memberof pg_query.AccessPriv + * @instance + */ + AccessPriv.prototype.priv_name = ""; + + /** + * AccessPriv cols. + * @member {Array.} cols + * @memberof pg_query.AccessPriv + * @instance + */ + AccessPriv.prototype.cols = $util.emptyArray; + + /** + * Creates a new AccessPriv instance using the specified properties. + * @function create + * @memberof pg_query.AccessPriv + * @static + * @param {pg_query.IAccessPriv=} [properties] Properties to set + * @returns {pg_query.AccessPriv} AccessPriv instance + */ + AccessPriv.create = function create(properties) { + return new AccessPriv(properties); + }; + + /** + * Encodes the specified AccessPriv message. Does not implicitly {@link pg_query.AccessPriv.verify|verify} messages. + * @function encode + * @memberof pg_query.AccessPriv + * @static + * @param {pg_query.IAccessPriv} message AccessPriv message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessPriv.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priv_name != null && Object.hasOwnProperty.call(message, "priv_name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.priv_name); + if (message.cols != null && message.cols.length) + for (var i = 0; i < message.cols.length; ++i) + $root.pg_query.Node.encode(message.cols[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessPriv message, length delimited. Does not implicitly {@link pg_query.AccessPriv.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.AccessPriv + * @static + * @param {pg_query.IAccessPriv} message AccessPriv message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessPriv.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessPriv message from the specified reader or buffer. + * @function decode + * @memberof pg_query.AccessPriv + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.AccessPriv} AccessPriv + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessPriv.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.AccessPriv(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.priv_name = reader.string(); + break; + } + case 2: { + if (!(message.cols && message.cols.length)) + message.cols = []; + message.cols.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessPriv message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.AccessPriv + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.AccessPriv} AccessPriv + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessPriv.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessPriv message. + * @function verify + * @memberof pg_query.AccessPriv + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessPriv.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priv_name != null && message.hasOwnProperty("priv_name")) + if (!$util.isString(message.priv_name)) + return "priv_name: string expected"; + if (message.cols != null && message.hasOwnProperty("cols")) { + if (!Array.isArray(message.cols)) + return "cols: array expected"; + for (var i = 0; i < message.cols.length; ++i) { + var error = $root.pg_query.Node.verify(message.cols[i]); + if (error) + return "cols." + error; + } + } + return null; + }; + + /** + * Creates an AccessPriv message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.AccessPriv + * @static + * @param {Object.} object Plain object + * @returns {pg_query.AccessPriv} AccessPriv + */ + AccessPriv.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.AccessPriv) + return object; + var message = new $root.pg_query.AccessPriv(); + if (object.priv_name != null) + message.priv_name = String(object.priv_name); + if (object.cols) { + if (!Array.isArray(object.cols)) + throw TypeError(".pg_query.AccessPriv.cols: array expected"); + message.cols = []; + for (var i = 0; i < object.cols.length; ++i) { + if (typeof object.cols[i] !== "object") + throw TypeError(".pg_query.AccessPriv.cols: object expected"); + message.cols[i] = $root.pg_query.Node.fromObject(object.cols[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AccessPriv message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.AccessPriv + * @static + * @param {pg_query.AccessPriv} message AccessPriv + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessPriv.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cols = []; + if (options.defaults) + object.priv_name = ""; + if (message.priv_name != null && message.hasOwnProperty("priv_name")) + object.priv_name = message.priv_name; + if (message.cols && message.cols.length) { + object.cols = []; + for (var j = 0; j < message.cols.length; ++j) + object.cols[j] = $root.pg_query.Node.toObject(message.cols[j], options); + } + return object; + }; + + /** + * Converts this AccessPriv to JSON. + * @function toJSON + * @memberof pg_query.AccessPriv + * @instance + * @returns {Object.} JSON object + */ + AccessPriv.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessPriv + * @function getTypeUrl + * @memberof pg_query.AccessPriv + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessPriv.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.AccessPriv"; + }; + + return AccessPriv; + })(); + + pg_query.CreateOpClassItem = (function() { + + /** + * Properties of a CreateOpClassItem. + * @memberof pg_query + * @interface ICreateOpClassItem + * @property {number|null} [itemtype] CreateOpClassItem itemtype + * @property {pg_query.IObjectWithArgs|null} [name] CreateOpClassItem name + * @property {number|null} [number] CreateOpClassItem number + * @property {Array.|null} [order_family] CreateOpClassItem order_family + * @property {Array.|null} [class_args] CreateOpClassItem class_args + * @property {pg_query.ITypeName|null} [storedtype] CreateOpClassItem storedtype + */ + + /** + * Constructs a new CreateOpClassItem. + * @memberof pg_query + * @classdesc Represents a CreateOpClassItem. + * @implements ICreateOpClassItem + * @constructor + * @param {pg_query.ICreateOpClassItem=} [properties] Properties to set + */ + function CreateOpClassItem(properties) { + this.order_family = []; + this.class_args = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateOpClassItem itemtype. + * @member {number} itemtype + * @memberof pg_query.CreateOpClassItem + * @instance + */ + CreateOpClassItem.prototype.itemtype = 0; + + /** + * CreateOpClassItem name. + * @member {pg_query.IObjectWithArgs|null|undefined} name + * @memberof pg_query.CreateOpClassItem + * @instance + */ + CreateOpClassItem.prototype.name = null; + + /** + * CreateOpClassItem number. + * @member {number} number + * @memberof pg_query.CreateOpClassItem + * @instance + */ + CreateOpClassItem.prototype.number = 0; + + /** + * CreateOpClassItem order_family. + * @member {Array.} order_family + * @memberof pg_query.CreateOpClassItem + * @instance + */ + CreateOpClassItem.prototype.order_family = $util.emptyArray; + + /** + * CreateOpClassItem class_args. + * @member {Array.} class_args + * @memberof pg_query.CreateOpClassItem + * @instance + */ + CreateOpClassItem.prototype.class_args = $util.emptyArray; + + /** + * CreateOpClassItem storedtype. + * @member {pg_query.ITypeName|null|undefined} storedtype + * @memberof pg_query.CreateOpClassItem + * @instance + */ + CreateOpClassItem.prototype.storedtype = null; + + /** + * Creates a new CreateOpClassItem instance using the specified properties. + * @function create + * @memberof pg_query.CreateOpClassItem + * @static + * @param {pg_query.ICreateOpClassItem=} [properties] Properties to set + * @returns {pg_query.CreateOpClassItem} CreateOpClassItem instance + */ + CreateOpClassItem.create = function create(properties) { + return new CreateOpClassItem(properties); + }; + + /** + * Encodes the specified CreateOpClassItem message. Does not implicitly {@link pg_query.CreateOpClassItem.verify|verify} messages. + * @function encode + * @memberof pg_query.CreateOpClassItem + * @static + * @param {pg_query.ICreateOpClassItem} message CreateOpClassItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateOpClassItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.itemtype != null && Object.hasOwnProperty.call(message, "itemtype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.itemtype); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + $root.pg_query.ObjectWithArgs.encode(message.name, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.order_family != null && message.order_family.length) + for (var i = 0; i < message.order_family.length; ++i) + $root.pg_query.Node.encode(message.order_family[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.class_args != null && message.class_args.length) + for (var i = 0; i < message.class_args.length; ++i) + $root.pg_query.Node.encode(message.class_args[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.storedtype != null && Object.hasOwnProperty.call(message, "storedtype")) + $root.pg_query.TypeName.encode(message.storedtype, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateOpClassItem message, length delimited. Does not implicitly {@link pg_query.CreateOpClassItem.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CreateOpClassItem + * @static + * @param {pg_query.ICreateOpClassItem} message CreateOpClassItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateOpClassItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateOpClassItem message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CreateOpClassItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CreateOpClassItem} CreateOpClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateOpClassItem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CreateOpClassItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.itemtype = reader.int32(); + break; + } + case 2: { + message.name = $root.pg_query.ObjectWithArgs.decode(reader, reader.uint32()); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + if (!(message.order_family && message.order_family.length)) + message.order_family = []; + message.order_family.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.class_args && message.class_args.length)) + message.class_args = []; + message.class_args.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + message.storedtype = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateOpClassItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CreateOpClassItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CreateOpClassItem} CreateOpClassItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateOpClassItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateOpClassItem message. + * @function verify + * @memberof pg_query.CreateOpClassItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateOpClassItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.itemtype != null && message.hasOwnProperty("itemtype")) + if (!$util.isInteger(message.itemtype)) + return "itemtype: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) { + var error = $root.pg_query.ObjectWithArgs.verify(message.name); + if (error) + return "name." + error; + } + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.order_family != null && message.hasOwnProperty("order_family")) { + if (!Array.isArray(message.order_family)) + return "order_family: array expected"; + for (var i = 0; i < message.order_family.length; ++i) { + var error = $root.pg_query.Node.verify(message.order_family[i]); + if (error) + return "order_family." + error; + } + } + if (message.class_args != null && message.hasOwnProperty("class_args")) { + if (!Array.isArray(message.class_args)) + return "class_args: array expected"; + for (var i = 0; i < message.class_args.length; ++i) { + var error = $root.pg_query.Node.verify(message.class_args[i]); + if (error) + return "class_args." + error; + } + } + if (message.storedtype != null && message.hasOwnProperty("storedtype")) { + var error = $root.pg_query.TypeName.verify(message.storedtype); + if (error) + return "storedtype." + error; + } + return null; + }; + + /** + * Creates a CreateOpClassItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CreateOpClassItem + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CreateOpClassItem} CreateOpClassItem + */ + CreateOpClassItem.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CreateOpClassItem) + return object; + var message = new $root.pg_query.CreateOpClassItem(); + if (object.itemtype != null) + message.itemtype = object.itemtype | 0; + if (object.name != null) { + if (typeof object.name !== "object") + throw TypeError(".pg_query.CreateOpClassItem.name: object expected"); + message.name = $root.pg_query.ObjectWithArgs.fromObject(object.name); + } + if (object.number != null) + message.number = object.number | 0; + if (object.order_family) { + if (!Array.isArray(object.order_family)) + throw TypeError(".pg_query.CreateOpClassItem.order_family: array expected"); + message.order_family = []; + for (var i = 0; i < object.order_family.length; ++i) { + if (typeof object.order_family[i] !== "object") + throw TypeError(".pg_query.CreateOpClassItem.order_family: object expected"); + message.order_family[i] = $root.pg_query.Node.fromObject(object.order_family[i]); + } + } + if (object.class_args) { + if (!Array.isArray(object.class_args)) + throw TypeError(".pg_query.CreateOpClassItem.class_args: array expected"); + message.class_args = []; + for (var i = 0; i < object.class_args.length; ++i) { + if (typeof object.class_args[i] !== "object") + throw TypeError(".pg_query.CreateOpClassItem.class_args: object expected"); + message.class_args[i] = $root.pg_query.Node.fromObject(object.class_args[i]); + } + } + if (object.storedtype != null) { + if (typeof object.storedtype !== "object") + throw TypeError(".pg_query.CreateOpClassItem.storedtype: object expected"); + message.storedtype = $root.pg_query.TypeName.fromObject(object.storedtype); + } + return message; + }; + + /** + * Creates a plain object from a CreateOpClassItem message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CreateOpClassItem + * @static + * @param {pg_query.CreateOpClassItem} message CreateOpClassItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateOpClassItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.order_family = []; + object.class_args = []; + } + if (options.defaults) { + object.itemtype = 0; + object.name = null; + object.number = 0; + object.storedtype = null; + } + if (message.itemtype != null && message.hasOwnProperty("itemtype")) + object.itemtype = message.itemtype; + if (message.name != null && message.hasOwnProperty("name")) + object.name = $root.pg_query.ObjectWithArgs.toObject(message.name, options); + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.order_family && message.order_family.length) { + object.order_family = []; + for (var j = 0; j < message.order_family.length; ++j) + object.order_family[j] = $root.pg_query.Node.toObject(message.order_family[j], options); + } + if (message.class_args && message.class_args.length) { + object.class_args = []; + for (var j = 0; j < message.class_args.length; ++j) + object.class_args[j] = $root.pg_query.Node.toObject(message.class_args[j], options); + } + if (message.storedtype != null && message.hasOwnProperty("storedtype")) + object.storedtype = $root.pg_query.TypeName.toObject(message.storedtype, options); + return object; + }; + + /** + * Converts this CreateOpClassItem to JSON. + * @function toJSON + * @memberof pg_query.CreateOpClassItem + * @instance + * @returns {Object.} JSON object + */ + CreateOpClassItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateOpClassItem + * @function getTypeUrl + * @memberof pg_query.CreateOpClassItem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateOpClassItem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CreateOpClassItem"; + }; + + return CreateOpClassItem; + })(); + + pg_query.TableLikeClause = (function() { + + /** + * Properties of a TableLikeClause. + * @memberof pg_query + * @interface ITableLikeClause + * @property {pg_query.IRangeVar|null} [relation] TableLikeClause relation + * @property {number|null} [options] TableLikeClause options + * @property {number|null} [relationOid] TableLikeClause relationOid + */ + + /** + * Constructs a new TableLikeClause. + * @memberof pg_query + * @classdesc Represents a TableLikeClause. + * @implements ITableLikeClause + * @constructor + * @param {pg_query.ITableLikeClause=} [properties] Properties to set + */ + function TableLikeClause(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableLikeClause relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.TableLikeClause + * @instance + */ + TableLikeClause.prototype.relation = null; + + /** + * TableLikeClause options. + * @member {number} options + * @memberof pg_query.TableLikeClause + * @instance + */ + TableLikeClause.prototype.options = 0; + + /** + * TableLikeClause relationOid. + * @member {number} relationOid + * @memberof pg_query.TableLikeClause + * @instance + */ + TableLikeClause.prototype.relationOid = 0; + + /** + * Creates a new TableLikeClause instance using the specified properties. + * @function create + * @memberof pg_query.TableLikeClause + * @static + * @param {pg_query.ITableLikeClause=} [properties] Properties to set + * @returns {pg_query.TableLikeClause} TableLikeClause instance + */ + TableLikeClause.create = function create(properties) { + return new TableLikeClause(properties); + }; + + /** + * Encodes the specified TableLikeClause message. Does not implicitly {@link pg_query.TableLikeClause.verify|verify} messages. + * @function encode + * @memberof pg_query.TableLikeClause + * @static + * @param {pg_query.ITableLikeClause} message TableLikeClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableLikeClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.options); + if (message.relationOid != null && Object.hasOwnProperty.call(message, "relationOid")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.relationOid); + return writer; + }; + + /** + * Encodes the specified TableLikeClause message, length delimited. Does not implicitly {@link pg_query.TableLikeClause.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.TableLikeClause + * @static + * @param {pg_query.ITableLikeClause} message TableLikeClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableLikeClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableLikeClause message from the specified reader or buffer. + * @function decode + * @memberof pg_query.TableLikeClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.TableLikeClause} TableLikeClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableLikeClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.TableLikeClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + message.options = reader.uint32(); + break; + } + case 3: { + message.relationOid = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableLikeClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.TableLikeClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.TableLikeClause} TableLikeClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableLikeClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableLikeClause message. + * @function verify + * @memberof pg_query.TableLikeClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableLikeClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.options != null && message.hasOwnProperty("options")) + if (!$util.isInteger(message.options)) + return "options: integer expected"; + if (message.relationOid != null && message.hasOwnProperty("relationOid")) + if (!$util.isInteger(message.relationOid)) + return "relationOid: integer expected"; + return null; + }; + + /** + * Creates a TableLikeClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.TableLikeClause + * @static + * @param {Object.} object Plain object + * @returns {pg_query.TableLikeClause} TableLikeClause + */ + TableLikeClause.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.TableLikeClause) + return object; + var message = new $root.pg_query.TableLikeClause(); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.TableLikeClause.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.options != null) + message.options = object.options >>> 0; + if (object.relationOid != null) + message.relationOid = object.relationOid >>> 0; + return message; + }; + + /** + * Creates a plain object from a TableLikeClause message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.TableLikeClause + * @static + * @param {pg_query.TableLikeClause} message TableLikeClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableLikeClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.relation = null; + object.options = 0; + object.relationOid = 0; + } + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.options != null && message.hasOwnProperty("options")) + object.options = message.options; + if (message.relationOid != null && message.hasOwnProperty("relationOid")) + object.relationOid = message.relationOid; + return object; + }; + + /** + * Converts this TableLikeClause to JSON. + * @function toJSON + * @memberof pg_query.TableLikeClause + * @instance + * @returns {Object.} JSON object + */ + TableLikeClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableLikeClause + * @function getTypeUrl + * @memberof pg_query.TableLikeClause + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableLikeClause.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.TableLikeClause"; + }; + + return TableLikeClause; + })(); + + pg_query.FunctionParameter = (function() { + + /** + * Properties of a FunctionParameter. + * @memberof pg_query + * @interface IFunctionParameter + * @property {string|null} [name] FunctionParameter name + * @property {pg_query.ITypeName|null} [argType] FunctionParameter argType + * @property {pg_query.FunctionParameterMode|null} [mode] FunctionParameter mode + * @property {pg_query.INode|null} [defexpr] FunctionParameter defexpr + */ + + /** + * Constructs a new FunctionParameter. + * @memberof pg_query + * @classdesc Represents a FunctionParameter. + * @implements IFunctionParameter + * @constructor + * @param {pg_query.IFunctionParameter=} [properties] Properties to set + */ + function FunctionParameter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FunctionParameter name. + * @member {string} name + * @memberof pg_query.FunctionParameter + * @instance + */ + FunctionParameter.prototype.name = ""; + + /** + * FunctionParameter argType. + * @member {pg_query.ITypeName|null|undefined} argType + * @memberof pg_query.FunctionParameter + * @instance + */ + FunctionParameter.prototype.argType = null; + + /** + * FunctionParameter mode. + * @member {pg_query.FunctionParameterMode} mode + * @memberof pg_query.FunctionParameter + * @instance + */ + FunctionParameter.prototype.mode = 0; + + /** + * FunctionParameter defexpr. + * @member {pg_query.INode|null|undefined} defexpr + * @memberof pg_query.FunctionParameter + * @instance + */ + FunctionParameter.prototype.defexpr = null; + + /** + * Creates a new FunctionParameter instance using the specified properties. + * @function create + * @memberof pg_query.FunctionParameter + * @static + * @param {pg_query.IFunctionParameter=} [properties] Properties to set + * @returns {pg_query.FunctionParameter} FunctionParameter instance + */ + FunctionParameter.create = function create(properties) { + return new FunctionParameter(properties); + }; + + /** + * Encodes the specified FunctionParameter message. Does not implicitly {@link pg_query.FunctionParameter.verify|verify} messages. + * @function encode + * @memberof pg_query.FunctionParameter + * @static + * @param {pg_query.IFunctionParameter} message FunctionParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.argType != null && Object.hasOwnProperty.call(message, "argType")) + $root.pg_query.TypeName.encode(message.argType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mode); + if (message.defexpr != null && Object.hasOwnProperty.call(message, "defexpr")) + $root.pg_query.Node.encode(message.defexpr, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunctionParameter message, length delimited. Does not implicitly {@link pg_query.FunctionParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.FunctionParameter + * @static + * @param {pg_query.IFunctionParameter} message FunctionParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunctionParameter message from the specified reader or buffer. + * @function decode + * @memberof pg_query.FunctionParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.FunctionParameter} FunctionParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionParameter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.FunctionParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.argType = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 3: { + message.mode = reader.int32(); + break; + } + case 4: { + message.defexpr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunctionParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.FunctionParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.FunctionParameter} FunctionParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunctionParameter message. + * @function verify + * @memberof pg_query.FunctionParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunctionParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.argType != null && message.hasOwnProperty("argType")) { + var error = $root.pg_query.TypeName.verify(message.argType); + if (error) + return "argType." + error; + } + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.defexpr != null && message.hasOwnProperty("defexpr")) { + var error = $root.pg_query.Node.verify(message.defexpr); + if (error) + return "defexpr." + error; + } + return null; + }; + + /** + * Creates a FunctionParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.FunctionParameter + * @static + * @param {Object.} object Plain object + * @returns {pg_query.FunctionParameter} FunctionParameter + */ + FunctionParameter.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.FunctionParameter) + return object; + var message = new $root.pg_query.FunctionParameter(); + if (object.name != null) + message.name = String(object.name); + if (object.argType != null) { + if (typeof object.argType !== "object") + throw TypeError(".pg_query.FunctionParameter.argType: object expected"); + message.argType = $root.pg_query.TypeName.fromObject(object.argType); + } + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "FUNCTION_PARAMETER_MODE_UNDEFINED": + case 0: + message.mode = 0; + break; + case "FUNC_PARAM_IN": + case 1: + message.mode = 1; + break; + case "FUNC_PARAM_OUT": + case 2: + message.mode = 2; + break; + case "FUNC_PARAM_INOUT": + case 3: + message.mode = 3; + break; + case "FUNC_PARAM_VARIADIC": + case 4: + message.mode = 4; + break; + case "FUNC_PARAM_TABLE": + case 5: + message.mode = 5; + break; + } + if (object.defexpr != null) { + if (typeof object.defexpr !== "object") + throw TypeError(".pg_query.FunctionParameter.defexpr: object expected"); + message.defexpr = $root.pg_query.Node.fromObject(object.defexpr); + } + return message; + }; + + /** + * Creates a plain object from a FunctionParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.FunctionParameter + * @static + * @param {pg_query.FunctionParameter} message FunctionParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunctionParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.argType = null; + object.mode = options.enums === String ? "FUNCTION_PARAMETER_MODE_UNDEFINED" : 0; + object.defexpr = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.argType != null && message.hasOwnProperty("argType")) + object.argType = $root.pg_query.TypeName.toObject(message.argType, options); + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.pg_query.FunctionParameterMode[message.mode] === undefined ? message.mode : $root.pg_query.FunctionParameterMode[message.mode] : message.mode; + if (message.defexpr != null && message.hasOwnProperty("defexpr")) + object.defexpr = $root.pg_query.Node.toObject(message.defexpr, options); + return object; + }; + + /** + * Converts this FunctionParameter to JSON. + * @function toJSON + * @memberof pg_query.FunctionParameter + * @instance + * @returns {Object.} JSON object + */ + FunctionParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunctionParameter + * @function getTypeUrl + * @memberof pg_query.FunctionParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunctionParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.FunctionParameter"; + }; + + return FunctionParameter; + })(); + + pg_query.LockingClause = (function() { + + /** + * Properties of a LockingClause. + * @memberof pg_query + * @interface ILockingClause + * @property {Array.|null} [lockedRels] LockingClause lockedRels + * @property {pg_query.LockClauseStrength|null} [strength] LockingClause strength + * @property {pg_query.LockWaitPolicy|null} [waitPolicy] LockingClause waitPolicy + */ + + /** + * Constructs a new LockingClause. + * @memberof pg_query + * @classdesc Represents a LockingClause. + * @implements ILockingClause + * @constructor + * @param {pg_query.ILockingClause=} [properties] Properties to set + */ + function LockingClause(properties) { + this.lockedRels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LockingClause lockedRels. + * @member {Array.} lockedRels + * @memberof pg_query.LockingClause + * @instance + */ + LockingClause.prototype.lockedRels = $util.emptyArray; + + /** + * LockingClause strength. + * @member {pg_query.LockClauseStrength} strength + * @memberof pg_query.LockingClause + * @instance + */ + LockingClause.prototype.strength = 0; + + /** + * LockingClause waitPolicy. + * @member {pg_query.LockWaitPolicy} waitPolicy + * @memberof pg_query.LockingClause + * @instance + */ + LockingClause.prototype.waitPolicy = 0; + + /** + * Creates a new LockingClause instance using the specified properties. + * @function create + * @memberof pg_query.LockingClause + * @static + * @param {pg_query.ILockingClause=} [properties] Properties to set + * @returns {pg_query.LockingClause} LockingClause instance + */ + LockingClause.create = function create(properties) { + return new LockingClause(properties); + }; + + /** + * Encodes the specified LockingClause message. Does not implicitly {@link pg_query.LockingClause.verify|verify} messages. + * @function encode + * @memberof pg_query.LockingClause + * @static + * @param {pg_query.ILockingClause} message LockingClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LockingClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lockedRels != null && message.lockedRels.length) + for (var i = 0; i < message.lockedRels.length; ++i) + $root.pg_query.Node.encode(message.lockedRels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.strength != null && Object.hasOwnProperty.call(message, "strength")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.strength); + if (message.waitPolicy != null && Object.hasOwnProperty.call(message, "waitPolicy")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.waitPolicy); + return writer; + }; + + /** + * Encodes the specified LockingClause message, length delimited. Does not implicitly {@link pg_query.LockingClause.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.LockingClause + * @static + * @param {pg_query.ILockingClause} message LockingClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LockingClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LockingClause message from the specified reader or buffer. + * @function decode + * @memberof pg_query.LockingClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.LockingClause} LockingClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LockingClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.LockingClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.lockedRels && message.lockedRels.length)) + message.lockedRels = []; + message.lockedRels.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.strength = reader.int32(); + break; + } + case 3: { + message.waitPolicy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LockingClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.LockingClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.LockingClause} LockingClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LockingClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LockingClause message. + * @function verify + * @memberof pg_query.LockingClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LockingClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lockedRels != null && message.hasOwnProperty("lockedRels")) { + if (!Array.isArray(message.lockedRels)) + return "lockedRels: array expected"; + for (var i = 0; i < message.lockedRels.length; ++i) { + var error = $root.pg_query.Node.verify(message.lockedRels[i]); + if (error) + return "lockedRels." + error; + } + } + if (message.strength != null && message.hasOwnProperty("strength")) + switch (message.strength) { + default: + return "strength: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.waitPolicy != null && message.hasOwnProperty("waitPolicy")) + switch (message.waitPolicy) { + default: + return "waitPolicy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a LockingClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.LockingClause + * @static + * @param {Object.} object Plain object + * @returns {pg_query.LockingClause} LockingClause + */ + LockingClause.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.LockingClause) + return object; + var message = new $root.pg_query.LockingClause(); + if (object.lockedRels) { + if (!Array.isArray(object.lockedRels)) + throw TypeError(".pg_query.LockingClause.lockedRels: array expected"); + message.lockedRels = []; + for (var i = 0; i < object.lockedRels.length; ++i) { + if (typeof object.lockedRels[i] !== "object") + throw TypeError(".pg_query.LockingClause.lockedRels: object expected"); + message.lockedRels[i] = $root.pg_query.Node.fromObject(object.lockedRels[i]); + } + } + switch (object.strength) { + default: + if (typeof object.strength === "number") { + message.strength = object.strength; + break; + } + break; + case "LOCK_CLAUSE_STRENGTH_UNDEFINED": + case 0: + message.strength = 0; + break; + case "LCS_NONE": + case 1: + message.strength = 1; + break; + case "LCS_FORKEYSHARE": + case 2: + message.strength = 2; + break; + case "LCS_FORSHARE": + case 3: + message.strength = 3; + break; + case "LCS_FORNOKEYUPDATE": + case 4: + message.strength = 4; + break; + case "LCS_FORUPDATE": + case 5: + message.strength = 5; + break; + } + switch (object.waitPolicy) { + default: + if (typeof object.waitPolicy === "number") { + message.waitPolicy = object.waitPolicy; + break; + } + break; + case "LOCK_WAIT_POLICY_UNDEFINED": + case 0: + message.waitPolicy = 0; + break; + case "LockWaitBlock": + case 1: + message.waitPolicy = 1; + break; + case "LockWaitSkip": + case 2: + message.waitPolicy = 2; + break; + case "LockWaitError": + case 3: + message.waitPolicy = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a LockingClause message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.LockingClause + * @static + * @param {pg_query.LockingClause} message LockingClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LockingClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.lockedRels = []; + if (options.defaults) { + object.strength = options.enums === String ? "LOCK_CLAUSE_STRENGTH_UNDEFINED" : 0; + object.waitPolicy = options.enums === String ? "LOCK_WAIT_POLICY_UNDEFINED" : 0; + } + if (message.lockedRels && message.lockedRels.length) { + object.lockedRels = []; + for (var j = 0; j < message.lockedRels.length; ++j) + object.lockedRels[j] = $root.pg_query.Node.toObject(message.lockedRels[j], options); + } + if (message.strength != null && message.hasOwnProperty("strength")) + object.strength = options.enums === String ? $root.pg_query.LockClauseStrength[message.strength] === undefined ? message.strength : $root.pg_query.LockClauseStrength[message.strength] : message.strength; + if (message.waitPolicy != null && message.hasOwnProperty("waitPolicy")) + object.waitPolicy = options.enums === String ? $root.pg_query.LockWaitPolicy[message.waitPolicy] === undefined ? message.waitPolicy : $root.pg_query.LockWaitPolicy[message.waitPolicy] : message.waitPolicy; + return object; + }; + + /** + * Converts this LockingClause to JSON. + * @function toJSON + * @memberof pg_query.LockingClause + * @instance + * @returns {Object.} JSON object + */ + LockingClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LockingClause + * @function getTypeUrl + * @memberof pg_query.LockingClause + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LockingClause.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.LockingClause"; + }; + + return LockingClause; + })(); + + pg_query.RowMarkClause = (function() { + + /** + * Properties of a RowMarkClause. + * @memberof pg_query + * @interface IRowMarkClause + * @property {number|null} [rti] RowMarkClause rti + * @property {pg_query.LockClauseStrength|null} [strength] RowMarkClause strength + * @property {pg_query.LockWaitPolicy|null} [waitPolicy] RowMarkClause waitPolicy + * @property {boolean|null} [pushedDown] RowMarkClause pushedDown + */ + + /** + * Constructs a new RowMarkClause. + * @memberof pg_query + * @classdesc Represents a RowMarkClause. + * @implements IRowMarkClause + * @constructor + * @param {pg_query.IRowMarkClause=} [properties] Properties to set + */ + function RowMarkClause(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RowMarkClause rti. + * @member {number} rti + * @memberof pg_query.RowMarkClause + * @instance + */ + RowMarkClause.prototype.rti = 0; + + /** + * RowMarkClause strength. + * @member {pg_query.LockClauseStrength} strength + * @memberof pg_query.RowMarkClause + * @instance + */ + RowMarkClause.prototype.strength = 0; + + /** + * RowMarkClause waitPolicy. + * @member {pg_query.LockWaitPolicy} waitPolicy + * @memberof pg_query.RowMarkClause + * @instance + */ + RowMarkClause.prototype.waitPolicy = 0; + + /** + * RowMarkClause pushedDown. + * @member {boolean} pushedDown + * @memberof pg_query.RowMarkClause + * @instance + */ + RowMarkClause.prototype.pushedDown = false; + + /** + * Creates a new RowMarkClause instance using the specified properties. + * @function create + * @memberof pg_query.RowMarkClause + * @static + * @param {pg_query.IRowMarkClause=} [properties] Properties to set + * @returns {pg_query.RowMarkClause} RowMarkClause instance + */ + RowMarkClause.create = function create(properties) { + return new RowMarkClause(properties); + }; + + /** + * Encodes the specified RowMarkClause message. Does not implicitly {@link pg_query.RowMarkClause.verify|verify} messages. + * @function encode + * @memberof pg_query.RowMarkClause + * @static + * @param {pg_query.IRowMarkClause} message RowMarkClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowMarkClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rti != null && Object.hasOwnProperty.call(message, "rti")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.rti); + if (message.strength != null && Object.hasOwnProperty.call(message, "strength")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.strength); + if (message.waitPolicy != null && Object.hasOwnProperty.call(message, "waitPolicy")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.waitPolicy); + if (message.pushedDown != null && Object.hasOwnProperty.call(message, "pushedDown")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.pushedDown); + return writer; + }; + + /** + * Encodes the specified RowMarkClause message, length delimited. Does not implicitly {@link pg_query.RowMarkClause.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RowMarkClause + * @static + * @param {pg_query.IRowMarkClause} message RowMarkClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RowMarkClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RowMarkClause message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RowMarkClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RowMarkClause} RowMarkClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowMarkClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RowMarkClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rti = reader.uint32(); + break; + } + case 2: { + message.strength = reader.int32(); + break; + } + case 3: { + message.waitPolicy = reader.int32(); + break; + } + case 4: { + message.pushedDown = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RowMarkClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RowMarkClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RowMarkClause} RowMarkClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RowMarkClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RowMarkClause message. + * @function verify + * @memberof pg_query.RowMarkClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RowMarkClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rti != null && message.hasOwnProperty("rti")) + if (!$util.isInteger(message.rti)) + return "rti: integer expected"; + if (message.strength != null && message.hasOwnProperty("strength")) + switch (message.strength) { + default: + return "strength: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.waitPolicy != null && message.hasOwnProperty("waitPolicy")) + switch (message.waitPolicy) { + default: + return "waitPolicy: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.pushedDown != null && message.hasOwnProperty("pushedDown")) + if (typeof message.pushedDown !== "boolean") + return "pushedDown: boolean expected"; + return null; + }; + + /** + * Creates a RowMarkClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RowMarkClause + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RowMarkClause} RowMarkClause + */ + RowMarkClause.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RowMarkClause) + return object; + var message = new $root.pg_query.RowMarkClause(); + if (object.rti != null) + message.rti = object.rti >>> 0; + switch (object.strength) { + default: + if (typeof object.strength === "number") { + message.strength = object.strength; + break; + } + break; + case "LOCK_CLAUSE_STRENGTH_UNDEFINED": + case 0: + message.strength = 0; + break; + case "LCS_NONE": + case 1: + message.strength = 1; + break; + case "LCS_FORKEYSHARE": + case 2: + message.strength = 2; + break; + case "LCS_FORSHARE": + case 3: + message.strength = 3; + break; + case "LCS_FORNOKEYUPDATE": + case 4: + message.strength = 4; + break; + case "LCS_FORUPDATE": + case 5: + message.strength = 5; + break; + } + switch (object.waitPolicy) { + default: + if (typeof object.waitPolicy === "number") { + message.waitPolicy = object.waitPolicy; + break; + } + break; + case "LOCK_WAIT_POLICY_UNDEFINED": + case 0: + message.waitPolicy = 0; + break; + case "LockWaitBlock": + case 1: + message.waitPolicy = 1; + break; + case "LockWaitSkip": + case 2: + message.waitPolicy = 2; + break; + case "LockWaitError": + case 3: + message.waitPolicy = 3; + break; + } + if (object.pushedDown != null) + message.pushedDown = Boolean(object.pushedDown); + return message; + }; + + /** + * Creates a plain object from a RowMarkClause message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RowMarkClause + * @static + * @param {pg_query.RowMarkClause} message RowMarkClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RowMarkClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rti = 0; + object.strength = options.enums === String ? "LOCK_CLAUSE_STRENGTH_UNDEFINED" : 0; + object.waitPolicy = options.enums === String ? "LOCK_WAIT_POLICY_UNDEFINED" : 0; + object.pushedDown = false; + } + if (message.rti != null && message.hasOwnProperty("rti")) + object.rti = message.rti; + if (message.strength != null && message.hasOwnProperty("strength")) + object.strength = options.enums === String ? $root.pg_query.LockClauseStrength[message.strength] === undefined ? message.strength : $root.pg_query.LockClauseStrength[message.strength] : message.strength; + if (message.waitPolicy != null && message.hasOwnProperty("waitPolicy")) + object.waitPolicy = options.enums === String ? $root.pg_query.LockWaitPolicy[message.waitPolicy] === undefined ? message.waitPolicy : $root.pg_query.LockWaitPolicy[message.waitPolicy] : message.waitPolicy; + if (message.pushedDown != null && message.hasOwnProperty("pushedDown")) + object.pushedDown = message.pushedDown; + return object; + }; + + /** + * Converts this RowMarkClause to JSON. + * @function toJSON + * @memberof pg_query.RowMarkClause + * @instance + * @returns {Object.} JSON object + */ + RowMarkClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RowMarkClause + * @function getTypeUrl + * @memberof pg_query.RowMarkClause + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RowMarkClause.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RowMarkClause"; + }; + + return RowMarkClause; + })(); + + pg_query.XmlSerialize = (function() { + + /** + * Properties of a XmlSerialize. + * @memberof pg_query + * @interface IXmlSerialize + * @property {pg_query.XmlOptionType|null} [xmloption] XmlSerialize xmloption + * @property {pg_query.INode|null} [expr] XmlSerialize expr + * @property {pg_query.ITypeName|null} [typeName] XmlSerialize typeName + * @property {number|null} [location] XmlSerialize location + */ + + /** + * Constructs a new XmlSerialize. + * @memberof pg_query + * @classdesc Represents a XmlSerialize. + * @implements IXmlSerialize + * @constructor + * @param {pg_query.IXmlSerialize=} [properties] Properties to set + */ + function XmlSerialize(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * XmlSerialize xmloption. + * @member {pg_query.XmlOptionType} xmloption + * @memberof pg_query.XmlSerialize + * @instance + */ + XmlSerialize.prototype.xmloption = 0; + + /** + * XmlSerialize expr. + * @member {pg_query.INode|null|undefined} expr + * @memberof pg_query.XmlSerialize + * @instance + */ + XmlSerialize.prototype.expr = null; + + /** + * XmlSerialize typeName. + * @member {pg_query.ITypeName|null|undefined} typeName + * @memberof pg_query.XmlSerialize + * @instance + */ + XmlSerialize.prototype.typeName = null; + + /** + * XmlSerialize location. + * @member {number} location + * @memberof pg_query.XmlSerialize + * @instance + */ + XmlSerialize.prototype.location = 0; + + /** + * Creates a new XmlSerialize instance using the specified properties. + * @function create + * @memberof pg_query.XmlSerialize + * @static + * @param {pg_query.IXmlSerialize=} [properties] Properties to set + * @returns {pg_query.XmlSerialize} XmlSerialize instance + */ + XmlSerialize.create = function create(properties) { + return new XmlSerialize(properties); + }; + + /** + * Encodes the specified XmlSerialize message. Does not implicitly {@link pg_query.XmlSerialize.verify|verify} messages. + * @function encode + * @memberof pg_query.XmlSerialize + * @static + * @param {pg_query.IXmlSerialize} message XmlSerialize message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + XmlSerialize.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xmloption != null && Object.hasOwnProperty.call(message, "xmloption")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.xmloption); + if (message.expr != null && Object.hasOwnProperty.call(message, "expr")) + $root.pg_query.Node.encode(message.expr, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + $root.pg_query.TypeName.encode(message.typeName, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.location); + return writer; + }; + + /** + * Encodes the specified XmlSerialize message, length delimited. Does not implicitly {@link pg_query.XmlSerialize.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.XmlSerialize + * @static + * @param {pg_query.IXmlSerialize} message XmlSerialize message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + XmlSerialize.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a XmlSerialize message from the specified reader or buffer. + * @function decode + * @memberof pg_query.XmlSerialize + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.XmlSerialize} XmlSerialize + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + XmlSerialize.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.XmlSerialize(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.xmloption = reader.int32(); + break; + } + case 2: { + message.expr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.typeName = $root.pg_query.TypeName.decode(reader, reader.uint32()); + break; + } + case 4: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a XmlSerialize message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.XmlSerialize + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.XmlSerialize} XmlSerialize + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + XmlSerialize.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a XmlSerialize message. + * @function verify + * @memberof pg_query.XmlSerialize + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + XmlSerialize.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xmloption != null && message.hasOwnProperty("xmloption")) + switch (message.xmloption) { + default: + return "xmloption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.expr != null && message.hasOwnProperty("expr")) { + var error = $root.pg_query.Node.verify(message.expr); + if (error) + return "expr." + error; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) { + var error = $root.pg_query.TypeName.verify(message.typeName); + if (error) + return "typeName." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a XmlSerialize message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.XmlSerialize + * @static + * @param {Object.} object Plain object + * @returns {pg_query.XmlSerialize} XmlSerialize + */ + XmlSerialize.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.XmlSerialize) + return object; + var message = new $root.pg_query.XmlSerialize(); + switch (object.xmloption) { + default: + if (typeof object.xmloption === "number") { + message.xmloption = object.xmloption; + break; + } + break; + case "XML_OPTION_TYPE_UNDEFINED": + case 0: + message.xmloption = 0; + break; + case "XMLOPTION_DOCUMENT": + case 1: + message.xmloption = 1; + break; + case "XMLOPTION_CONTENT": + case 2: + message.xmloption = 2; + break; + } + if (object.expr != null) { + if (typeof object.expr !== "object") + throw TypeError(".pg_query.XmlSerialize.expr: object expected"); + message.expr = $root.pg_query.Node.fromObject(object.expr); + } + if (object.typeName != null) { + if (typeof object.typeName !== "object") + throw TypeError(".pg_query.XmlSerialize.typeName: object expected"); + message.typeName = $root.pg_query.TypeName.fromObject(object.typeName); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a XmlSerialize message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.XmlSerialize + * @static + * @param {pg_query.XmlSerialize} message XmlSerialize + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + XmlSerialize.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xmloption = options.enums === String ? "XML_OPTION_TYPE_UNDEFINED" : 0; + object.expr = null; + object.typeName = null; + object.location = 0; + } + if (message.xmloption != null && message.hasOwnProperty("xmloption")) + object.xmloption = options.enums === String ? $root.pg_query.XmlOptionType[message.xmloption] === undefined ? message.xmloption : $root.pg_query.XmlOptionType[message.xmloption] : message.xmloption; + if (message.expr != null && message.hasOwnProperty("expr")) + object.expr = $root.pg_query.Node.toObject(message.expr, options); + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = $root.pg_query.TypeName.toObject(message.typeName, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this XmlSerialize to JSON. + * @function toJSON + * @memberof pg_query.XmlSerialize + * @instance + * @returns {Object.} JSON object + */ + XmlSerialize.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for XmlSerialize + * @function getTypeUrl + * @memberof pg_query.XmlSerialize + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + XmlSerialize.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.XmlSerialize"; + }; + + return XmlSerialize; + })(); + + pg_query.WithClause = (function() { + + /** + * Properties of a WithClause. + * @memberof pg_query + * @interface IWithClause + * @property {Array.|null} [ctes] WithClause ctes + * @property {boolean|null} [recursive] WithClause recursive + * @property {number|null} [location] WithClause location + */ + + /** + * Constructs a new WithClause. + * @memberof pg_query + * @classdesc Represents a WithClause. + * @implements IWithClause + * @constructor + * @param {pg_query.IWithClause=} [properties] Properties to set + */ + function WithClause(properties) { + this.ctes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WithClause ctes. + * @member {Array.} ctes + * @memberof pg_query.WithClause + * @instance + */ + WithClause.prototype.ctes = $util.emptyArray; + + /** + * WithClause recursive. + * @member {boolean} recursive + * @memberof pg_query.WithClause + * @instance + */ + WithClause.prototype.recursive = false; + + /** + * WithClause location. + * @member {number} location + * @memberof pg_query.WithClause + * @instance + */ + WithClause.prototype.location = 0; + + /** + * Creates a new WithClause instance using the specified properties. + * @function create + * @memberof pg_query.WithClause + * @static + * @param {pg_query.IWithClause=} [properties] Properties to set + * @returns {pg_query.WithClause} WithClause instance + */ + WithClause.create = function create(properties) { + return new WithClause(properties); + }; + + /** + * Encodes the specified WithClause message. Does not implicitly {@link pg_query.WithClause.verify|verify} messages. + * @function encode + * @memberof pg_query.WithClause + * @static + * @param {pg_query.IWithClause} message WithClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WithClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctes != null && message.ctes.length) + for (var i = 0; i < message.ctes.length; ++i) + $root.pg_query.Node.encode(message.ctes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recursive != null && Object.hasOwnProperty.call(message, "recursive")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.recursive); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.location); + return writer; + }; + + /** + * Encodes the specified WithClause message, length delimited. Does not implicitly {@link pg_query.WithClause.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.WithClause + * @static + * @param {pg_query.IWithClause} message WithClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WithClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WithClause message from the specified reader or buffer. + * @function decode + * @memberof pg_query.WithClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.WithClause} WithClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WithClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.WithClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ctes && message.ctes.length)) + message.ctes = []; + message.ctes.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.recursive = reader.bool(); + break; + } + case 3: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WithClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.WithClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.WithClause} WithClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WithClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WithClause message. + * @function verify + * @memberof pg_query.WithClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WithClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctes != null && message.hasOwnProperty("ctes")) { + if (!Array.isArray(message.ctes)) + return "ctes: array expected"; + for (var i = 0; i < message.ctes.length; ++i) { + var error = $root.pg_query.Node.verify(message.ctes[i]); + if (error) + return "ctes." + error; + } + } + if (message.recursive != null && message.hasOwnProperty("recursive")) + if (typeof message.recursive !== "boolean") + return "recursive: boolean expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a WithClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.WithClause + * @static + * @param {Object.} object Plain object + * @returns {pg_query.WithClause} WithClause + */ + WithClause.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.WithClause) + return object; + var message = new $root.pg_query.WithClause(); + if (object.ctes) { + if (!Array.isArray(object.ctes)) + throw TypeError(".pg_query.WithClause.ctes: array expected"); + message.ctes = []; + for (var i = 0; i < object.ctes.length; ++i) { + if (typeof object.ctes[i] !== "object") + throw TypeError(".pg_query.WithClause.ctes: object expected"); + message.ctes[i] = $root.pg_query.Node.fromObject(object.ctes[i]); + } + } + if (object.recursive != null) + message.recursive = Boolean(object.recursive); + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a WithClause message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.WithClause + * @static + * @param {pg_query.WithClause} message WithClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WithClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ctes = []; + if (options.defaults) { + object.recursive = false; + object.location = 0; + } + if (message.ctes && message.ctes.length) { + object.ctes = []; + for (var j = 0; j < message.ctes.length; ++j) + object.ctes[j] = $root.pg_query.Node.toObject(message.ctes[j], options); + } + if (message.recursive != null && message.hasOwnProperty("recursive")) + object.recursive = message.recursive; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this WithClause to JSON. + * @function toJSON + * @memberof pg_query.WithClause + * @instance + * @returns {Object.} JSON object + */ + WithClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WithClause + * @function getTypeUrl + * @memberof pg_query.WithClause + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WithClause.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.WithClause"; + }; + + return WithClause; + })(); + + pg_query.InferClause = (function() { + + /** + * Properties of an InferClause. + * @memberof pg_query + * @interface IInferClause + * @property {Array.|null} [indexElems] InferClause indexElems + * @property {pg_query.INode|null} [whereClause] InferClause whereClause + * @property {string|null} [conname] InferClause conname + * @property {number|null} [location] InferClause location + */ + + /** + * Constructs a new InferClause. + * @memberof pg_query + * @classdesc Represents an InferClause. + * @implements IInferClause + * @constructor + * @param {pg_query.IInferClause=} [properties] Properties to set + */ + function InferClause(properties) { + this.indexElems = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InferClause indexElems. + * @member {Array.} indexElems + * @memberof pg_query.InferClause + * @instance + */ + InferClause.prototype.indexElems = $util.emptyArray; + + /** + * InferClause whereClause. + * @member {pg_query.INode|null|undefined} whereClause + * @memberof pg_query.InferClause + * @instance + */ + InferClause.prototype.whereClause = null; + + /** + * InferClause conname. + * @member {string} conname + * @memberof pg_query.InferClause + * @instance + */ + InferClause.prototype.conname = ""; + + /** + * InferClause location. + * @member {number} location + * @memberof pg_query.InferClause + * @instance + */ + InferClause.prototype.location = 0; + + /** + * Creates a new InferClause instance using the specified properties. + * @function create + * @memberof pg_query.InferClause + * @static + * @param {pg_query.IInferClause=} [properties] Properties to set + * @returns {pg_query.InferClause} InferClause instance + */ + InferClause.create = function create(properties) { + return new InferClause(properties); + }; + + /** + * Encodes the specified InferClause message. Does not implicitly {@link pg_query.InferClause.verify|verify} messages. + * @function encode + * @memberof pg_query.InferClause + * @static + * @param {pg_query.IInferClause} message InferClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InferClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indexElems != null && message.indexElems.length) + for (var i = 0; i < message.indexElems.length; ++i) + $root.pg_query.Node.encode(message.indexElems[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.whereClause != null && Object.hasOwnProperty.call(message, "whereClause")) + $root.pg_query.Node.encode(message.whereClause, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.conname != null && Object.hasOwnProperty.call(message, "conname")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.conname); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.location); + return writer; + }; + + /** + * Encodes the specified InferClause message, length delimited. Does not implicitly {@link pg_query.InferClause.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.InferClause + * @static + * @param {pg_query.IInferClause} message InferClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InferClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InferClause message from the specified reader or buffer. + * @function decode + * @memberof pg_query.InferClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.InferClause} InferClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InferClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.InferClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.indexElems && message.indexElems.length)) + message.indexElems = []; + message.indexElems.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 2: { + message.whereClause = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.conname = reader.string(); + break; + } + case 4: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InferClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.InferClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.InferClause} InferClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InferClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InferClause message. + * @function verify + * @memberof pg_query.InferClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InferClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.indexElems != null && message.hasOwnProperty("indexElems")) { + if (!Array.isArray(message.indexElems)) + return "indexElems: array expected"; + for (var i = 0; i < message.indexElems.length; ++i) { + var error = $root.pg_query.Node.verify(message.indexElems[i]); + if (error) + return "indexElems." + error; + } + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) { + var error = $root.pg_query.Node.verify(message.whereClause); + if (error) + return "whereClause." + error; + } + if (message.conname != null && message.hasOwnProperty("conname")) + if (!$util.isString(message.conname)) + return "conname: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates an InferClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.InferClause + * @static + * @param {Object.} object Plain object + * @returns {pg_query.InferClause} InferClause + */ + InferClause.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.InferClause) + return object; + var message = new $root.pg_query.InferClause(); + if (object.indexElems) { + if (!Array.isArray(object.indexElems)) + throw TypeError(".pg_query.InferClause.indexElems: array expected"); + message.indexElems = []; + for (var i = 0; i < object.indexElems.length; ++i) { + if (typeof object.indexElems[i] !== "object") + throw TypeError(".pg_query.InferClause.indexElems: object expected"); + message.indexElems[i] = $root.pg_query.Node.fromObject(object.indexElems[i]); + } + } + if (object.whereClause != null) { + if (typeof object.whereClause !== "object") + throw TypeError(".pg_query.InferClause.whereClause: object expected"); + message.whereClause = $root.pg_query.Node.fromObject(object.whereClause); + } + if (object.conname != null) + message.conname = String(object.conname); + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from an InferClause message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.InferClause + * @static + * @param {pg_query.InferClause} message InferClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InferClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexElems = []; + if (options.defaults) { + object.whereClause = null; + object.conname = ""; + object.location = 0; + } + if (message.indexElems && message.indexElems.length) { + object.indexElems = []; + for (var j = 0; j < message.indexElems.length; ++j) + object.indexElems[j] = $root.pg_query.Node.toObject(message.indexElems[j], options); + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) + object.whereClause = $root.pg_query.Node.toObject(message.whereClause, options); + if (message.conname != null && message.hasOwnProperty("conname")) + object.conname = message.conname; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this InferClause to JSON. + * @function toJSON + * @memberof pg_query.InferClause + * @instance + * @returns {Object.} JSON object + */ + InferClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InferClause + * @function getTypeUrl + * @memberof pg_query.InferClause + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InferClause.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.InferClause"; + }; + + return InferClause; + })(); + + pg_query.OnConflictClause = (function() { + + /** + * Properties of an OnConflictClause. + * @memberof pg_query + * @interface IOnConflictClause + * @property {pg_query.OnConflictAction|null} [action] OnConflictClause action + * @property {pg_query.IInferClause|null} [infer] OnConflictClause infer + * @property {Array.|null} [targetList] OnConflictClause targetList + * @property {pg_query.INode|null} [whereClause] OnConflictClause whereClause + * @property {number|null} [location] OnConflictClause location + */ + + /** + * Constructs a new OnConflictClause. + * @memberof pg_query + * @classdesc Represents an OnConflictClause. + * @implements IOnConflictClause + * @constructor + * @param {pg_query.IOnConflictClause=} [properties] Properties to set + */ + function OnConflictClause(properties) { + this.targetList = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OnConflictClause action. + * @member {pg_query.OnConflictAction} action + * @memberof pg_query.OnConflictClause + * @instance + */ + OnConflictClause.prototype.action = 0; + + /** + * OnConflictClause infer. + * @member {pg_query.IInferClause|null|undefined} infer + * @memberof pg_query.OnConflictClause + * @instance + */ + OnConflictClause.prototype.infer = null; + + /** + * OnConflictClause targetList. + * @member {Array.} targetList + * @memberof pg_query.OnConflictClause + * @instance + */ + OnConflictClause.prototype.targetList = $util.emptyArray; + + /** + * OnConflictClause whereClause. + * @member {pg_query.INode|null|undefined} whereClause + * @memberof pg_query.OnConflictClause + * @instance + */ + OnConflictClause.prototype.whereClause = null; + + /** + * OnConflictClause location. + * @member {number} location + * @memberof pg_query.OnConflictClause + * @instance + */ + OnConflictClause.prototype.location = 0; + + /** + * Creates a new OnConflictClause instance using the specified properties. + * @function create + * @memberof pg_query.OnConflictClause + * @static + * @param {pg_query.IOnConflictClause=} [properties] Properties to set + * @returns {pg_query.OnConflictClause} OnConflictClause instance + */ + OnConflictClause.create = function create(properties) { + return new OnConflictClause(properties); + }; + + /** + * Encodes the specified OnConflictClause message. Does not implicitly {@link pg_query.OnConflictClause.verify|verify} messages. + * @function encode + * @memberof pg_query.OnConflictClause + * @static + * @param {pg_query.IOnConflictClause} message OnConflictClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnConflictClause.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.infer != null && Object.hasOwnProperty.call(message, "infer")) + $root.pg_query.InferClause.encode(message.infer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.targetList != null && message.targetList.length) + for (var i = 0; i < message.targetList.length; ++i) + $root.pg_query.Node.encode(message.targetList[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.whereClause != null && Object.hasOwnProperty.call(message, "whereClause")) + $root.pg_query.Node.encode(message.whereClause, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified OnConflictClause message, length delimited. Does not implicitly {@link pg_query.OnConflictClause.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.OnConflictClause + * @static + * @param {pg_query.IOnConflictClause} message OnConflictClause message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnConflictClause.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OnConflictClause message from the specified reader or buffer. + * @function decode + * @memberof pg_query.OnConflictClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.OnConflictClause} OnConflictClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnConflictClause.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.OnConflictClause(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.infer = $root.pg_query.InferClause.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.targetList && message.targetList.length)) + message.targetList = []; + message.targetList.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + message.whereClause = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OnConflictClause message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.OnConflictClause + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.OnConflictClause} OnConflictClause + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnConflictClause.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OnConflictClause message. + * @function verify + * @memberof pg_query.OnConflictClause + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnConflictClause.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.infer != null && message.hasOwnProperty("infer")) { + var error = $root.pg_query.InferClause.verify(message.infer); + if (error) + return "infer." + error; + } + if (message.targetList != null && message.hasOwnProperty("targetList")) { + if (!Array.isArray(message.targetList)) + return "targetList: array expected"; + for (var i = 0; i < message.targetList.length; ++i) { + var error = $root.pg_query.Node.verify(message.targetList[i]); + if (error) + return "targetList." + error; + } + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) { + var error = $root.pg_query.Node.verify(message.whereClause); + if (error) + return "whereClause." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates an OnConflictClause message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.OnConflictClause + * @static + * @param {Object.} object Plain object + * @returns {pg_query.OnConflictClause} OnConflictClause + */ + OnConflictClause.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.OnConflictClause) + return object; + var message = new $root.pg_query.OnConflictClause(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ON_CONFLICT_ACTION_UNDEFINED": + case 0: + message.action = 0; + break; + case "ONCONFLICT_NONE": + case 1: + message.action = 1; + break; + case "ONCONFLICT_NOTHING": + case 2: + message.action = 2; + break; + case "ONCONFLICT_UPDATE": + case 3: + message.action = 3; + break; + } + if (object.infer != null) { + if (typeof object.infer !== "object") + throw TypeError(".pg_query.OnConflictClause.infer: object expected"); + message.infer = $root.pg_query.InferClause.fromObject(object.infer); + } + if (object.targetList) { + if (!Array.isArray(object.targetList)) + throw TypeError(".pg_query.OnConflictClause.targetList: array expected"); + message.targetList = []; + for (var i = 0; i < object.targetList.length; ++i) { + if (typeof object.targetList[i] !== "object") + throw TypeError(".pg_query.OnConflictClause.targetList: object expected"); + message.targetList[i] = $root.pg_query.Node.fromObject(object.targetList[i]); + } + } + if (object.whereClause != null) { + if (typeof object.whereClause !== "object") + throw TypeError(".pg_query.OnConflictClause.whereClause: object expected"); + message.whereClause = $root.pg_query.Node.fromObject(object.whereClause); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from an OnConflictClause message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.OnConflictClause + * @static + * @param {pg_query.OnConflictClause} message OnConflictClause + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnConflictClause.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.targetList = []; + if (options.defaults) { + object.action = options.enums === String ? "ON_CONFLICT_ACTION_UNDEFINED" : 0; + object.infer = null; + object.whereClause = null; + object.location = 0; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.pg_query.OnConflictAction[message.action] === undefined ? message.action : $root.pg_query.OnConflictAction[message.action] : message.action; + if (message.infer != null && message.hasOwnProperty("infer")) + object.infer = $root.pg_query.InferClause.toObject(message.infer, options); + if (message.targetList && message.targetList.length) { + object.targetList = []; + for (var j = 0; j < message.targetList.length; ++j) + object.targetList[j] = $root.pg_query.Node.toObject(message.targetList[j], options); + } + if (message.whereClause != null && message.hasOwnProperty("whereClause")) + object.whereClause = $root.pg_query.Node.toObject(message.whereClause, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this OnConflictClause to JSON. + * @function toJSON + * @memberof pg_query.OnConflictClause + * @instance + * @returns {Object.} JSON object + */ + OnConflictClause.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OnConflictClause + * @function getTypeUrl + * @memberof pg_query.OnConflictClause + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnConflictClause.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.OnConflictClause"; + }; + + return OnConflictClause; + })(); + + pg_query.CommonTableExpr = (function() { + + /** + * Properties of a CommonTableExpr. + * @memberof pg_query + * @interface ICommonTableExpr + * @property {string|null} [ctename] CommonTableExpr ctename + * @property {Array.|null} [aliascolnames] CommonTableExpr aliascolnames + * @property {pg_query.CTEMaterialize|null} [ctematerialized] CommonTableExpr ctematerialized + * @property {pg_query.INode|null} [ctequery] CommonTableExpr ctequery + * @property {number|null} [location] CommonTableExpr location + * @property {boolean|null} [cterecursive] CommonTableExpr cterecursive + * @property {number|null} [cterefcount] CommonTableExpr cterefcount + * @property {Array.|null} [ctecolnames] CommonTableExpr ctecolnames + * @property {Array.|null} [ctecoltypes] CommonTableExpr ctecoltypes + * @property {Array.|null} [ctecoltypmods] CommonTableExpr ctecoltypmods + * @property {Array.|null} [ctecolcollations] CommonTableExpr ctecolcollations + */ + + /** + * Constructs a new CommonTableExpr. + * @memberof pg_query + * @classdesc Represents a CommonTableExpr. + * @implements ICommonTableExpr + * @constructor + * @param {pg_query.ICommonTableExpr=} [properties] Properties to set + */ + function CommonTableExpr(properties) { + this.aliascolnames = []; + this.ctecolnames = []; + this.ctecoltypes = []; + this.ctecoltypmods = []; + this.ctecolcollations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CommonTableExpr ctename. + * @member {string} ctename + * @memberof pg_query.CommonTableExpr + * @instance + */ + CommonTableExpr.prototype.ctename = ""; + + /** + * CommonTableExpr aliascolnames. + * @member {Array.} aliascolnames + * @memberof pg_query.CommonTableExpr + * @instance + */ + CommonTableExpr.prototype.aliascolnames = $util.emptyArray; + + /** + * CommonTableExpr ctematerialized. + * @member {pg_query.CTEMaterialize} ctematerialized + * @memberof pg_query.CommonTableExpr + * @instance + */ + CommonTableExpr.prototype.ctematerialized = 0; + + /** + * CommonTableExpr ctequery. + * @member {pg_query.INode|null|undefined} ctequery + * @memberof pg_query.CommonTableExpr + * @instance + */ + CommonTableExpr.prototype.ctequery = null; + + /** + * CommonTableExpr location. + * @member {number} location + * @memberof pg_query.CommonTableExpr + * @instance + */ + CommonTableExpr.prototype.location = 0; + + /** + * CommonTableExpr cterecursive. + * @member {boolean} cterecursive + * @memberof pg_query.CommonTableExpr + * @instance + */ + CommonTableExpr.prototype.cterecursive = false; + + /** + * CommonTableExpr cterefcount. + * @member {number} cterefcount + * @memberof pg_query.CommonTableExpr + * @instance + */ + CommonTableExpr.prototype.cterefcount = 0; + + /** + * CommonTableExpr ctecolnames. + * @member {Array.} ctecolnames + * @memberof pg_query.CommonTableExpr + * @instance + */ + CommonTableExpr.prototype.ctecolnames = $util.emptyArray; + + /** + * CommonTableExpr ctecoltypes. + * @member {Array.} ctecoltypes + * @memberof pg_query.CommonTableExpr + * @instance + */ + CommonTableExpr.prototype.ctecoltypes = $util.emptyArray; + + /** + * CommonTableExpr ctecoltypmods. + * @member {Array.} ctecoltypmods + * @memberof pg_query.CommonTableExpr + * @instance + */ + CommonTableExpr.prototype.ctecoltypmods = $util.emptyArray; + + /** + * CommonTableExpr ctecolcollations. + * @member {Array.} ctecolcollations + * @memberof pg_query.CommonTableExpr + * @instance + */ + CommonTableExpr.prototype.ctecolcollations = $util.emptyArray; + + /** + * Creates a new CommonTableExpr instance using the specified properties. + * @function create + * @memberof pg_query.CommonTableExpr + * @static + * @param {pg_query.ICommonTableExpr=} [properties] Properties to set + * @returns {pg_query.CommonTableExpr} CommonTableExpr instance + */ + CommonTableExpr.create = function create(properties) { + return new CommonTableExpr(properties); + }; + + /** + * Encodes the specified CommonTableExpr message. Does not implicitly {@link pg_query.CommonTableExpr.verify|verify} messages. + * @function encode + * @memberof pg_query.CommonTableExpr + * @static + * @param {pg_query.ICommonTableExpr} message CommonTableExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonTableExpr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctename != null && Object.hasOwnProperty.call(message, "ctename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ctename); + if (message.aliascolnames != null && message.aliascolnames.length) + for (var i = 0; i < message.aliascolnames.length; ++i) + $root.pg_query.Node.encode(message.aliascolnames[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ctematerialized != null && Object.hasOwnProperty.call(message, "ctematerialized")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.ctematerialized); + if (message.ctequery != null && Object.hasOwnProperty.call(message, "ctequery")) + $root.pg_query.Node.encode(message.ctequery, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + if (message.cterecursive != null && Object.hasOwnProperty.call(message, "cterecursive")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cterecursive); + if (message.cterefcount != null && Object.hasOwnProperty.call(message, "cterefcount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.cterefcount); + if (message.ctecolnames != null && message.ctecolnames.length) + for (var i = 0; i < message.ctecolnames.length; ++i) + $root.pg_query.Node.encode(message.ctecolnames[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.ctecoltypes != null && message.ctecoltypes.length) + for (var i = 0; i < message.ctecoltypes.length; ++i) + $root.pg_query.Node.encode(message.ctecoltypes[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.ctecoltypmods != null && message.ctecoltypmods.length) + for (var i = 0; i < message.ctecoltypmods.length; ++i) + $root.pg_query.Node.encode(message.ctecoltypmods[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.ctecolcollations != null && message.ctecolcollations.length) + for (var i = 0; i < message.ctecolcollations.length; ++i) + $root.pg_query.Node.encode(message.ctecolcollations[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommonTableExpr message, length delimited. Does not implicitly {@link pg_query.CommonTableExpr.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CommonTableExpr + * @static + * @param {pg_query.ICommonTableExpr} message CommonTableExpr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonTableExpr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonTableExpr message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CommonTableExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CommonTableExpr} CommonTableExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonTableExpr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CommonTableExpr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctename = reader.string(); + break; + } + case 2: { + if (!(message.aliascolnames && message.aliascolnames.length)) + message.aliascolnames = []; + message.aliascolnames.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.ctematerialized = reader.int32(); + break; + } + case 4: { + message.ctequery = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + case 6: { + message.cterecursive = reader.bool(); + break; + } + case 7: { + message.cterefcount = reader.int32(); + break; + } + case 8: { + if (!(message.ctecolnames && message.ctecolnames.length)) + message.ctecolnames = []; + message.ctecolnames.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.ctecoltypes && message.ctecoltypes.length)) + message.ctecoltypes = []; + message.ctecoltypes.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.ctecoltypmods && message.ctecoltypmods.length)) + message.ctecoltypmods = []; + message.ctecoltypmods.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message.ctecolcollations && message.ctecolcollations.length)) + message.ctecolcollations = []; + message.ctecolcollations.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonTableExpr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CommonTableExpr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CommonTableExpr} CommonTableExpr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonTableExpr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonTableExpr message. + * @function verify + * @memberof pg_query.CommonTableExpr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonTableExpr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctename != null && message.hasOwnProperty("ctename")) + if (!$util.isString(message.ctename)) + return "ctename: string expected"; + if (message.aliascolnames != null && message.hasOwnProperty("aliascolnames")) { + if (!Array.isArray(message.aliascolnames)) + return "aliascolnames: array expected"; + for (var i = 0; i < message.aliascolnames.length; ++i) { + var error = $root.pg_query.Node.verify(message.aliascolnames[i]); + if (error) + return "aliascolnames." + error; + } + } + if (message.ctematerialized != null && message.hasOwnProperty("ctematerialized")) + switch (message.ctematerialized) { + default: + return "ctematerialized: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.ctequery != null && message.hasOwnProperty("ctequery")) { + var error = $root.pg_query.Node.verify(message.ctequery); + if (error) + return "ctequery." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + if (message.cterecursive != null && message.hasOwnProperty("cterecursive")) + if (typeof message.cterecursive !== "boolean") + return "cterecursive: boolean expected"; + if (message.cterefcount != null && message.hasOwnProperty("cterefcount")) + if (!$util.isInteger(message.cterefcount)) + return "cterefcount: integer expected"; + if (message.ctecolnames != null && message.hasOwnProperty("ctecolnames")) { + if (!Array.isArray(message.ctecolnames)) + return "ctecolnames: array expected"; + for (var i = 0; i < message.ctecolnames.length; ++i) { + var error = $root.pg_query.Node.verify(message.ctecolnames[i]); + if (error) + return "ctecolnames." + error; + } + } + if (message.ctecoltypes != null && message.hasOwnProperty("ctecoltypes")) { + if (!Array.isArray(message.ctecoltypes)) + return "ctecoltypes: array expected"; + for (var i = 0; i < message.ctecoltypes.length; ++i) { + var error = $root.pg_query.Node.verify(message.ctecoltypes[i]); + if (error) + return "ctecoltypes." + error; + } + } + if (message.ctecoltypmods != null && message.hasOwnProperty("ctecoltypmods")) { + if (!Array.isArray(message.ctecoltypmods)) + return "ctecoltypmods: array expected"; + for (var i = 0; i < message.ctecoltypmods.length; ++i) { + var error = $root.pg_query.Node.verify(message.ctecoltypmods[i]); + if (error) + return "ctecoltypmods." + error; + } + } + if (message.ctecolcollations != null && message.hasOwnProperty("ctecolcollations")) { + if (!Array.isArray(message.ctecolcollations)) + return "ctecolcollations: array expected"; + for (var i = 0; i < message.ctecolcollations.length; ++i) { + var error = $root.pg_query.Node.verify(message.ctecolcollations[i]); + if (error) + return "ctecolcollations." + error; + } + } + return null; + }; + + /** + * Creates a CommonTableExpr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CommonTableExpr + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CommonTableExpr} CommonTableExpr + */ + CommonTableExpr.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CommonTableExpr) + return object; + var message = new $root.pg_query.CommonTableExpr(); + if (object.ctename != null) + message.ctename = String(object.ctename); + if (object.aliascolnames) { + if (!Array.isArray(object.aliascolnames)) + throw TypeError(".pg_query.CommonTableExpr.aliascolnames: array expected"); + message.aliascolnames = []; + for (var i = 0; i < object.aliascolnames.length; ++i) { + if (typeof object.aliascolnames[i] !== "object") + throw TypeError(".pg_query.CommonTableExpr.aliascolnames: object expected"); + message.aliascolnames[i] = $root.pg_query.Node.fromObject(object.aliascolnames[i]); + } + } + switch (object.ctematerialized) { + default: + if (typeof object.ctematerialized === "number") { + message.ctematerialized = object.ctematerialized; + break; + } + break; + case "CTEMATERIALIZE_UNDEFINED": + case 0: + message.ctematerialized = 0; + break; + case "CTEMaterializeDefault": + case 1: + message.ctematerialized = 1; + break; + case "CTEMaterializeAlways": + case 2: + message.ctematerialized = 2; + break; + case "CTEMaterializeNever": + case 3: + message.ctematerialized = 3; + break; + } + if (object.ctequery != null) { + if (typeof object.ctequery !== "object") + throw TypeError(".pg_query.CommonTableExpr.ctequery: object expected"); + message.ctequery = $root.pg_query.Node.fromObject(object.ctequery); + } + if (object.location != null) + message.location = object.location | 0; + if (object.cterecursive != null) + message.cterecursive = Boolean(object.cterecursive); + if (object.cterefcount != null) + message.cterefcount = object.cterefcount | 0; + if (object.ctecolnames) { + if (!Array.isArray(object.ctecolnames)) + throw TypeError(".pg_query.CommonTableExpr.ctecolnames: array expected"); + message.ctecolnames = []; + for (var i = 0; i < object.ctecolnames.length; ++i) { + if (typeof object.ctecolnames[i] !== "object") + throw TypeError(".pg_query.CommonTableExpr.ctecolnames: object expected"); + message.ctecolnames[i] = $root.pg_query.Node.fromObject(object.ctecolnames[i]); + } + } + if (object.ctecoltypes) { + if (!Array.isArray(object.ctecoltypes)) + throw TypeError(".pg_query.CommonTableExpr.ctecoltypes: array expected"); + message.ctecoltypes = []; + for (var i = 0; i < object.ctecoltypes.length; ++i) { + if (typeof object.ctecoltypes[i] !== "object") + throw TypeError(".pg_query.CommonTableExpr.ctecoltypes: object expected"); + message.ctecoltypes[i] = $root.pg_query.Node.fromObject(object.ctecoltypes[i]); + } + } + if (object.ctecoltypmods) { + if (!Array.isArray(object.ctecoltypmods)) + throw TypeError(".pg_query.CommonTableExpr.ctecoltypmods: array expected"); + message.ctecoltypmods = []; + for (var i = 0; i < object.ctecoltypmods.length; ++i) { + if (typeof object.ctecoltypmods[i] !== "object") + throw TypeError(".pg_query.CommonTableExpr.ctecoltypmods: object expected"); + message.ctecoltypmods[i] = $root.pg_query.Node.fromObject(object.ctecoltypmods[i]); + } + } + if (object.ctecolcollations) { + if (!Array.isArray(object.ctecolcollations)) + throw TypeError(".pg_query.CommonTableExpr.ctecolcollations: array expected"); + message.ctecolcollations = []; + for (var i = 0; i < object.ctecolcollations.length; ++i) { + if (typeof object.ctecolcollations[i] !== "object") + throw TypeError(".pg_query.CommonTableExpr.ctecolcollations: object expected"); + message.ctecolcollations[i] = $root.pg_query.Node.fromObject(object.ctecolcollations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CommonTableExpr message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CommonTableExpr + * @static + * @param {pg_query.CommonTableExpr} message CommonTableExpr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonTableExpr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.aliascolnames = []; + object.ctecolnames = []; + object.ctecoltypes = []; + object.ctecoltypmods = []; + object.ctecolcollations = []; + } + if (options.defaults) { + object.ctename = ""; + object.ctematerialized = options.enums === String ? "CTEMATERIALIZE_UNDEFINED" : 0; + object.ctequery = null; + object.location = 0; + object.cterecursive = false; + object.cterefcount = 0; + } + if (message.ctename != null && message.hasOwnProperty("ctename")) + object.ctename = message.ctename; + if (message.aliascolnames && message.aliascolnames.length) { + object.aliascolnames = []; + for (var j = 0; j < message.aliascolnames.length; ++j) + object.aliascolnames[j] = $root.pg_query.Node.toObject(message.aliascolnames[j], options); + } + if (message.ctematerialized != null && message.hasOwnProperty("ctematerialized")) + object.ctematerialized = options.enums === String ? $root.pg_query.CTEMaterialize[message.ctematerialized] === undefined ? message.ctematerialized : $root.pg_query.CTEMaterialize[message.ctematerialized] : message.ctematerialized; + if (message.ctequery != null && message.hasOwnProperty("ctequery")) + object.ctequery = $root.pg_query.Node.toObject(message.ctequery, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.cterecursive != null && message.hasOwnProperty("cterecursive")) + object.cterecursive = message.cterecursive; + if (message.cterefcount != null && message.hasOwnProperty("cterefcount")) + object.cterefcount = message.cterefcount; + if (message.ctecolnames && message.ctecolnames.length) { + object.ctecolnames = []; + for (var j = 0; j < message.ctecolnames.length; ++j) + object.ctecolnames[j] = $root.pg_query.Node.toObject(message.ctecolnames[j], options); + } + if (message.ctecoltypes && message.ctecoltypes.length) { + object.ctecoltypes = []; + for (var j = 0; j < message.ctecoltypes.length; ++j) + object.ctecoltypes[j] = $root.pg_query.Node.toObject(message.ctecoltypes[j], options); + } + if (message.ctecoltypmods && message.ctecoltypmods.length) { + object.ctecoltypmods = []; + for (var j = 0; j < message.ctecoltypmods.length; ++j) + object.ctecoltypmods[j] = $root.pg_query.Node.toObject(message.ctecoltypmods[j], options); + } + if (message.ctecolcollations && message.ctecolcollations.length) { + object.ctecolcollations = []; + for (var j = 0; j < message.ctecolcollations.length; ++j) + object.ctecolcollations[j] = $root.pg_query.Node.toObject(message.ctecolcollations[j], options); + } + return object; + }; + + /** + * Converts this CommonTableExpr to JSON. + * @function toJSON + * @memberof pg_query.CommonTableExpr + * @instance + * @returns {Object.} JSON object + */ + CommonTableExpr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonTableExpr + * @function getTypeUrl + * @memberof pg_query.CommonTableExpr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonTableExpr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CommonTableExpr"; + }; + + return CommonTableExpr; + })(); + + pg_query.RoleSpec = (function() { + + /** + * Properties of a RoleSpec. + * @memberof pg_query + * @interface IRoleSpec + * @property {pg_query.RoleSpecType|null} [roletype] RoleSpec roletype + * @property {string|null} [rolename] RoleSpec rolename + * @property {number|null} [location] RoleSpec location + */ + + /** + * Constructs a new RoleSpec. + * @memberof pg_query + * @classdesc Represents a RoleSpec. + * @implements IRoleSpec + * @constructor + * @param {pg_query.IRoleSpec=} [properties] Properties to set + */ + function RoleSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoleSpec roletype. + * @member {pg_query.RoleSpecType} roletype + * @memberof pg_query.RoleSpec + * @instance + */ + RoleSpec.prototype.roletype = 0; + + /** + * RoleSpec rolename. + * @member {string} rolename + * @memberof pg_query.RoleSpec + * @instance + */ + RoleSpec.prototype.rolename = ""; + + /** + * RoleSpec location. + * @member {number} location + * @memberof pg_query.RoleSpec + * @instance + */ + RoleSpec.prototype.location = 0; + + /** + * Creates a new RoleSpec instance using the specified properties. + * @function create + * @memberof pg_query.RoleSpec + * @static + * @param {pg_query.IRoleSpec=} [properties] Properties to set + * @returns {pg_query.RoleSpec} RoleSpec instance + */ + RoleSpec.create = function create(properties) { + return new RoleSpec(properties); + }; + + /** + * Encodes the specified RoleSpec message. Does not implicitly {@link pg_query.RoleSpec.verify|verify} messages. + * @function encode + * @memberof pg_query.RoleSpec + * @static + * @param {pg_query.IRoleSpec} message RoleSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoleSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.roletype != null && Object.hasOwnProperty.call(message, "roletype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.roletype); + if (message.rolename != null && Object.hasOwnProperty.call(message, "rolename")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rolename); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.location); + return writer; + }; + + /** + * Encodes the specified RoleSpec message, length delimited. Does not implicitly {@link pg_query.RoleSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.RoleSpec + * @static + * @param {pg_query.IRoleSpec} message RoleSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoleSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoleSpec message from the specified reader or buffer. + * @function decode + * @memberof pg_query.RoleSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.RoleSpec} RoleSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoleSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.RoleSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.roletype = reader.int32(); + break; + } + case 2: { + message.rolename = reader.string(); + break; + } + case 3: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoleSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.RoleSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.RoleSpec} RoleSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoleSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoleSpec message. + * @function verify + * @memberof pg_query.RoleSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoleSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.roletype != null && message.hasOwnProperty("roletype")) + switch (message.roletype) { + default: + return "roletype: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.rolename != null && message.hasOwnProperty("rolename")) + if (!$util.isString(message.rolename)) + return "rolename: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a RoleSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.RoleSpec + * @static + * @param {Object.} object Plain object + * @returns {pg_query.RoleSpec} RoleSpec + */ + RoleSpec.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.RoleSpec) + return object; + var message = new $root.pg_query.RoleSpec(); + switch (object.roletype) { + default: + if (typeof object.roletype === "number") { + message.roletype = object.roletype; + break; + } + break; + case "ROLE_SPEC_TYPE_UNDEFINED": + case 0: + message.roletype = 0; + break; + case "ROLESPEC_CSTRING": + case 1: + message.roletype = 1; + break; + case "ROLESPEC_CURRENT_USER": + case 2: + message.roletype = 2; + break; + case "ROLESPEC_SESSION_USER": + case 3: + message.roletype = 3; + break; + case "ROLESPEC_PUBLIC": + case 4: + message.roletype = 4; + break; + } + if (object.rolename != null) + message.rolename = String(object.rolename); + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a RoleSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.RoleSpec + * @static + * @param {pg_query.RoleSpec} message RoleSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoleSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.roletype = options.enums === String ? "ROLE_SPEC_TYPE_UNDEFINED" : 0; + object.rolename = ""; + object.location = 0; + } + if (message.roletype != null && message.hasOwnProperty("roletype")) + object.roletype = options.enums === String ? $root.pg_query.RoleSpecType[message.roletype] === undefined ? message.roletype : $root.pg_query.RoleSpecType[message.roletype] : message.roletype; + if (message.rolename != null && message.hasOwnProperty("rolename")) + object.rolename = message.rolename; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this RoleSpec to JSON. + * @function toJSON + * @memberof pg_query.RoleSpec + * @instance + * @returns {Object.} JSON object + */ + RoleSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoleSpec + * @function getTypeUrl + * @memberof pg_query.RoleSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoleSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.RoleSpec"; + }; + + return RoleSpec; + })(); + + pg_query.TriggerTransition = (function() { + + /** + * Properties of a TriggerTransition. + * @memberof pg_query + * @interface ITriggerTransition + * @property {string|null} [name] TriggerTransition name + * @property {boolean|null} [isNew] TriggerTransition isNew + * @property {boolean|null} [isTable] TriggerTransition isTable + */ + + /** + * Constructs a new TriggerTransition. + * @memberof pg_query + * @classdesc Represents a TriggerTransition. + * @implements ITriggerTransition + * @constructor + * @param {pg_query.ITriggerTransition=} [properties] Properties to set + */ + function TriggerTransition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TriggerTransition name. + * @member {string} name + * @memberof pg_query.TriggerTransition + * @instance + */ + TriggerTransition.prototype.name = ""; + + /** + * TriggerTransition isNew. + * @member {boolean} isNew + * @memberof pg_query.TriggerTransition + * @instance + */ + TriggerTransition.prototype.isNew = false; + + /** + * TriggerTransition isTable. + * @member {boolean} isTable + * @memberof pg_query.TriggerTransition + * @instance + */ + TriggerTransition.prototype.isTable = false; + + /** + * Creates a new TriggerTransition instance using the specified properties. + * @function create + * @memberof pg_query.TriggerTransition + * @static + * @param {pg_query.ITriggerTransition=} [properties] Properties to set + * @returns {pg_query.TriggerTransition} TriggerTransition instance + */ + TriggerTransition.create = function create(properties) { + return new TriggerTransition(properties); + }; + + /** + * Encodes the specified TriggerTransition message. Does not implicitly {@link pg_query.TriggerTransition.verify|verify} messages. + * @function encode + * @memberof pg_query.TriggerTransition + * @static + * @param {pg_query.ITriggerTransition} message TriggerTransition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerTransition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.isNew != null && Object.hasOwnProperty.call(message, "isNew")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isNew); + if (message.isTable != null && Object.hasOwnProperty.call(message, "isTable")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isTable); + return writer; + }; + + /** + * Encodes the specified TriggerTransition message, length delimited. Does not implicitly {@link pg_query.TriggerTransition.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.TriggerTransition + * @static + * @param {pg_query.ITriggerTransition} message TriggerTransition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerTransition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TriggerTransition message from the specified reader or buffer. + * @function decode + * @memberof pg_query.TriggerTransition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.TriggerTransition} TriggerTransition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerTransition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.TriggerTransition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.isNew = reader.bool(); + break; + } + case 3: { + message.isTable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TriggerTransition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.TriggerTransition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.TriggerTransition} TriggerTransition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerTransition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TriggerTransition message. + * @function verify + * @memberof pg_query.TriggerTransition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TriggerTransition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.isNew != null && message.hasOwnProperty("isNew")) + if (typeof message.isNew !== "boolean") + return "isNew: boolean expected"; + if (message.isTable != null && message.hasOwnProperty("isTable")) + if (typeof message.isTable !== "boolean") + return "isTable: boolean expected"; + return null; + }; + + /** + * Creates a TriggerTransition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.TriggerTransition + * @static + * @param {Object.} object Plain object + * @returns {pg_query.TriggerTransition} TriggerTransition + */ + TriggerTransition.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.TriggerTransition) + return object; + var message = new $root.pg_query.TriggerTransition(); + if (object.name != null) + message.name = String(object.name); + if (object.isNew != null) + message.isNew = Boolean(object.isNew); + if (object.isTable != null) + message.isTable = Boolean(object.isTable); + return message; + }; + + /** + * Creates a plain object from a TriggerTransition message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.TriggerTransition + * @static + * @param {pg_query.TriggerTransition} message TriggerTransition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TriggerTransition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.isNew = false; + object.isTable = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.isNew != null && message.hasOwnProperty("isNew")) + object.isNew = message.isNew; + if (message.isTable != null && message.hasOwnProperty("isTable")) + object.isTable = message.isTable; + return object; + }; + + /** + * Converts this TriggerTransition to JSON. + * @function toJSON + * @memberof pg_query.TriggerTransition + * @instance + * @returns {Object.} JSON object + */ + TriggerTransition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TriggerTransition + * @function getTypeUrl + * @memberof pg_query.TriggerTransition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TriggerTransition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.TriggerTransition"; + }; + + return TriggerTransition; + })(); + + pg_query.PartitionElem = (function() { + + /** + * Properties of a PartitionElem. + * @memberof pg_query + * @interface IPartitionElem + * @property {string|null} [name] PartitionElem name + * @property {pg_query.INode|null} [expr] PartitionElem expr + * @property {Array.|null} [collation] PartitionElem collation + * @property {Array.|null} [opclass] PartitionElem opclass + * @property {number|null} [location] PartitionElem location + */ + + /** + * Constructs a new PartitionElem. + * @memberof pg_query + * @classdesc Represents a PartitionElem. + * @implements IPartitionElem + * @constructor + * @param {pg_query.IPartitionElem=} [properties] Properties to set + */ + function PartitionElem(properties) { + this.collation = []; + this.opclass = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionElem name. + * @member {string} name + * @memberof pg_query.PartitionElem + * @instance + */ + PartitionElem.prototype.name = ""; + + /** + * PartitionElem expr. + * @member {pg_query.INode|null|undefined} expr + * @memberof pg_query.PartitionElem + * @instance + */ + PartitionElem.prototype.expr = null; + + /** + * PartitionElem collation. + * @member {Array.} collation + * @memberof pg_query.PartitionElem + * @instance + */ + PartitionElem.prototype.collation = $util.emptyArray; + + /** + * PartitionElem opclass. + * @member {Array.} opclass + * @memberof pg_query.PartitionElem + * @instance + */ + PartitionElem.prototype.opclass = $util.emptyArray; + + /** + * PartitionElem location. + * @member {number} location + * @memberof pg_query.PartitionElem + * @instance + */ + PartitionElem.prototype.location = 0; + + /** + * Creates a new PartitionElem instance using the specified properties. + * @function create + * @memberof pg_query.PartitionElem + * @static + * @param {pg_query.IPartitionElem=} [properties] Properties to set + * @returns {pg_query.PartitionElem} PartitionElem instance + */ + PartitionElem.create = function create(properties) { + return new PartitionElem(properties); + }; + + /** + * Encodes the specified PartitionElem message. Does not implicitly {@link pg_query.PartitionElem.verify|verify} messages. + * @function encode + * @memberof pg_query.PartitionElem + * @static + * @param {pg_query.IPartitionElem} message PartitionElem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionElem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.expr != null && Object.hasOwnProperty.call(message, "expr")) + $root.pg_query.Node.encode(message.expr, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.collation != null && message.collation.length) + for (var i = 0; i < message.collation.length; ++i) + $root.pg_query.Node.encode(message.collation[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.opclass != null && message.opclass.length) + for (var i = 0; i < message.opclass.length; ++i) + $root.pg_query.Node.encode(message.opclass[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.location); + return writer; + }; + + /** + * Encodes the specified PartitionElem message, length delimited. Does not implicitly {@link pg_query.PartitionElem.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.PartitionElem + * @static + * @param {pg_query.IPartitionElem} message PartitionElem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionElem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionElem message from the specified reader or buffer. + * @function decode + * @memberof pg_query.PartitionElem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.PartitionElem} PartitionElem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionElem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.PartitionElem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.expr = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.collation && message.collation.length)) + message.collation = []; + message.collation.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.opclass && message.opclass.length)) + message.opclass = []; + message.opclass.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 5: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionElem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.PartitionElem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.PartitionElem} PartitionElem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionElem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionElem message. + * @function verify + * @memberof pg_query.PartitionElem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionElem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.expr != null && message.hasOwnProperty("expr")) { + var error = $root.pg_query.Node.verify(message.expr); + if (error) + return "expr." + error; + } + if (message.collation != null && message.hasOwnProperty("collation")) { + if (!Array.isArray(message.collation)) + return "collation: array expected"; + for (var i = 0; i < message.collation.length; ++i) { + var error = $root.pg_query.Node.verify(message.collation[i]); + if (error) + return "collation." + error; + } + } + if (message.opclass != null && message.hasOwnProperty("opclass")) { + if (!Array.isArray(message.opclass)) + return "opclass: array expected"; + for (var i = 0; i < message.opclass.length; ++i) { + var error = $root.pg_query.Node.verify(message.opclass[i]); + if (error) + return "opclass." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a PartitionElem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.PartitionElem + * @static + * @param {Object.} object Plain object + * @returns {pg_query.PartitionElem} PartitionElem + */ + PartitionElem.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.PartitionElem) + return object; + var message = new $root.pg_query.PartitionElem(); + if (object.name != null) + message.name = String(object.name); + if (object.expr != null) { + if (typeof object.expr !== "object") + throw TypeError(".pg_query.PartitionElem.expr: object expected"); + message.expr = $root.pg_query.Node.fromObject(object.expr); + } + if (object.collation) { + if (!Array.isArray(object.collation)) + throw TypeError(".pg_query.PartitionElem.collation: array expected"); + message.collation = []; + for (var i = 0; i < object.collation.length; ++i) { + if (typeof object.collation[i] !== "object") + throw TypeError(".pg_query.PartitionElem.collation: object expected"); + message.collation[i] = $root.pg_query.Node.fromObject(object.collation[i]); + } + } + if (object.opclass) { + if (!Array.isArray(object.opclass)) + throw TypeError(".pg_query.PartitionElem.opclass: array expected"); + message.opclass = []; + for (var i = 0; i < object.opclass.length; ++i) { + if (typeof object.opclass[i] !== "object") + throw TypeError(".pg_query.PartitionElem.opclass: object expected"); + message.opclass[i] = $root.pg_query.Node.fromObject(object.opclass[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a PartitionElem message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.PartitionElem + * @static + * @param {pg_query.PartitionElem} message PartitionElem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionElem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.collation = []; + object.opclass = []; + } + if (options.defaults) { + object.name = ""; + object.expr = null; + object.location = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.expr != null && message.hasOwnProperty("expr")) + object.expr = $root.pg_query.Node.toObject(message.expr, options); + if (message.collation && message.collation.length) { + object.collation = []; + for (var j = 0; j < message.collation.length; ++j) + object.collation[j] = $root.pg_query.Node.toObject(message.collation[j], options); + } + if (message.opclass && message.opclass.length) { + object.opclass = []; + for (var j = 0; j < message.opclass.length; ++j) + object.opclass[j] = $root.pg_query.Node.toObject(message.opclass[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this PartitionElem to JSON. + * @function toJSON + * @memberof pg_query.PartitionElem + * @instance + * @returns {Object.} JSON object + */ + PartitionElem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionElem + * @function getTypeUrl + * @memberof pg_query.PartitionElem + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionElem.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.PartitionElem"; + }; + + return PartitionElem; + })(); + + pg_query.PartitionSpec = (function() { + + /** + * Properties of a PartitionSpec. + * @memberof pg_query + * @interface IPartitionSpec + * @property {string|null} [strategy] PartitionSpec strategy + * @property {Array.|null} [partParams] PartitionSpec partParams + * @property {number|null} [location] PartitionSpec location + */ + + /** + * Constructs a new PartitionSpec. + * @memberof pg_query + * @classdesc Represents a PartitionSpec. + * @implements IPartitionSpec + * @constructor + * @param {pg_query.IPartitionSpec=} [properties] Properties to set + */ + function PartitionSpec(properties) { + this.partParams = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionSpec strategy. + * @member {string} strategy + * @memberof pg_query.PartitionSpec + * @instance + */ + PartitionSpec.prototype.strategy = ""; + + /** + * PartitionSpec partParams. + * @member {Array.} partParams + * @memberof pg_query.PartitionSpec + * @instance + */ + PartitionSpec.prototype.partParams = $util.emptyArray; + + /** + * PartitionSpec location. + * @member {number} location + * @memberof pg_query.PartitionSpec + * @instance + */ + PartitionSpec.prototype.location = 0; + + /** + * Creates a new PartitionSpec instance using the specified properties. + * @function create + * @memberof pg_query.PartitionSpec + * @static + * @param {pg_query.IPartitionSpec=} [properties] Properties to set + * @returns {pg_query.PartitionSpec} PartitionSpec instance + */ + PartitionSpec.create = function create(properties) { + return new PartitionSpec(properties); + }; + + /** + * Encodes the specified PartitionSpec message. Does not implicitly {@link pg_query.PartitionSpec.verify|verify} messages. + * @function encode + * @memberof pg_query.PartitionSpec + * @static + * @param {pg_query.IPartitionSpec} message PartitionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.strategy != null && Object.hasOwnProperty.call(message, "strategy")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.strategy); + if (message.partParams != null && message.partParams.length) + for (var i = 0; i < message.partParams.length; ++i) + $root.pg_query.Node.encode(message.partParams[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.location); + return writer; + }; + + /** + * Encodes the specified PartitionSpec message, length delimited. Does not implicitly {@link pg_query.PartitionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.PartitionSpec + * @static + * @param {pg_query.IPartitionSpec} message PartitionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer. + * @function decode + * @memberof pg_query.PartitionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.PartitionSpec} PartitionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.PartitionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.strategy = reader.string(); + break; + } + case 2: { + if (!(message.partParams && message.partParams.length)) + message.partParams = []; + message.partParams.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 3: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.PartitionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.PartitionSpec} PartitionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionSpec message. + * @function verify + * @memberof pg_query.PartitionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.strategy != null && message.hasOwnProperty("strategy")) + if (!$util.isString(message.strategy)) + return "strategy: string expected"; + if (message.partParams != null && message.hasOwnProperty("partParams")) { + if (!Array.isArray(message.partParams)) + return "partParams: array expected"; + for (var i = 0; i < message.partParams.length; ++i) { + var error = $root.pg_query.Node.verify(message.partParams[i]); + if (error) + return "partParams." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a PartitionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.PartitionSpec + * @static + * @param {Object.} object Plain object + * @returns {pg_query.PartitionSpec} PartitionSpec + */ + PartitionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.PartitionSpec) + return object; + var message = new $root.pg_query.PartitionSpec(); + if (object.strategy != null) + message.strategy = String(object.strategy); + if (object.partParams) { + if (!Array.isArray(object.partParams)) + throw TypeError(".pg_query.PartitionSpec.partParams: array expected"); + message.partParams = []; + for (var i = 0; i < object.partParams.length; ++i) { + if (typeof object.partParams[i] !== "object") + throw TypeError(".pg_query.PartitionSpec.partParams: object expected"); + message.partParams[i] = $root.pg_query.Node.fromObject(object.partParams[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a PartitionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.PartitionSpec + * @static + * @param {pg_query.PartitionSpec} message PartitionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.partParams = []; + if (options.defaults) { + object.strategy = ""; + object.location = 0; + } + if (message.strategy != null && message.hasOwnProperty("strategy")) + object.strategy = message.strategy; + if (message.partParams && message.partParams.length) { + object.partParams = []; + for (var j = 0; j < message.partParams.length; ++j) + object.partParams[j] = $root.pg_query.Node.toObject(message.partParams[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this PartitionSpec to JSON. + * @function toJSON + * @memberof pg_query.PartitionSpec + * @instance + * @returns {Object.} JSON object + */ + PartitionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionSpec + * @function getTypeUrl + * @memberof pg_query.PartitionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.PartitionSpec"; + }; + + return PartitionSpec; + })(); + + pg_query.PartitionBoundSpec = (function() { + + /** + * Properties of a PartitionBoundSpec. + * @memberof pg_query + * @interface IPartitionBoundSpec + * @property {string|null} [strategy] PartitionBoundSpec strategy + * @property {boolean|null} [is_default] PartitionBoundSpec is_default + * @property {number|null} [modulus] PartitionBoundSpec modulus + * @property {number|null} [remainder] PartitionBoundSpec remainder + * @property {Array.|null} [listdatums] PartitionBoundSpec listdatums + * @property {Array.|null} [lowerdatums] PartitionBoundSpec lowerdatums + * @property {Array.|null} [upperdatums] PartitionBoundSpec upperdatums + * @property {number|null} [location] PartitionBoundSpec location + */ + + /** + * Constructs a new PartitionBoundSpec. + * @memberof pg_query + * @classdesc Represents a PartitionBoundSpec. + * @implements IPartitionBoundSpec + * @constructor + * @param {pg_query.IPartitionBoundSpec=} [properties] Properties to set + */ + function PartitionBoundSpec(properties) { + this.listdatums = []; + this.lowerdatums = []; + this.upperdatums = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionBoundSpec strategy. + * @member {string} strategy + * @memberof pg_query.PartitionBoundSpec + * @instance + */ + PartitionBoundSpec.prototype.strategy = ""; + + /** + * PartitionBoundSpec is_default. + * @member {boolean} is_default + * @memberof pg_query.PartitionBoundSpec + * @instance + */ + PartitionBoundSpec.prototype.is_default = false; + + /** + * PartitionBoundSpec modulus. + * @member {number} modulus + * @memberof pg_query.PartitionBoundSpec + * @instance + */ + PartitionBoundSpec.prototype.modulus = 0; + + /** + * PartitionBoundSpec remainder. + * @member {number} remainder + * @memberof pg_query.PartitionBoundSpec + * @instance + */ + PartitionBoundSpec.prototype.remainder = 0; + + /** + * PartitionBoundSpec listdatums. + * @member {Array.} listdatums + * @memberof pg_query.PartitionBoundSpec + * @instance + */ + PartitionBoundSpec.prototype.listdatums = $util.emptyArray; + + /** + * PartitionBoundSpec lowerdatums. + * @member {Array.} lowerdatums + * @memberof pg_query.PartitionBoundSpec + * @instance + */ + PartitionBoundSpec.prototype.lowerdatums = $util.emptyArray; + + /** + * PartitionBoundSpec upperdatums. + * @member {Array.} upperdatums + * @memberof pg_query.PartitionBoundSpec + * @instance + */ + PartitionBoundSpec.prototype.upperdatums = $util.emptyArray; + + /** + * PartitionBoundSpec location. + * @member {number} location + * @memberof pg_query.PartitionBoundSpec + * @instance + */ + PartitionBoundSpec.prototype.location = 0; + + /** + * Creates a new PartitionBoundSpec instance using the specified properties. + * @function create + * @memberof pg_query.PartitionBoundSpec + * @static + * @param {pg_query.IPartitionBoundSpec=} [properties] Properties to set + * @returns {pg_query.PartitionBoundSpec} PartitionBoundSpec instance + */ + PartitionBoundSpec.create = function create(properties) { + return new PartitionBoundSpec(properties); + }; + + /** + * Encodes the specified PartitionBoundSpec message. Does not implicitly {@link pg_query.PartitionBoundSpec.verify|verify} messages. + * @function encode + * @memberof pg_query.PartitionBoundSpec + * @static + * @param {pg_query.IPartitionBoundSpec} message PartitionBoundSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionBoundSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.strategy != null && Object.hasOwnProperty.call(message, "strategy")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.strategy); + if (message.is_default != null && Object.hasOwnProperty.call(message, "is_default")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.is_default); + if (message.modulus != null && Object.hasOwnProperty.call(message, "modulus")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.modulus); + if (message.remainder != null && Object.hasOwnProperty.call(message, "remainder")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.remainder); + if (message.listdatums != null && message.listdatums.length) + for (var i = 0; i < message.listdatums.length; ++i) + $root.pg_query.Node.encode(message.listdatums[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lowerdatums != null && message.lowerdatums.length) + for (var i = 0; i < message.lowerdatums.length; ++i) + $root.pg_query.Node.encode(message.lowerdatums[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.upperdatums != null && message.upperdatums.length) + for (var i = 0; i < message.upperdatums.length; ++i) + $root.pg_query.Node.encode(message.upperdatums[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.location); + return writer; + }; + + /** + * Encodes the specified PartitionBoundSpec message, length delimited. Does not implicitly {@link pg_query.PartitionBoundSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.PartitionBoundSpec + * @static + * @param {pg_query.IPartitionBoundSpec} message PartitionBoundSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionBoundSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionBoundSpec message from the specified reader or buffer. + * @function decode + * @memberof pg_query.PartitionBoundSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.PartitionBoundSpec} PartitionBoundSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionBoundSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.PartitionBoundSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.strategy = reader.string(); + break; + } + case 2: { + message.is_default = reader.bool(); + break; + } + case 3: { + message.modulus = reader.int32(); + break; + } + case 4: { + message.remainder = reader.int32(); + break; + } + case 5: { + if (!(message.listdatums && message.listdatums.length)) + message.listdatums = []; + message.listdatums.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.lowerdatums && message.lowerdatums.length)) + message.lowerdatums = []; + message.lowerdatums.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.upperdatums && message.upperdatums.length)) + message.upperdatums = []; + message.upperdatums.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + case 8: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionBoundSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.PartitionBoundSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.PartitionBoundSpec} PartitionBoundSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionBoundSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionBoundSpec message. + * @function verify + * @memberof pg_query.PartitionBoundSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionBoundSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.strategy != null && message.hasOwnProperty("strategy")) + if (!$util.isString(message.strategy)) + return "strategy: string expected"; + if (message.is_default != null && message.hasOwnProperty("is_default")) + if (typeof message.is_default !== "boolean") + return "is_default: boolean expected"; + if (message.modulus != null && message.hasOwnProperty("modulus")) + if (!$util.isInteger(message.modulus)) + return "modulus: integer expected"; + if (message.remainder != null && message.hasOwnProperty("remainder")) + if (!$util.isInteger(message.remainder)) + return "remainder: integer expected"; + if (message.listdatums != null && message.hasOwnProperty("listdatums")) { + if (!Array.isArray(message.listdatums)) + return "listdatums: array expected"; + for (var i = 0; i < message.listdatums.length; ++i) { + var error = $root.pg_query.Node.verify(message.listdatums[i]); + if (error) + return "listdatums." + error; + } + } + if (message.lowerdatums != null && message.hasOwnProperty("lowerdatums")) { + if (!Array.isArray(message.lowerdatums)) + return "lowerdatums: array expected"; + for (var i = 0; i < message.lowerdatums.length; ++i) { + var error = $root.pg_query.Node.verify(message.lowerdatums[i]); + if (error) + return "lowerdatums." + error; + } + } + if (message.upperdatums != null && message.hasOwnProperty("upperdatums")) { + if (!Array.isArray(message.upperdatums)) + return "upperdatums: array expected"; + for (var i = 0; i < message.upperdatums.length; ++i) { + var error = $root.pg_query.Node.verify(message.upperdatums[i]); + if (error) + return "upperdatums." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a PartitionBoundSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.PartitionBoundSpec + * @static + * @param {Object.} object Plain object + * @returns {pg_query.PartitionBoundSpec} PartitionBoundSpec + */ + PartitionBoundSpec.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.PartitionBoundSpec) + return object; + var message = new $root.pg_query.PartitionBoundSpec(); + if (object.strategy != null) + message.strategy = String(object.strategy); + if (object.is_default != null) + message.is_default = Boolean(object.is_default); + if (object.modulus != null) + message.modulus = object.modulus | 0; + if (object.remainder != null) + message.remainder = object.remainder | 0; + if (object.listdatums) { + if (!Array.isArray(object.listdatums)) + throw TypeError(".pg_query.PartitionBoundSpec.listdatums: array expected"); + message.listdatums = []; + for (var i = 0; i < object.listdatums.length; ++i) { + if (typeof object.listdatums[i] !== "object") + throw TypeError(".pg_query.PartitionBoundSpec.listdatums: object expected"); + message.listdatums[i] = $root.pg_query.Node.fromObject(object.listdatums[i]); + } + } + if (object.lowerdatums) { + if (!Array.isArray(object.lowerdatums)) + throw TypeError(".pg_query.PartitionBoundSpec.lowerdatums: array expected"); + message.lowerdatums = []; + for (var i = 0; i < object.lowerdatums.length; ++i) { + if (typeof object.lowerdatums[i] !== "object") + throw TypeError(".pg_query.PartitionBoundSpec.lowerdatums: object expected"); + message.lowerdatums[i] = $root.pg_query.Node.fromObject(object.lowerdatums[i]); + } + } + if (object.upperdatums) { + if (!Array.isArray(object.upperdatums)) + throw TypeError(".pg_query.PartitionBoundSpec.upperdatums: array expected"); + message.upperdatums = []; + for (var i = 0; i < object.upperdatums.length; ++i) { + if (typeof object.upperdatums[i] !== "object") + throw TypeError(".pg_query.PartitionBoundSpec.upperdatums: object expected"); + message.upperdatums[i] = $root.pg_query.Node.fromObject(object.upperdatums[i]); + } + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a PartitionBoundSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.PartitionBoundSpec + * @static + * @param {pg_query.PartitionBoundSpec} message PartitionBoundSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionBoundSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.listdatums = []; + object.lowerdatums = []; + object.upperdatums = []; + } + if (options.defaults) { + object.strategy = ""; + object.is_default = false; + object.modulus = 0; + object.remainder = 0; + object.location = 0; + } + if (message.strategy != null && message.hasOwnProperty("strategy")) + object.strategy = message.strategy; + if (message.is_default != null && message.hasOwnProperty("is_default")) + object.is_default = message.is_default; + if (message.modulus != null && message.hasOwnProperty("modulus")) + object.modulus = message.modulus; + if (message.remainder != null && message.hasOwnProperty("remainder")) + object.remainder = message.remainder; + if (message.listdatums && message.listdatums.length) { + object.listdatums = []; + for (var j = 0; j < message.listdatums.length; ++j) + object.listdatums[j] = $root.pg_query.Node.toObject(message.listdatums[j], options); + } + if (message.lowerdatums && message.lowerdatums.length) { + object.lowerdatums = []; + for (var j = 0; j < message.lowerdatums.length; ++j) + object.lowerdatums[j] = $root.pg_query.Node.toObject(message.lowerdatums[j], options); + } + if (message.upperdatums && message.upperdatums.length) { + object.upperdatums = []; + for (var j = 0; j < message.upperdatums.length; ++j) + object.upperdatums[j] = $root.pg_query.Node.toObject(message.upperdatums[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this PartitionBoundSpec to JSON. + * @function toJSON + * @memberof pg_query.PartitionBoundSpec + * @instance + * @returns {Object.} JSON object + */ + PartitionBoundSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionBoundSpec + * @function getTypeUrl + * @memberof pg_query.PartitionBoundSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionBoundSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.PartitionBoundSpec"; + }; + + return PartitionBoundSpec; + })(); + + pg_query.PartitionRangeDatum = (function() { + + /** + * Properties of a PartitionRangeDatum. + * @memberof pg_query + * @interface IPartitionRangeDatum + * @property {pg_query.PartitionRangeDatumKind|null} [kind] PartitionRangeDatum kind + * @property {pg_query.INode|null} [value] PartitionRangeDatum value + * @property {number|null} [location] PartitionRangeDatum location + */ + + /** + * Constructs a new PartitionRangeDatum. + * @memberof pg_query + * @classdesc Represents a PartitionRangeDatum. + * @implements IPartitionRangeDatum + * @constructor + * @param {pg_query.IPartitionRangeDatum=} [properties] Properties to set + */ + function PartitionRangeDatum(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionRangeDatum kind. + * @member {pg_query.PartitionRangeDatumKind} kind + * @memberof pg_query.PartitionRangeDatum + * @instance + */ + PartitionRangeDatum.prototype.kind = 0; + + /** + * PartitionRangeDatum value. + * @member {pg_query.INode|null|undefined} value + * @memberof pg_query.PartitionRangeDatum + * @instance + */ + PartitionRangeDatum.prototype.value = null; + + /** + * PartitionRangeDatum location. + * @member {number} location + * @memberof pg_query.PartitionRangeDatum + * @instance + */ + PartitionRangeDatum.prototype.location = 0; + + /** + * Creates a new PartitionRangeDatum instance using the specified properties. + * @function create + * @memberof pg_query.PartitionRangeDatum + * @static + * @param {pg_query.IPartitionRangeDatum=} [properties] Properties to set + * @returns {pg_query.PartitionRangeDatum} PartitionRangeDatum instance + */ + PartitionRangeDatum.create = function create(properties) { + return new PartitionRangeDatum(properties); + }; + + /** + * Encodes the specified PartitionRangeDatum message. Does not implicitly {@link pg_query.PartitionRangeDatum.verify|verify} messages. + * @function encode + * @memberof pg_query.PartitionRangeDatum + * @static + * @param {pg_query.IPartitionRangeDatum} message PartitionRangeDatum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionRangeDatum.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.pg_query.Node.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.location); + return writer; + }; + + /** + * Encodes the specified PartitionRangeDatum message, length delimited. Does not implicitly {@link pg_query.PartitionRangeDatum.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.PartitionRangeDatum + * @static + * @param {pg_query.IPartitionRangeDatum} message PartitionRangeDatum message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionRangeDatum.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionRangeDatum message from the specified reader or buffer. + * @function decode + * @memberof pg_query.PartitionRangeDatum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.PartitionRangeDatum} PartitionRangeDatum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionRangeDatum.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.PartitionRangeDatum(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.int32(); + break; + } + case 2: { + message.value = $root.pg_query.Node.decode(reader, reader.uint32()); + break; + } + case 3: { + message.location = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionRangeDatum message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.PartitionRangeDatum + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.PartitionRangeDatum} PartitionRangeDatum + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionRangeDatum.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionRangeDatum message. + * @function verify + * @memberof pg_query.PartitionRangeDatum + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionRangeDatum.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.pg_query.Node.verify(message.value); + if (error) + return "value." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isInteger(message.location)) + return "location: integer expected"; + return null; + }; + + /** + * Creates a PartitionRangeDatum message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.PartitionRangeDatum + * @static + * @param {Object.} object Plain object + * @returns {pg_query.PartitionRangeDatum} PartitionRangeDatum + */ + PartitionRangeDatum.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.PartitionRangeDatum) + return object; + var message = new $root.pg_query.PartitionRangeDatum(); + switch (object.kind) { + default: + if (typeof object.kind === "number") { + message.kind = object.kind; + break; + } + break; + case "PARTITION_RANGE_DATUM_KIND_UNDEFINED": + case 0: + message.kind = 0; + break; + case "PARTITION_RANGE_DATUM_MINVALUE": + case 1: + message.kind = 1; + break; + case "PARTITION_RANGE_DATUM_VALUE": + case 2: + message.kind = 2; + break; + case "PARTITION_RANGE_DATUM_MAXVALUE": + case 3: + message.kind = 3; + break; + } + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".pg_query.PartitionRangeDatum.value: object expected"); + message.value = $root.pg_query.Node.fromObject(object.value); + } + if (object.location != null) + message.location = object.location | 0; + return message; + }; + + /** + * Creates a plain object from a PartitionRangeDatum message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.PartitionRangeDatum + * @static + * @param {pg_query.PartitionRangeDatum} message PartitionRangeDatum + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionRangeDatum.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = options.enums === String ? "PARTITION_RANGE_DATUM_KIND_UNDEFINED" : 0; + object.value = null; + object.location = 0; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.pg_query.PartitionRangeDatumKind[message.kind] === undefined ? message.kind : $root.pg_query.PartitionRangeDatumKind[message.kind] : message.kind; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.pg_query.Node.toObject(message.value, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this PartitionRangeDatum to JSON. + * @function toJSON + * @memberof pg_query.PartitionRangeDatum + * @instance + * @returns {Object.} JSON object + */ + PartitionRangeDatum.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionRangeDatum + * @function getTypeUrl + * @memberof pg_query.PartitionRangeDatum + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionRangeDatum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.PartitionRangeDatum"; + }; + + return PartitionRangeDatum; + })(); + + pg_query.PartitionCmd = (function() { + + /** + * Properties of a PartitionCmd. + * @memberof pg_query + * @interface IPartitionCmd + * @property {pg_query.IRangeVar|null} [name] PartitionCmd name + * @property {pg_query.IPartitionBoundSpec|null} [bound] PartitionCmd bound + */ + + /** + * Constructs a new PartitionCmd. + * @memberof pg_query + * @classdesc Represents a PartitionCmd. + * @implements IPartitionCmd + * @constructor + * @param {pg_query.IPartitionCmd=} [properties] Properties to set + */ + function PartitionCmd(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PartitionCmd name. + * @member {pg_query.IRangeVar|null|undefined} name + * @memberof pg_query.PartitionCmd + * @instance + */ + PartitionCmd.prototype.name = null; + + /** + * PartitionCmd bound. + * @member {pg_query.IPartitionBoundSpec|null|undefined} bound + * @memberof pg_query.PartitionCmd + * @instance + */ + PartitionCmd.prototype.bound = null; + + /** + * Creates a new PartitionCmd instance using the specified properties. + * @function create + * @memberof pg_query.PartitionCmd + * @static + * @param {pg_query.IPartitionCmd=} [properties] Properties to set + * @returns {pg_query.PartitionCmd} PartitionCmd instance + */ + PartitionCmd.create = function create(properties) { + return new PartitionCmd(properties); + }; + + /** + * Encodes the specified PartitionCmd message. Does not implicitly {@link pg_query.PartitionCmd.verify|verify} messages. + * @function encode + * @memberof pg_query.PartitionCmd + * @static + * @param {pg_query.IPartitionCmd} message PartitionCmd message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionCmd.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + $root.pg_query.RangeVar.encode(message.name, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bound != null && Object.hasOwnProperty.call(message, "bound")) + $root.pg_query.PartitionBoundSpec.encode(message.bound, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PartitionCmd message, length delimited. Does not implicitly {@link pg_query.PartitionCmd.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.PartitionCmd + * @static + * @param {pg_query.IPartitionCmd} message PartitionCmd message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionCmd.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionCmd message from the specified reader or buffer. + * @function decode + * @memberof pg_query.PartitionCmd + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.PartitionCmd} PartitionCmd + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionCmd.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.PartitionCmd(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bound = $root.pg_query.PartitionBoundSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionCmd message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.PartitionCmd + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.PartitionCmd} PartitionCmd + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionCmd.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionCmd message. + * @function verify + * @memberof pg_query.PartitionCmd + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionCmd.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + var error = $root.pg_query.RangeVar.verify(message.name); + if (error) + return "name." + error; + } + if (message.bound != null && message.hasOwnProperty("bound")) { + var error = $root.pg_query.PartitionBoundSpec.verify(message.bound); + if (error) + return "bound." + error; + } + return null; + }; + + /** + * Creates a PartitionCmd message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.PartitionCmd + * @static + * @param {Object.} object Plain object + * @returns {pg_query.PartitionCmd} PartitionCmd + */ + PartitionCmd.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.PartitionCmd) + return object; + var message = new $root.pg_query.PartitionCmd(); + if (object.name != null) { + if (typeof object.name !== "object") + throw TypeError(".pg_query.PartitionCmd.name: object expected"); + message.name = $root.pg_query.RangeVar.fromObject(object.name); + } + if (object.bound != null) { + if (typeof object.bound !== "object") + throw TypeError(".pg_query.PartitionCmd.bound: object expected"); + message.bound = $root.pg_query.PartitionBoundSpec.fromObject(object.bound); + } + return message; + }; + + /** + * Creates a plain object from a PartitionCmd message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.PartitionCmd + * @static + * @param {pg_query.PartitionCmd} message PartitionCmd + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionCmd.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = null; + object.bound = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = $root.pg_query.RangeVar.toObject(message.name, options); + if (message.bound != null && message.hasOwnProperty("bound")) + object.bound = $root.pg_query.PartitionBoundSpec.toObject(message.bound, options); + return object; + }; + + /** + * Converts this PartitionCmd to JSON. + * @function toJSON + * @memberof pg_query.PartitionCmd + * @instance + * @returns {Object.} JSON object + */ + PartitionCmd.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionCmd + * @function getTypeUrl + * @memberof pg_query.PartitionCmd + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionCmd.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.PartitionCmd"; + }; + + return PartitionCmd; + })(); + + pg_query.VacuumRelation = (function() { + + /** + * Properties of a VacuumRelation. + * @memberof pg_query + * @interface IVacuumRelation + * @property {pg_query.IRangeVar|null} [relation] VacuumRelation relation + * @property {number|null} [oid] VacuumRelation oid + * @property {Array.|null} [va_cols] VacuumRelation va_cols + */ + + /** + * Constructs a new VacuumRelation. + * @memberof pg_query + * @classdesc Represents a VacuumRelation. + * @implements IVacuumRelation + * @constructor + * @param {pg_query.IVacuumRelation=} [properties] Properties to set + */ + function VacuumRelation(properties) { + this.va_cols = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VacuumRelation relation. + * @member {pg_query.IRangeVar|null|undefined} relation + * @memberof pg_query.VacuumRelation + * @instance + */ + VacuumRelation.prototype.relation = null; + + /** + * VacuumRelation oid. + * @member {number} oid + * @memberof pg_query.VacuumRelation + * @instance + */ + VacuumRelation.prototype.oid = 0; + + /** + * VacuumRelation va_cols. + * @member {Array.} va_cols + * @memberof pg_query.VacuumRelation + * @instance + */ + VacuumRelation.prototype.va_cols = $util.emptyArray; + + /** + * Creates a new VacuumRelation instance using the specified properties. + * @function create + * @memberof pg_query.VacuumRelation + * @static + * @param {pg_query.IVacuumRelation=} [properties] Properties to set + * @returns {pg_query.VacuumRelation} VacuumRelation instance + */ + VacuumRelation.create = function create(properties) { + return new VacuumRelation(properties); + }; + + /** + * Encodes the specified VacuumRelation message. Does not implicitly {@link pg_query.VacuumRelation.verify|verify} messages. + * @function encode + * @memberof pg_query.VacuumRelation + * @static + * @param {pg_query.IVacuumRelation} message VacuumRelation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VacuumRelation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relation != null && Object.hasOwnProperty.call(message, "relation")) + $root.pg_query.RangeVar.encode(message.relation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.oid != null && Object.hasOwnProperty.call(message, "oid")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.oid); + if (message.va_cols != null && message.va_cols.length) + for (var i = 0; i < message.va_cols.length; ++i) + $root.pg_query.Node.encode(message.va_cols[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VacuumRelation message, length delimited. Does not implicitly {@link pg_query.VacuumRelation.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.VacuumRelation + * @static + * @param {pg_query.IVacuumRelation} message VacuumRelation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VacuumRelation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VacuumRelation message from the specified reader or buffer. + * @function decode + * @memberof pg_query.VacuumRelation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.VacuumRelation} VacuumRelation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VacuumRelation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.VacuumRelation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relation = $root.pg_query.RangeVar.decode(reader, reader.uint32()); + break; + } + case 2: { + message.oid = reader.uint32(); + break; + } + case 3: { + if (!(message.va_cols && message.va_cols.length)) + message.va_cols = []; + message.va_cols.push($root.pg_query.Node.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VacuumRelation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.VacuumRelation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.VacuumRelation} VacuumRelation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VacuumRelation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VacuumRelation message. + * @function verify + * @memberof pg_query.VacuumRelation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VacuumRelation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relation != null && message.hasOwnProperty("relation")) { + var error = $root.pg_query.RangeVar.verify(message.relation); + if (error) + return "relation." + error; + } + if (message.oid != null && message.hasOwnProperty("oid")) + if (!$util.isInteger(message.oid)) + return "oid: integer expected"; + if (message.va_cols != null && message.hasOwnProperty("va_cols")) { + if (!Array.isArray(message.va_cols)) + return "va_cols: array expected"; + for (var i = 0; i < message.va_cols.length; ++i) { + var error = $root.pg_query.Node.verify(message.va_cols[i]); + if (error) + return "va_cols." + error; + } + } + return null; + }; + + /** + * Creates a VacuumRelation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.VacuumRelation + * @static + * @param {Object.} object Plain object + * @returns {pg_query.VacuumRelation} VacuumRelation + */ + VacuumRelation.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.VacuumRelation) + return object; + var message = new $root.pg_query.VacuumRelation(); + if (object.relation != null) { + if (typeof object.relation !== "object") + throw TypeError(".pg_query.VacuumRelation.relation: object expected"); + message.relation = $root.pg_query.RangeVar.fromObject(object.relation); + } + if (object.oid != null) + message.oid = object.oid >>> 0; + if (object.va_cols) { + if (!Array.isArray(object.va_cols)) + throw TypeError(".pg_query.VacuumRelation.va_cols: array expected"); + message.va_cols = []; + for (var i = 0; i < object.va_cols.length; ++i) { + if (typeof object.va_cols[i] !== "object") + throw TypeError(".pg_query.VacuumRelation.va_cols: object expected"); + message.va_cols[i] = $root.pg_query.Node.fromObject(object.va_cols[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a VacuumRelation message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.VacuumRelation + * @static + * @param {pg_query.VacuumRelation} message VacuumRelation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VacuumRelation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.va_cols = []; + if (options.defaults) { + object.relation = null; + object.oid = 0; + } + if (message.relation != null && message.hasOwnProperty("relation")) + object.relation = $root.pg_query.RangeVar.toObject(message.relation, options); + if (message.oid != null && message.hasOwnProperty("oid")) + object.oid = message.oid; + if (message.va_cols && message.va_cols.length) { + object.va_cols = []; + for (var j = 0; j < message.va_cols.length; ++j) + object.va_cols[j] = $root.pg_query.Node.toObject(message.va_cols[j], options); + } + return object; + }; + + /** + * Converts this VacuumRelation to JSON. + * @function toJSON + * @memberof pg_query.VacuumRelation + * @instance + * @returns {Object.} JSON object + */ + VacuumRelation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VacuumRelation + * @function getTypeUrl + * @memberof pg_query.VacuumRelation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VacuumRelation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.VacuumRelation"; + }; + + return VacuumRelation; + })(); + + pg_query.InlineCodeBlock = (function() { + + /** + * Properties of an InlineCodeBlock. + * @memberof pg_query + * @interface IInlineCodeBlock + * @property {string|null} [source_text] InlineCodeBlock source_text + * @property {number|null} [langOid] InlineCodeBlock langOid + * @property {boolean|null} [langIsTrusted] InlineCodeBlock langIsTrusted + * @property {boolean|null} [atomic] InlineCodeBlock atomic + */ + + /** + * Constructs a new InlineCodeBlock. + * @memberof pg_query + * @classdesc Represents an InlineCodeBlock. + * @implements IInlineCodeBlock + * @constructor + * @param {pg_query.IInlineCodeBlock=} [properties] Properties to set + */ + function InlineCodeBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InlineCodeBlock source_text. + * @member {string} source_text + * @memberof pg_query.InlineCodeBlock + * @instance + */ + InlineCodeBlock.prototype.source_text = ""; + + /** + * InlineCodeBlock langOid. + * @member {number} langOid + * @memberof pg_query.InlineCodeBlock + * @instance + */ + InlineCodeBlock.prototype.langOid = 0; + + /** + * InlineCodeBlock langIsTrusted. + * @member {boolean} langIsTrusted + * @memberof pg_query.InlineCodeBlock + * @instance + */ + InlineCodeBlock.prototype.langIsTrusted = false; + + /** + * InlineCodeBlock atomic. + * @member {boolean} atomic + * @memberof pg_query.InlineCodeBlock + * @instance + */ + InlineCodeBlock.prototype.atomic = false; + + /** + * Creates a new InlineCodeBlock instance using the specified properties. + * @function create + * @memberof pg_query.InlineCodeBlock + * @static + * @param {pg_query.IInlineCodeBlock=} [properties] Properties to set + * @returns {pg_query.InlineCodeBlock} InlineCodeBlock instance + */ + InlineCodeBlock.create = function create(properties) { + return new InlineCodeBlock(properties); + }; + + /** + * Encodes the specified InlineCodeBlock message. Does not implicitly {@link pg_query.InlineCodeBlock.verify|verify} messages. + * @function encode + * @memberof pg_query.InlineCodeBlock + * @static + * @param {pg_query.IInlineCodeBlock} message InlineCodeBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineCodeBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source_text != null && Object.hasOwnProperty.call(message, "source_text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.source_text); + if (message.langOid != null && Object.hasOwnProperty.call(message, "langOid")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.langOid); + if (message.langIsTrusted != null && Object.hasOwnProperty.call(message, "langIsTrusted")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.langIsTrusted); + if (message.atomic != null && Object.hasOwnProperty.call(message, "atomic")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.atomic); + return writer; + }; + + /** + * Encodes the specified InlineCodeBlock message, length delimited. Does not implicitly {@link pg_query.InlineCodeBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.InlineCodeBlock + * @static + * @param {pg_query.IInlineCodeBlock} message InlineCodeBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InlineCodeBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InlineCodeBlock message from the specified reader or buffer. + * @function decode + * @memberof pg_query.InlineCodeBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.InlineCodeBlock} InlineCodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineCodeBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.InlineCodeBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source_text = reader.string(); + break; + } + case 2: { + message.langOid = reader.uint32(); + break; + } + case 3: { + message.langIsTrusted = reader.bool(); + break; + } + case 4: { + message.atomic = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InlineCodeBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.InlineCodeBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.InlineCodeBlock} InlineCodeBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InlineCodeBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InlineCodeBlock message. + * @function verify + * @memberof pg_query.InlineCodeBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InlineCodeBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source_text != null && message.hasOwnProperty("source_text")) + if (!$util.isString(message.source_text)) + return "source_text: string expected"; + if (message.langOid != null && message.hasOwnProperty("langOid")) + if (!$util.isInteger(message.langOid)) + return "langOid: integer expected"; + if (message.langIsTrusted != null && message.hasOwnProperty("langIsTrusted")) + if (typeof message.langIsTrusted !== "boolean") + return "langIsTrusted: boolean expected"; + if (message.atomic != null && message.hasOwnProperty("atomic")) + if (typeof message.atomic !== "boolean") + return "atomic: boolean expected"; + return null; + }; + + /** + * Creates an InlineCodeBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.InlineCodeBlock + * @static + * @param {Object.} object Plain object + * @returns {pg_query.InlineCodeBlock} InlineCodeBlock + */ + InlineCodeBlock.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.InlineCodeBlock) + return object; + var message = new $root.pg_query.InlineCodeBlock(); + if (object.source_text != null) + message.source_text = String(object.source_text); + if (object.langOid != null) + message.langOid = object.langOid >>> 0; + if (object.langIsTrusted != null) + message.langIsTrusted = Boolean(object.langIsTrusted); + if (object.atomic != null) + message.atomic = Boolean(object.atomic); + return message; + }; + + /** + * Creates a plain object from an InlineCodeBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.InlineCodeBlock + * @static + * @param {pg_query.InlineCodeBlock} message InlineCodeBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InlineCodeBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source_text = ""; + object.langOid = 0; + object.langIsTrusted = false; + object.atomic = false; + } + if (message.source_text != null && message.hasOwnProperty("source_text")) + object.source_text = message.source_text; + if (message.langOid != null && message.hasOwnProperty("langOid")) + object.langOid = message.langOid; + if (message.langIsTrusted != null && message.hasOwnProperty("langIsTrusted")) + object.langIsTrusted = message.langIsTrusted; + if (message.atomic != null && message.hasOwnProperty("atomic")) + object.atomic = message.atomic; + return object; + }; + + /** + * Converts this InlineCodeBlock to JSON. + * @function toJSON + * @memberof pg_query.InlineCodeBlock + * @instance + * @returns {Object.} JSON object + */ + InlineCodeBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InlineCodeBlock + * @function getTypeUrl + * @memberof pg_query.InlineCodeBlock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InlineCodeBlock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.InlineCodeBlock"; + }; + + return InlineCodeBlock; + })(); + + pg_query.CallContext = (function() { + + /** + * Properties of a CallContext. + * @memberof pg_query + * @interface ICallContext + * @property {boolean|null} [atomic] CallContext atomic + */ + + /** + * Constructs a new CallContext. + * @memberof pg_query + * @classdesc Represents a CallContext. + * @implements ICallContext + * @constructor + * @param {pg_query.ICallContext=} [properties] Properties to set + */ + function CallContext(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CallContext atomic. + * @member {boolean} atomic + * @memberof pg_query.CallContext + * @instance + */ + CallContext.prototype.atomic = false; + + /** + * Creates a new CallContext instance using the specified properties. + * @function create + * @memberof pg_query.CallContext + * @static + * @param {pg_query.ICallContext=} [properties] Properties to set + * @returns {pg_query.CallContext} CallContext instance + */ + CallContext.create = function create(properties) { + return new CallContext(properties); + }; + + /** + * Encodes the specified CallContext message. Does not implicitly {@link pg_query.CallContext.verify|verify} messages. + * @function encode + * @memberof pg_query.CallContext + * @static + * @param {pg_query.ICallContext} message CallContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CallContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.atomic != null && Object.hasOwnProperty.call(message, "atomic")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.atomic); + return writer; + }; + + /** + * Encodes the specified CallContext message, length delimited. Does not implicitly {@link pg_query.CallContext.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.CallContext + * @static + * @param {pg_query.ICallContext} message CallContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CallContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CallContext message from the specified reader or buffer. + * @function decode + * @memberof pg_query.CallContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.CallContext} CallContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CallContext.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.CallContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.atomic = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CallContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.CallContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.CallContext} CallContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CallContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CallContext message. + * @function verify + * @memberof pg_query.CallContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CallContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.atomic != null && message.hasOwnProperty("atomic")) + if (typeof message.atomic !== "boolean") + return "atomic: boolean expected"; + return null; + }; + + /** + * Creates a CallContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.CallContext + * @static + * @param {Object.} object Plain object + * @returns {pg_query.CallContext} CallContext + */ + CallContext.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.CallContext) + return object; + var message = new $root.pg_query.CallContext(); + if (object.atomic != null) + message.atomic = Boolean(object.atomic); + return message; + }; + + /** + * Creates a plain object from a CallContext message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.CallContext + * @static + * @param {pg_query.CallContext} message CallContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CallContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.atomic = false; + if (message.atomic != null && message.hasOwnProperty("atomic")) + object.atomic = message.atomic; + return object; + }; + + /** + * Converts this CallContext to JSON. + * @function toJSON + * @memberof pg_query.CallContext + * @instance + * @returns {Object.} JSON object + */ + CallContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CallContext + * @function getTypeUrl + * @memberof pg_query.CallContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CallContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.CallContext"; + }; + + return CallContext; + })(); + + /** + * OverridingKind enum. + * @name pg_query.OverridingKind + * @enum {number} + * @property {number} OVERRIDING_KIND_UNDEFINED=0 OVERRIDING_KIND_UNDEFINED value + * @property {number} OVERRIDING_NOT_SET=1 OVERRIDING_NOT_SET value + * @property {number} OVERRIDING_USER_VALUE=2 OVERRIDING_USER_VALUE value + * @property {number} OVERRIDING_SYSTEM_VALUE=3 OVERRIDING_SYSTEM_VALUE value + */ + pg_query.OverridingKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OVERRIDING_KIND_UNDEFINED"] = 0; + values[valuesById[1] = "OVERRIDING_NOT_SET"] = 1; + values[valuesById[2] = "OVERRIDING_USER_VALUE"] = 2; + values[valuesById[3] = "OVERRIDING_SYSTEM_VALUE"] = 3; + return values; + })(); + + /** + * QuerySource enum. + * @name pg_query.QuerySource + * @enum {number} + * @property {number} QUERY_SOURCE_UNDEFINED=0 QUERY_SOURCE_UNDEFINED value + * @property {number} QSRC_ORIGINAL=1 QSRC_ORIGINAL value + * @property {number} QSRC_PARSER=2 QSRC_PARSER value + * @property {number} QSRC_INSTEAD_RULE=3 QSRC_INSTEAD_RULE value + * @property {number} QSRC_QUAL_INSTEAD_RULE=4 QSRC_QUAL_INSTEAD_RULE value + * @property {number} QSRC_NON_INSTEAD_RULE=5 QSRC_NON_INSTEAD_RULE value + */ + pg_query.QuerySource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "QUERY_SOURCE_UNDEFINED"] = 0; + values[valuesById[1] = "QSRC_ORIGINAL"] = 1; + values[valuesById[2] = "QSRC_PARSER"] = 2; + values[valuesById[3] = "QSRC_INSTEAD_RULE"] = 3; + values[valuesById[4] = "QSRC_QUAL_INSTEAD_RULE"] = 4; + values[valuesById[5] = "QSRC_NON_INSTEAD_RULE"] = 5; + return values; + })(); + + /** + * SortByDir enum. + * @name pg_query.SortByDir + * @enum {number} + * @property {number} SORT_BY_DIR_UNDEFINED=0 SORT_BY_DIR_UNDEFINED value + * @property {number} SORTBY_DEFAULT=1 SORTBY_DEFAULT value + * @property {number} SORTBY_ASC=2 SORTBY_ASC value + * @property {number} SORTBY_DESC=3 SORTBY_DESC value + * @property {number} SORTBY_USING=4 SORTBY_USING value + */ + pg_query.SortByDir = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SORT_BY_DIR_UNDEFINED"] = 0; + values[valuesById[1] = "SORTBY_DEFAULT"] = 1; + values[valuesById[2] = "SORTBY_ASC"] = 2; + values[valuesById[3] = "SORTBY_DESC"] = 3; + values[valuesById[4] = "SORTBY_USING"] = 4; + return values; + })(); + + /** + * SortByNulls enum. + * @name pg_query.SortByNulls + * @enum {number} + * @property {number} SORT_BY_NULLS_UNDEFINED=0 SORT_BY_NULLS_UNDEFINED value + * @property {number} SORTBY_NULLS_DEFAULT=1 SORTBY_NULLS_DEFAULT value + * @property {number} SORTBY_NULLS_FIRST=2 SORTBY_NULLS_FIRST value + * @property {number} SORTBY_NULLS_LAST=3 SORTBY_NULLS_LAST value + */ + pg_query.SortByNulls = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SORT_BY_NULLS_UNDEFINED"] = 0; + values[valuesById[1] = "SORTBY_NULLS_DEFAULT"] = 1; + values[valuesById[2] = "SORTBY_NULLS_FIRST"] = 2; + values[valuesById[3] = "SORTBY_NULLS_LAST"] = 3; + return values; + })(); + + /** + * A_Expr_Kind enum. + * @name pg_query.A_Expr_Kind + * @enum {number} + * @property {number} A_EXPR_KIND_UNDEFINED=0 A_EXPR_KIND_UNDEFINED value + * @property {number} AEXPR_OP=1 AEXPR_OP value + * @property {number} AEXPR_OP_ANY=2 AEXPR_OP_ANY value + * @property {number} AEXPR_OP_ALL=3 AEXPR_OP_ALL value + * @property {number} AEXPR_DISTINCT=4 AEXPR_DISTINCT value + * @property {number} AEXPR_NOT_DISTINCT=5 AEXPR_NOT_DISTINCT value + * @property {number} AEXPR_NULLIF=6 AEXPR_NULLIF value + * @property {number} AEXPR_OF=7 AEXPR_OF value + * @property {number} AEXPR_IN=8 AEXPR_IN value + * @property {number} AEXPR_LIKE=9 AEXPR_LIKE value + * @property {number} AEXPR_ILIKE=10 AEXPR_ILIKE value + * @property {number} AEXPR_SIMILAR=11 AEXPR_SIMILAR value + * @property {number} AEXPR_BETWEEN=12 AEXPR_BETWEEN value + * @property {number} AEXPR_NOT_BETWEEN=13 AEXPR_NOT_BETWEEN value + * @property {number} AEXPR_BETWEEN_SYM=14 AEXPR_BETWEEN_SYM value + * @property {number} AEXPR_NOT_BETWEEN_SYM=15 AEXPR_NOT_BETWEEN_SYM value + * @property {number} AEXPR_PAREN=16 AEXPR_PAREN value + */ + pg_query.A_Expr_Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "A_EXPR_KIND_UNDEFINED"] = 0; + values[valuesById[1] = "AEXPR_OP"] = 1; + values[valuesById[2] = "AEXPR_OP_ANY"] = 2; + values[valuesById[3] = "AEXPR_OP_ALL"] = 3; + values[valuesById[4] = "AEXPR_DISTINCT"] = 4; + values[valuesById[5] = "AEXPR_NOT_DISTINCT"] = 5; + values[valuesById[6] = "AEXPR_NULLIF"] = 6; + values[valuesById[7] = "AEXPR_OF"] = 7; + values[valuesById[8] = "AEXPR_IN"] = 8; + values[valuesById[9] = "AEXPR_LIKE"] = 9; + values[valuesById[10] = "AEXPR_ILIKE"] = 10; + values[valuesById[11] = "AEXPR_SIMILAR"] = 11; + values[valuesById[12] = "AEXPR_BETWEEN"] = 12; + values[valuesById[13] = "AEXPR_NOT_BETWEEN"] = 13; + values[valuesById[14] = "AEXPR_BETWEEN_SYM"] = 14; + values[valuesById[15] = "AEXPR_NOT_BETWEEN_SYM"] = 15; + values[valuesById[16] = "AEXPR_PAREN"] = 16; + return values; + })(); + + /** + * RoleSpecType enum. + * @name pg_query.RoleSpecType + * @enum {number} + * @property {number} ROLE_SPEC_TYPE_UNDEFINED=0 ROLE_SPEC_TYPE_UNDEFINED value + * @property {number} ROLESPEC_CSTRING=1 ROLESPEC_CSTRING value + * @property {number} ROLESPEC_CURRENT_USER=2 ROLESPEC_CURRENT_USER value + * @property {number} ROLESPEC_SESSION_USER=3 ROLESPEC_SESSION_USER value + * @property {number} ROLESPEC_PUBLIC=4 ROLESPEC_PUBLIC value + */ + pg_query.RoleSpecType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_SPEC_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "ROLESPEC_CSTRING"] = 1; + values[valuesById[2] = "ROLESPEC_CURRENT_USER"] = 2; + values[valuesById[3] = "ROLESPEC_SESSION_USER"] = 3; + values[valuesById[4] = "ROLESPEC_PUBLIC"] = 4; + return values; + })(); + + /** + * TableLikeOption enum. + * @name pg_query.TableLikeOption + * @enum {number} + * @property {number} TABLE_LIKE_OPTION_UNDEFINED=0 TABLE_LIKE_OPTION_UNDEFINED value + * @property {number} CREATE_TABLE_LIKE_COMMENTS=1 CREATE_TABLE_LIKE_COMMENTS value + * @property {number} CREATE_TABLE_LIKE_CONSTRAINTS=2 CREATE_TABLE_LIKE_CONSTRAINTS value + * @property {number} CREATE_TABLE_LIKE_DEFAULTS=3 CREATE_TABLE_LIKE_DEFAULTS value + * @property {number} CREATE_TABLE_LIKE_GENERATED=4 CREATE_TABLE_LIKE_GENERATED value + * @property {number} CREATE_TABLE_LIKE_IDENTITY=5 CREATE_TABLE_LIKE_IDENTITY value + * @property {number} CREATE_TABLE_LIKE_INDEXES=6 CREATE_TABLE_LIKE_INDEXES value + * @property {number} CREATE_TABLE_LIKE_STATISTICS=7 CREATE_TABLE_LIKE_STATISTICS value + * @property {number} CREATE_TABLE_LIKE_STORAGE=8 CREATE_TABLE_LIKE_STORAGE value + * @property {number} CREATE_TABLE_LIKE_ALL=9 CREATE_TABLE_LIKE_ALL value + */ + pg_query.TableLikeOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TABLE_LIKE_OPTION_UNDEFINED"] = 0; + values[valuesById[1] = "CREATE_TABLE_LIKE_COMMENTS"] = 1; + values[valuesById[2] = "CREATE_TABLE_LIKE_CONSTRAINTS"] = 2; + values[valuesById[3] = "CREATE_TABLE_LIKE_DEFAULTS"] = 3; + values[valuesById[4] = "CREATE_TABLE_LIKE_GENERATED"] = 4; + values[valuesById[5] = "CREATE_TABLE_LIKE_IDENTITY"] = 5; + values[valuesById[6] = "CREATE_TABLE_LIKE_INDEXES"] = 6; + values[valuesById[7] = "CREATE_TABLE_LIKE_STATISTICS"] = 7; + values[valuesById[8] = "CREATE_TABLE_LIKE_STORAGE"] = 8; + values[valuesById[9] = "CREATE_TABLE_LIKE_ALL"] = 9; + return values; + })(); + + /** + * DefElemAction enum. + * @name pg_query.DefElemAction + * @enum {number} + * @property {number} DEF_ELEM_ACTION_UNDEFINED=0 DEF_ELEM_ACTION_UNDEFINED value + * @property {number} DEFELEM_UNSPEC=1 DEFELEM_UNSPEC value + * @property {number} DEFELEM_SET=2 DEFELEM_SET value + * @property {number} DEFELEM_ADD=3 DEFELEM_ADD value + * @property {number} DEFELEM_DROP=4 DEFELEM_DROP value + */ + pg_query.DefElemAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEF_ELEM_ACTION_UNDEFINED"] = 0; + values[valuesById[1] = "DEFELEM_UNSPEC"] = 1; + values[valuesById[2] = "DEFELEM_SET"] = 2; + values[valuesById[3] = "DEFELEM_ADD"] = 3; + values[valuesById[4] = "DEFELEM_DROP"] = 4; + return values; + })(); + + /** + * PartitionRangeDatumKind enum. + * @name pg_query.PartitionRangeDatumKind + * @enum {number} + * @property {number} PARTITION_RANGE_DATUM_KIND_UNDEFINED=0 PARTITION_RANGE_DATUM_KIND_UNDEFINED value + * @property {number} PARTITION_RANGE_DATUM_MINVALUE=1 PARTITION_RANGE_DATUM_MINVALUE value + * @property {number} PARTITION_RANGE_DATUM_VALUE=2 PARTITION_RANGE_DATUM_VALUE value + * @property {number} PARTITION_RANGE_DATUM_MAXVALUE=3 PARTITION_RANGE_DATUM_MAXVALUE value + */ + pg_query.PartitionRangeDatumKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARTITION_RANGE_DATUM_KIND_UNDEFINED"] = 0; + values[valuesById[1] = "PARTITION_RANGE_DATUM_MINVALUE"] = 1; + values[valuesById[2] = "PARTITION_RANGE_DATUM_VALUE"] = 2; + values[valuesById[3] = "PARTITION_RANGE_DATUM_MAXVALUE"] = 3; + return values; + })(); + + /** + * RTEKind enum. + * @name pg_query.RTEKind + * @enum {number} + * @property {number} RTEKIND_UNDEFINED=0 RTEKIND_UNDEFINED value + * @property {number} RTE_RELATION=1 RTE_RELATION value + * @property {number} RTE_SUBQUERY=2 RTE_SUBQUERY value + * @property {number} RTE_JOIN=3 RTE_JOIN value + * @property {number} RTE_FUNCTION=4 RTE_FUNCTION value + * @property {number} RTE_TABLEFUNC=5 RTE_TABLEFUNC value + * @property {number} RTE_VALUES=6 RTE_VALUES value + * @property {number} RTE_CTE=7 RTE_CTE value + * @property {number} RTE_NAMEDTUPLESTORE=8 RTE_NAMEDTUPLESTORE value + * @property {number} RTE_RESULT=9 RTE_RESULT value + */ + pg_query.RTEKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RTEKIND_UNDEFINED"] = 0; + values[valuesById[1] = "RTE_RELATION"] = 1; + values[valuesById[2] = "RTE_SUBQUERY"] = 2; + values[valuesById[3] = "RTE_JOIN"] = 3; + values[valuesById[4] = "RTE_FUNCTION"] = 4; + values[valuesById[5] = "RTE_TABLEFUNC"] = 5; + values[valuesById[6] = "RTE_VALUES"] = 6; + values[valuesById[7] = "RTE_CTE"] = 7; + values[valuesById[8] = "RTE_NAMEDTUPLESTORE"] = 8; + values[valuesById[9] = "RTE_RESULT"] = 9; + return values; + })(); + + /** + * WCOKind enum. + * @name pg_query.WCOKind + * @enum {number} + * @property {number} WCOKIND_UNDEFINED=0 WCOKIND_UNDEFINED value + * @property {number} WCO_VIEW_CHECK=1 WCO_VIEW_CHECK value + * @property {number} WCO_RLS_INSERT_CHECK=2 WCO_RLS_INSERT_CHECK value + * @property {number} WCO_RLS_UPDATE_CHECK=3 WCO_RLS_UPDATE_CHECK value + * @property {number} WCO_RLS_CONFLICT_CHECK=4 WCO_RLS_CONFLICT_CHECK value + */ + pg_query.WCOKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WCOKIND_UNDEFINED"] = 0; + values[valuesById[1] = "WCO_VIEW_CHECK"] = 1; + values[valuesById[2] = "WCO_RLS_INSERT_CHECK"] = 2; + values[valuesById[3] = "WCO_RLS_UPDATE_CHECK"] = 3; + values[valuesById[4] = "WCO_RLS_CONFLICT_CHECK"] = 4; + return values; + })(); + + /** + * GroupingSetKind enum. + * @name pg_query.GroupingSetKind + * @enum {number} + * @property {number} GROUPING_SET_KIND_UNDEFINED=0 GROUPING_SET_KIND_UNDEFINED value + * @property {number} GROUPING_SET_EMPTY=1 GROUPING_SET_EMPTY value + * @property {number} GROUPING_SET_SIMPLE=2 GROUPING_SET_SIMPLE value + * @property {number} GROUPING_SET_ROLLUP=3 GROUPING_SET_ROLLUP value + * @property {number} GROUPING_SET_CUBE=4 GROUPING_SET_CUBE value + * @property {number} GROUPING_SET_SETS=5 GROUPING_SET_SETS value + */ + pg_query.GroupingSetKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GROUPING_SET_KIND_UNDEFINED"] = 0; + values[valuesById[1] = "GROUPING_SET_EMPTY"] = 1; + values[valuesById[2] = "GROUPING_SET_SIMPLE"] = 2; + values[valuesById[3] = "GROUPING_SET_ROLLUP"] = 3; + values[valuesById[4] = "GROUPING_SET_CUBE"] = 4; + values[valuesById[5] = "GROUPING_SET_SETS"] = 5; + return values; + })(); + + /** + * CTEMaterialize enum. + * @name pg_query.CTEMaterialize + * @enum {number} + * @property {number} CTEMATERIALIZE_UNDEFINED=0 CTEMATERIALIZE_UNDEFINED value + * @property {number} CTEMaterializeDefault=1 CTEMaterializeDefault value + * @property {number} CTEMaterializeAlways=2 CTEMaterializeAlways value + * @property {number} CTEMaterializeNever=3 CTEMaterializeNever value + */ + pg_query.CTEMaterialize = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CTEMATERIALIZE_UNDEFINED"] = 0; + values[valuesById[1] = "CTEMaterializeDefault"] = 1; + values[valuesById[2] = "CTEMaterializeAlways"] = 2; + values[valuesById[3] = "CTEMaterializeNever"] = 3; + return values; + })(); + + /** + * SetOperation enum. + * @name pg_query.SetOperation + * @enum {number} + * @property {number} SET_OPERATION_UNDEFINED=0 SET_OPERATION_UNDEFINED value + * @property {number} SETOP_NONE=1 SETOP_NONE value + * @property {number} SETOP_UNION=2 SETOP_UNION value + * @property {number} SETOP_INTERSECT=3 SETOP_INTERSECT value + * @property {number} SETOP_EXCEPT=4 SETOP_EXCEPT value + */ + pg_query.SetOperation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SET_OPERATION_UNDEFINED"] = 0; + values[valuesById[1] = "SETOP_NONE"] = 1; + values[valuesById[2] = "SETOP_UNION"] = 2; + values[valuesById[3] = "SETOP_INTERSECT"] = 3; + values[valuesById[4] = "SETOP_EXCEPT"] = 4; + return values; + })(); + + /** + * ObjectType enum. + * @name pg_query.ObjectType + * @enum {number} + * @property {number} OBJECT_TYPE_UNDEFINED=0 OBJECT_TYPE_UNDEFINED value + * @property {number} OBJECT_ACCESS_METHOD=1 OBJECT_ACCESS_METHOD value + * @property {number} OBJECT_AGGREGATE=2 OBJECT_AGGREGATE value + * @property {number} OBJECT_AMOP=3 OBJECT_AMOP value + * @property {number} OBJECT_AMPROC=4 OBJECT_AMPROC value + * @property {number} OBJECT_ATTRIBUTE=5 OBJECT_ATTRIBUTE value + * @property {number} OBJECT_CAST=6 OBJECT_CAST value + * @property {number} OBJECT_COLUMN=7 OBJECT_COLUMN value + * @property {number} OBJECT_COLLATION=8 OBJECT_COLLATION value + * @property {number} OBJECT_CONVERSION=9 OBJECT_CONVERSION value + * @property {number} OBJECT_DATABASE=10 OBJECT_DATABASE value + * @property {number} OBJECT_DEFAULT=11 OBJECT_DEFAULT value + * @property {number} OBJECT_DEFACL=12 OBJECT_DEFACL value + * @property {number} OBJECT_DOMAIN=13 OBJECT_DOMAIN value + * @property {number} OBJECT_DOMCONSTRAINT=14 OBJECT_DOMCONSTRAINT value + * @property {number} OBJECT_EVENT_TRIGGER=15 OBJECT_EVENT_TRIGGER value + * @property {number} OBJECT_EXTENSION=16 OBJECT_EXTENSION value + * @property {number} OBJECT_FDW=17 OBJECT_FDW value + * @property {number} OBJECT_FOREIGN_SERVER=18 OBJECT_FOREIGN_SERVER value + * @property {number} OBJECT_FOREIGN_TABLE=19 OBJECT_FOREIGN_TABLE value + * @property {number} OBJECT_FUNCTION=20 OBJECT_FUNCTION value + * @property {number} OBJECT_INDEX=21 OBJECT_INDEX value + * @property {number} OBJECT_LANGUAGE=22 OBJECT_LANGUAGE value + * @property {number} OBJECT_LARGEOBJECT=23 OBJECT_LARGEOBJECT value + * @property {number} OBJECT_MATVIEW=24 OBJECT_MATVIEW value + * @property {number} OBJECT_OPCLASS=25 OBJECT_OPCLASS value + * @property {number} OBJECT_OPERATOR=26 OBJECT_OPERATOR value + * @property {number} OBJECT_OPFAMILY=27 OBJECT_OPFAMILY value + * @property {number} OBJECT_POLICY=28 OBJECT_POLICY value + * @property {number} OBJECT_PROCEDURE=29 OBJECT_PROCEDURE value + * @property {number} OBJECT_PUBLICATION=30 OBJECT_PUBLICATION value + * @property {number} OBJECT_PUBLICATION_REL=31 OBJECT_PUBLICATION_REL value + * @property {number} OBJECT_ROLE=32 OBJECT_ROLE value + * @property {number} OBJECT_ROUTINE=33 OBJECT_ROUTINE value + * @property {number} OBJECT_RULE=34 OBJECT_RULE value + * @property {number} OBJECT_SCHEMA=35 OBJECT_SCHEMA value + * @property {number} OBJECT_SEQUENCE=36 OBJECT_SEQUENCE value + * @property {number} OBJECT_SUBSCRIPTION=37 OBJECT_SUBSCRIPTION value + * @property {number} OBJECT_STATISTIC_EXT=38 OBJECT_STATISTIC_EXT value + * @property {number} OBJECT_TABCONSTRAINT=39 OBJECT_TABCONSTRAINT value + * @property {number} OBJECT_TABLE=40 OBJECT_TABLE value + * @property {number} OBJECT_TABLESPACE=41 OBJECT_TABLESPACE value + * @property {number} OBJECT_TRANSFORM=42 OBJECT_TRANSFORM value + * @property {number} OBJECT_TRIGGER=43 OBJECT_TRIGGER value + * @property {number} OBJECT_TSCONFIGURATION=44 OBJECT_TSCONFIGURATION value + * @property {number} OBJECT_TSDICTIONARY=45 OBJECT_TSDICTIONARY value + * @property {number} OBJECT_TSPARSER=46 OBJECT_TSPARSER value + * @property {number} OBJECT_TSTEMPLATE=47 OBJECT_TSTEMPLATE value + * @property {number} OBJECT_TYPE=48 OBJECT_TYPE value + * @property {number} OBJECT_USER_MAPPING=49 OBJECT_USER_MAPPING value + * @property {number} OBJECT_VIEW=50 OBJECT_VIEW value + */ + pg_query.ObjectType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OBJECT_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "OBJECT_ACCESS_METHOD"] = 1; + values[valuesById[2] = "OBJECT_AGGREGATE"] = 2; + values[valuesById[3] = "OBJECT_AMOP"] = 3; + values[valuesById[4] = "OBJECT_AMPROC"] = 4; + values[valuesById[5] = "OBJECT_ATTRIBUTE"] = 5; + values[valuesById[6] = "OBJECT_CAST"] = 6; + values[valuesById[7] = "OBJECT_COLUMN"] = 7; + values[valuesById[8] = "OBJECT_COLLATION"] = 8; + values[valuesById[9] = "OBJECT_CONVERSION"] = 9; + values[valuesById[10] = "OBJECT_DATABASE"] = 10; + values[valuesById[11] = "OBJECT_DEFAULT"] = 11; + values[valuesById[12] = "OBJECT_DEFACL"] = 12; + values[valuesById[13] = "OBJECT_DOMAIN"] = 13; + values[valuesById[14] = "OBJECT_DOMCONSTRAINT"] = 14; + values[valuesById[15] = "OBJECT_EVENT_TRIGGER"] = 15; + values[valuesById[16] = "OBJECT_EXTENSION"] = 16; + values[valuesById[17] = "OBJECT_FDW"] = 17; + values[valuesById[18] = "OBJECT_FOREIGN_SERVER"] = 18; + values[valuesById[19] = "OBJECT_FOREIGN_TABLE"] = 19; + values[valuesById[20] = "OBJECT_FUNCTION"] = 20; + values[valuesById[21] = "OBJECT_INDEX"] = 21; + values[valuesById[22] = "OBJECT_LANGUAGE"] = 22; + values[valuesById[23] = "OBJECT_LARGEOBJECT"] = 23; + values[valuesById[24] = "OBJECT_MATVIEW"] = 24; + values[valuesById[25] = "OBJECT_OPCLASS"] = 25; + values[valuesById[26] = "OBJECT_OPERATOR"] = 26; + values[valuesById[27] = "OBJECT_OPFAMILY"] = 27; + values[valuesById[28] = "OBJECT_POLICY"] = 28; + values[valuesById[29] = "OBJECT_PROCEDURE"] = 29; + values[valuesById[30] = "OBJECT_PUBLICATION"] = 30; + values[valuesById[31] = "OBJECT_PUBLICATION_REL"] = 31; + values[valuesById[32] = "OBJECT_ROLE"] = 32; + values[valuesById[33] = "OBJECT_ROUTINE"] = 33; + values[valuesById[34] = "OBJECT_RULE"] = 34; + values[valuesById[35] = "OBJECT_SCHEMA"] = 35; + values[valuesById[36] = "OBJECT_SEQUENCE"] = 36; + values[valuesById[37] = "OBJECT_SUBSCRIPTION"] = 37; + values[valuesById[38] = "OBJECT_STATISTIC_EXT"] = 38; + values[valuesById[39] = "OBJECT_TABCONSTRAINT"] = 39; + values[valuesById[40] = "OBJECT_TABLE"] = 40; + values[valuesById[41] = "OBJECT_TABLESPACE"] = 41; + values[valuesById[42] = "OBJECT_TRANSFORM"] = 42; + values[valuesById[43] = "OBJECT_TRIGGER"] = 43; + values[valuesById[44] = "OBJECT_TSCONFIGURATION"] = 44; + values[valuesById[45] = "OBJECT_TSDICTIONARY"] = 45; + values[valuesById[46] = "OBJECT_TSPARSER"] = 46; + values[valuesById[47] = "OBJECT_TSTEMPLATE"] = 47; + values[valuesById[48] = "OBJECT_TYPE"] = 48; + values[valuesById[49] = "OBJECT_USER_MAPPING"] = 49; + values[valuesById[50] = "OBJECT_VIEW"] = 50; + return values; + })(); + + /** + * DropBehavior enum. + * @name pg_query.DropBehavior + * @enum {number} + * @property {number} DROP_BEHAVIOR_UNDEFINED=0 DROP_BEHAVIOR_UNDEFINED value + * @property {number} DROP_RESTRICT=1 DROP_RESTRICT value + * @property {number} DROP_CASCADE=2 DROP_CASCADE value + */ + pg_query.DropBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DROP_BEHAVIOR_UNDEFINED"] = 0; + values[valuesById[1] = "DROP_RESTRICT"] = 1; + values[valuesById[2] = "DROP_CASCADE"] = 2; + return values; + })(); + + /** + * AlterTableType enum. + * @name pg_query.AlterTableType + * @enum {number} + * @property {number} ALTER_TABLE_TYPE_UNDEFINED=0 ALTER_TABLE_TYPE_UNDEFINED value + * @property {number} AT_AddColumn=1 AT_AddColumn value + * @property {number} AT_AddColumnRecurse=2 AT_AddColumnRecurse value + * @property {number} AT_AddColumnToView=3 AT_AddColumnToView value + * @property {number} AT_ColumnDefault=4 AT_ColumnDefault value + * @property {number} AT_CookedColumnDefault=5 AT_CookedColumnDefault value + * @property {number} AT_DropNotNull=6 AT_DropNotNull value + * @property {number} AT_SetNotNull=7 AT_SetNotNull value + * @property {number} AT_DropExpression=8 AT_DropExpression value + * @property {number} AT_CheckNotNull=9 AT_CheckNotNull value + * @property {number} AT_SetStatistics=10 AT_SetStatistics value + * @property {number} AT_SetOptions=11 AT_SetOptions value + * @property {number} AT_ResetOptions=12 AT_ResetOptions value + * @property {number} AT_SetStorage=13 AT_SetStorage value + * @property {number} AT_DropColumn=14 AT_DropColumn value + * @property {number} AT_DropColumnRecurse=15 AT_DropColumnRecurse value + * @property {number} AT_AddIndex=16 AT_AddIndex value + * @property {number} AT_ReAddIndex=17 AT_ReAddIndex value + * @property {number} AT_AddConstraint=18 AT_AddConstraint value + * @property {number} AT_AddConstraintRecurse=19 AT_AddConstraintRecurse value + * @property {number} AT_ReAddConstraint=20 AT_ReAddConstraint value + * @property {number} AT_ReAddDomainConstraint=21 AT_ReAddDomainConstraint value + * @property {number} AT_AlterConstraint=22 AT_AlterConstraint value + * @property {number} AT_ValidateConstraint=23 AT_ValidateConstraint value + * @property {number} AT_ValidateConstraintRecurse=24 AT_ValidateConstraintRecurse value + * @property {number} AT_AddIndexConstraint=25 AT_AddIndexConstraint value + * @property {number} AT_DropConstraint=26 AT_DropConstraint value + * @property {number} AT_DropConstraintRecurse=27 AT_DropConstraintRecurse value + * @property {number} AT_ReAddComment=28 AT_ReAddComment value + * @property {number} AT_AlterColumnType=29 AT_AlterColumnType value + * @property {number} AT_AlterColumnGenericOptions=30 AT_AlterColumnGenericOptions value + * @property {number} AT_ChangeOwner=31 AT_ChangeOwner value + * @property {number} AT_ClusterOn=32 AT_ClusterOn value + * @property {number} AT_DropCluster=33 AT_DropCluster value + * @property {number} AT_SetLogged=34 AT_SetLogged value + * @property {number} AT_SetUnLogged=35 AT_SetUnLogged value + * @property {number} AT_DropOids=36 AT_DropOids value + * @property {number} AT_SetTableSpace=37 AT_SetTableSpace value + * @property {number} AT_SetRelOptions=38 AT_SetRelOptions value + * @property {number} AT_ResetRelOptions=39 AT_ResetRelOptions value + * @property {number} AT_ReplaceRelOptions=40 AT_ReplaceRelOptions value + * @property {number} AT_EnableTrig=41 AT_EnableTrig value + * @property {number} AT_EnableAlwaysTrig=42 AT_EnableAlwaysTrig value + * @property {number} AT_EnableReplicaTrig=43 AT_EnableReplicaTrig value + * @property {number} AT_DisableTrig=44 AT_DisableTrig value + * @property {number} AT_EnableTrigAll=45 AT_EnableTrigAll value + * @property {number} AT_DisableTrigAll=46 AT_DisableTrigAll value + * @property {number} AT_EnableTrigUser=47 AT_EnableTrigUser value + * @property {number} AT_DisableTrigUser=48 AT_DisableTrigUser value + * @property {number} AT_EnableRule=49 AT_EnableRule value + * @property {number} AT_EnableAlwaysRule=50 AT_EnableAlwaysRule value + * @property {number} AT_EnableReplicaRule=51 AT_EnableReplicaRule value + * @property {number} AT_DisableRule=52 AT_DisableRule value + * @property {number} AT_AddInherit=53 AT_AddInherit value + * @property {number} AT_DropInherit=54 AT_DropInherit value + * @property {number} AT_AddOf=55 AT_AddOf value + * @property {number} AT_DropOf=56 AT_DropOf value + * @property {number} AT_ReplicaIdentity=57 AT_ReplicaIdentity value + * @property {number} AT_EnableRowSecurity=58 AT_EnableRowSecurity value + * @property {number} AT_DisableRowSecurity=59 AT_DisableRowSecurity value + * @property {number} AT_ForceRowSecurity=60 AT_ForceRowSecurity value + * @property {number} AT_NoForceRowSecurity=61 AT_NoForceRowSecurity value + * @property {number} AT_GenericOptions=62 AT_GenericOptions value + * @property {number} AT_AttachPartition=63 AT_AttachPartition value + * @property {number} AT_DetachPartition=64 AT_DetachPartition value + * @property {number} AT_AddIdentity=65 AT_AddIdentity value + * @property {number} AT_SetIdentity=66 AT_SetIdentity value + * @property {number} AT_DropIdentity=67 AT_DropIdentity value + */ + pg_query.AlterTableType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ALTER_TABLE_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "AT_AddColumn"] = 1; + values[valuesById[2] = "AT_AddColumnRecurse"] = 2; + values[valuesById[3] = "AT_AddColumnToView"] = 3; + values[valuesById[4] = "AT_ColumnDefault"] = 4; + values[valuesById[5] = "AT_CookedColumnDefault"] = 5; + values[valuesById[6] = "AT_DropNotNull"] = 6; + values[valuesById[7] = "AT_SetNotNull"] = 7; + values[valuesById[8] = "AT_DropExpression"] = 8; + values[valuesById[9] = "AT_CheckNotNull"] = 9; + values[valuesById[10] = "AT_SetStatistics"] = 10; + values[valuesById[11] = "AT_SetOptions"] = 11; + values[valuesById[12] = "AT_ResetOptions"] = 12; + values[valuesById[13] = "AT_SetStorage"] = 13; + values[valuesById[14] = "AT_DropColumn"] = 14; + values[valuesById[15] = "AT_DropColumnRecurse"] = 15; + values[valuesById[16] = "AT_AddIndex"] = 16; + values[valuesById[17] = "AT_ReAddIndex"] = 17; + values[valuesById[18] = "AT_AddConstraint"] = 18; + values[valuesById[19] = "AT_AddConstraintRecurse"] = 19; + values[valuesById[20] = "AT_ReAddConstraint"] = 20; + values[valuesById[21] = "AT_ReAddDomainConstraint"] = 21; + values[valuesById[22] = "AT_AlterConstraint"] = 22; + values[valuesById[23] = "AT_ValidateConstraint"] = 23; + values[valuesById[24] = "AT_ValidateConstraintRecurse"] = 24; + values[valuesById[25] = "AT_AddIndexConstraint"] = 25; + values[valuesById[26] = "AT_DropConstraint"] = 26; + values[valuesById[27] = "AT_DropConstraintRecurse"] = 27; + values[valuesById[28] = "AT_ReAddComment"] = 28; + values[valuesById[29] = "AT_AlterColumnType"] = 29; + values[valuesById[30] = "AT_AlterColumnGenericOptions"] = 30; + values[valuesById[31] = "AT_ChangeOwner"] = 31; + values[valuesById[32] = "AT_ClusterOn"] = 32; + values[valuesById[33] = "AT_DropCluster"] = 33; + values[valuesById[34] = "AT_SetLogged"] = 34; + values[valuesById[35] = "AT_SetUnLogged"] = 35; + values[valuesById[36] = "AT_DropOids"] = 36; + values[valuesById[37] = "AT_SetTableSpace"] = 37; + values[valuesById[38] = "AT_SetRelOptions"] = 38; + values[valuesById[39] = "AT_ResetRelOptions"] = 39; + values[valuesById[40] = "AT_ReplaceRelOptions"] = 40; + values[valuesById[41] = "AT_EnableTrig"] = 41; + values[valuesById[42] = "AT_EnableAlwaysTrig"] = 42; + values[valuesById[43] = "AT_EnableReplicaTrig"] = 43; + values[valuesById[44] = "AT_DisableTrig"] = 44; + values[valuesById[45] = "AT_EnableTrigAll"] = 45; + values[valuesById[46] = "AT_DisableTrigAll"] = 46; + values[valuesById[47] = "AT_EnableTrigUser"] = 47; + values[valuesById[48] = "AT_DisableTrigUser"] = 48; + values[valuesById[49] = "AT_EnableRule"] = 49; + values[valuesById[50] = "AT_EnableAlwaysRule"] = 50; + values[valuesById[51] = "AT_EnableReplicaRule"] = 51; + values[valuesById[52] = "AT_DisableRule"] = 52; + values[valuesById[53] = "AT_AddInherit"] = 53; + values[valuesById[54] = "AT_DropInherit"] = 54; + values[valuesById[55] = "AT_AddOf"] = 55; + values[valuesById[56] = "AT_DropOf"] = 56; + values[valuesById[57] = "AT_ReplicaIdentity"] = 57; + values[valuesById[58] = "AT_EnableRowSecurity"] = 58; + values[valuesById[59] = "AT_DisableRowSecurity"] = 59; + values[valuesById[60] = "AT_ForceRowSecurity"] = 60; + values[valuesById[61] = "AT_NoForceRowSecurity"] = 61; + values[valuesById[62] = "AT_GenericOptions"] = 62; + values[valuesById[63] = "AT_AttachPartition"] = 63; + values[valuesById[64] = "AT_DetachPartition"] = 64; + values[valuesById[65] = "AT_AddIdentity"] = 65; + values[valuesById[66] = "AT_SetIdentity"] = 66; + values[valuesById[67] = "AT_DropIdentity"] = 67; + return values; + })(); + + /** + * GrantTargetType enum. + * @name pg_query.GrantTargetType + * @enum {number} + * @property {number} GRANT_TARGET_TYPE_UNDEFINED=0 GRANT_TARGET_TYPE_UNDEFINED value + * @property {number} ACL_TARGET_OBJECT=1 ACL_TARGET_OBJECT value + * @property {number} ACL_TARGET_ALL_IN_SCHEMA=2 ACL_TARGET_ALL_IN_SCHEMA value + * @property {number} ACL_TARGET_DEFAULTS=3 ACL_TARGET_DEFAULTS value + */ + pg_query.GrantTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GRANT_TARGET_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "ACL_TARGET_OBJECT"] = 1; + values[valuesById[2] = "ACL_TARGET_ALL_IN_SCHEMA"] = 2; + values[valuesById[3] = "ACL_TARGET_DEFAULTS"] = 3; + return values; + })(); + + /** + * VariableSetKind enum. + * @name pg_query.VariableSetKind + * @enum {number} + * @property {number} VARIABLE_SET_KIND_UNDEFINED=0 VARIABLE_SET_KIND_UNDEFINED value + * @property {number} VAR_SET_VALUE=1 VAR_SET_VALUE value + * @property {number} VAR_SET_DEFAULT=2 VAR_SET_DEFAULT value + * @property {number} VAR_SET_CURRENT=3 VAR_SET_CURRENT value + * @property {number} VAR_SET_MULTI=4 VAR_SET_MULTI value + * @property {number} VAR_RESET=5 VAR_RESET value + * @property {number} VAR_RESET_ALL=6 VAR_RESET_ALL value + */ + pg_query.VariableSetKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VARIABLE_SET_KIND_UNDEFINED"] = 0; + values[valuesById[1] = "VAR_SET_VALUE"] = 1; + values[valuesById[2] = "VAR_SET_DEFAULT"] = 2; + values[valuesById[3] = "VAR_SET_CURRENT"] = 3; + values[valuesById[4] = "VAR_SET_MULTI"] = 4; + values[valuesById[5] = "VAR_RESET"] = 5; + values[valuesById[6] = "VAR_RESET_ALL"] = 6; + return values; + })(); + + /** + * ConstrType enum. + * @name pg_query.ConstrType + * @enum {number} + * @property {number} CONSTR_TYPE_UNDEFINED=0 CONSTR_TYPE_UNDEFINED value + * @property {number} CONSTR_NULL=1 CONSTR_NULL value + * @property {number} CONSTR_NOTNULL=2 CONSTR_NOTNULL value + * @property {number} CONSTR_DEFAULT=3 CONSTR_DEFAULT value + * @property {number} CONSTR_IDENTITY=4 CONSTR_IDENTITY value + * @property {number} CONSTR_GENERATED=5 CONSTR_GENERATED value + * @property {number} CONSTR_CHECK=6 CONSTR_CHECK value + * @property {number} CONSTR_PRIMARY=7 CONSTR_PRIMARY value + * @property {number} CONSTR_UNIQUE=8 CONSTR_UNIQUE value + * @property {number} CONSTR_EXCLUSION=9 CONSTR_EXCLUSION value + * @property {number} CONSTR_FOREIGN=10 CONSTR_FOREIGN value + * @property {number} CONSTR_ATTR_DEFERRABLE=11 CONSTR_ATTR_DEFERRABLE value + * @property {number} CONSTR_ATTR_NOT_DEFERRABLE=12 CONSTR_ATTR_NOT_DEFERRABLE value + * @property {number} CONSTR_ATTR_DEFERRED=13 CONSTR_ATTR_DEFERRED value + * @property {number} CONSTR_ATTR_IMMEDIATE=14 CONSTR_ATTR_IMMEDIATE value + */ + pg_query.ConstrType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONSTR_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "CONSTR_NULL"] = 1; + values[valuesById[2] = "CONSTR_NOTNULL"] = 2; + values[valuesById[3] = "CONSTR_DEFAULT"] = 3; + values[valuesById[4] = "CONSTR_IDENTITY"] = 4; + values[valuesById[5] = "CONSTR_GENERATED"] = 5; + values[valuesById[6] = "CONSTR_CHECK"] = 6; + values[valuesById[7] = "CONSTR_PRIMARY"] = 7; + values[valuesById[8] = "CONSTR_UNIQUE"] = 8; + values[valuesById[9] = "CONSTR_EXCLUSION"] = 9; + values[valuesById[10] = "CONSTR_FOREIGN"] = 10; + values[valuesById[11] = "CONSTR_ATTR_DEFERRABLE"] = 11; + values[valuesById[12] = "CONSTR_ATTR_NOT_DEFERRABLE"] = 12; + values[valuesById[13] = "CONSTR_ATTR_DEFERRED"] = 13; + values[valuesById[14] = "CONSTR_ATTR_IMMEDIATE"] = 14; + return values; + })(); + + /** + * ImportForeignSchemaType enum. + * @name pg_query.ImportForeignSchemaType + * @enum {number} + * @property {number} IMPORT_FOREIGN_SCHEMA_TYPE_UNDEFINED=0 IMPORT_FOREIGN_SCHEMA_TYPE_UNDEFINED value + * @property {number} FDW_IMPORT_SCHEMA_ALL=1 FDW_IMPORT_SCHEMA_ALL value + * @property {number} FDW_IMPORT_SCHEMA_LIMIT_TO=2 FDW_IMPORT_SCHEMA_LIMIT_TO value + * @property {number} FDW_IMPORT_SCHEMA_EXCEPT=3 FDW_IMPORT_SCHEMA_EXCEPT value + */ + pg_query.ImportForeignSchemaType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPORT_FOREIGN_SCHEMA_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "FDW_IMPORT_SCHEMA_ALL"] = 1; + values[valuesById[2] = "FDW_IMPORT_SCHEMA_LIMIT_TO"] = 2; + values[valuesById[3] = "FDW_IMPORT_SCHEMA_EXCEPT"] = 3; + return values; + })(); + + /** + * RoleStmtType enum. + * @name pg_query.RoleStmtType + * @enum {number} + * @property {number} ROLE_STMT_TYPE_UNDEFINED=0 ROLE_STMT_TYPE_UNDEFINED value + * @property {number} ROLESTMT_ROLE=1 ROLESTMT_ROLE value + * @property {number} ROLESTMT_USER=2 ROLESTMT_USER value + * @property {number} ROLESTMT_GROUP=3 ROLESTMT_GROUP value + */ + pg_query.RoleStmtType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_STMT_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "ROLESTMT_ROLE"] = 1; + values[valuesById[2] = "ROLESTMT_USER"] = 2; + values[valuesById[3] = "ROLESTMT_GROUP"] = 3; + return values; + })(); + + /** + * FetchDirection enum. + * @name pg_query.FetchDirection + * @enum {number} + * @property {number} FETCH_DIRECTION_UNDEFINED=0 FETCH_DIRECTION_UNDEFINED value + * @property {number} FETCH_FORWARD=1 FETCH_FORWARD value + * @property {number} FETCH_BACKWARD=2 FETCH_BACKWARD value + * @property {number} FETCH_ABSOLUTE=3 FETCH_ABSOLUTE value + * @property {number} FETCH_RELATIVE=4 FETCH_RELATIVE value + */ + pg_query.FetchDirection = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FETCH_DIRECTION_UNDEFINED"] = 0; + values[valuesById[1] = "FETCH_FORWARD"] = 1; + values[valuesById[2] = "FETCH_BACKWARD"] = 2; + values[valuesById[3] = "FETCH_ABSOLUTE"] = 3; + values[valuesById[4] = "FETCH_RELATIVE"] = 4; + return values; + })(); + + /** + * FunctionParameterMode enum. + * @name pg_query.FunctionParameterMode + * @enum {number} + * @property {number} FUNCTION_PARAMETER_MODE_UNDEFINED=0 FUNCTION_PARAMETER_MODE_UNDEFINED value + * @property {number} FUNC_PARAM_IN=1 FUNC_PARAM_IN value + * @property {number} FUNC_PARAM_OUT=2 FUNC_PARAM_OUT value + * @property {number} FUNC_PARAM_INOUT=3 FUNC_PARAM_INOUT value + * @property {number} FUNC_PARAM_VARIADIC=4 FUNC_PARAM_VARIADIC value + * @property {number} FUNC_PARAM_TABLE=5 FUNC_PARAM_TABLE value + */ + pg_query.FunctionParameterMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FUNCTION_PARAMETER_MODE_UNDEFINED"] = 0; + values[valuesById[1] = "FUNC_PARAM_IN"] = 1; + values[valuesById[2] = "FUNC_PARAM_OUT"] = 2; + values[valuesById[3] = "FUNC_PARAM_INOUT"] = 3; + values[valuesById[4] = "FUNC_PARAM_VARIADIC"] = 4; + values[valuesById[5] = "FUNC_PARAM_TABLE"] = 5; + return values; + })(); + + /** + * TransactionStmtKind enum. + * @name pg_query.TransactionStmtKind + * @enum {number} + * @property {number} TRANSACTION_STMT_KIND_UNDEFINED=0 TRANSACTION_STMT_KIND_UNDEFINED value + * @property {number} TRANS_STMT_BEGIN=1 TRANS_STMT_BEGIN value + * @property {number} TRANS_STMT_START=2 TRANS_STMT_START value + * @property {number} TRANS_STMT_COMMIT=3 TRANS_STMT_COMMIT value + * @property {number} TRANS_STMT_ROLLBACK=4 TRANS_STMT_ROLLBACK value + * @property {number} TRANS_STMT_SAVEPOINT=5 TRANS_STMT_SAVEPOINT value + * @property {number} TRANS_STMT_RELEASE=6 TRANS_STMT_RELEASE value + * @property {number} TRANS_STMT_ROLLBACK_TO=7 TRANS_STMT_ROLLBACK_TO value + * @property {number} TRANS_STMT_PREPARE=8 TRANS_STMT_PREPARE value + * @property {number} TRANS_STMT_COMMIT_PREPARED=9 TRANS_STMT_COMMIT_PREPARED value + * @property {number} TRANS_STMT_ROLLBACK_PREPARED=10 TRANS_STMT_ROLLBACK_PREPARED value + */ + pg_query.TransactionStmtKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRANSACTION_STMT_KIND_UNDEFINED"] = 0; + values[valuesById[1] = "TRANS_STMT_BEGIN"] = 1; + values[valuesById[2] = "TRANS_STMT_START"] = 2; + values[valuesById[3] = "TRANS_STMT_COMMIT"] = 3; + values[valuesById[4] = "TRANS_STMT_ROLLBACK"] = 4; + values[valuesById[5] = "TRANS_STMT_SAVEPOINT"] = 5; + values[valuesById[6] = "TRANS_STMT_RELEASE"] = 6; + values[valuesById[7] = "TRANS_STMT_ROLLBACK_TO"] = 7; + values[valuesById[8] = "TRANS_STMT_PREPARE"] = 8; + values[valuesById[9] = "TRANS_STMT_COMMIT_PREPARED"] = 9; + values[valuesById[10] = "TRANS_STMT_ROLLBACK_PREPARED"] = 10; + return values; + })(); + + /** + * ViewCheckOption enum. + * @name pg_query.ViewCheckOption + * @enum {number} + * @property {number} VIEW_CHECK_OPTION_UNDEFINED=0 VIEW_CHECK_OPTION_UNDEFINED value + * @property {number} NO_CHECK_OPTION=1 NO_CHECK_OPTION value + * @property {number} LOCAL_CHECK_OPTION=2 LOCAL_CHECK_OPTION value + * @property {number} CASCADED_CHECK_OPTION=3 CASCADED_CHECK_OPTION value + */ + pg_query.ViewCheckOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VIEW_CHECK_OPTION_UNDEFINED"] = 0; + values[valuesById[1] = "NO_CHECK_OPTION"] = 1; + values[valuesById[2] = "LOCAL_CHECK_OPTION"] = 2; + values[valuesById[3] = "CASCADED_CHECK_OPTION"] = 3; + return values; + })(); + + /** + * ClusterOption enum. + * @name pg_query.ClusterOption + * @enum {number} + * @property {number} CLUSTER_OPTION_UNDEFINED=0 CLUSTER_OPTION_UNDEFINED value + * @property {number} CLUOPT_RECHECK=1 CLUOPT_RECHECK value + * @property {number} CLUOPT_VERBOSE=2 CLUOPT_VERBOSE value + */ + pg_query.ClusterOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_OPTION_UNDEFINED"] = 0; + values[valuesById[1] = "CLUOPT_RECHECK"] = 1; + values[valuesById[2] = "CLUOPT_VERBOSE"] = 2; + return values; + })(); + + /** + * DiscardMode enum. + * @name pg_query.DiscardMode + * @enum {number} + * @property {number} DISCARD_MODE_UNDEFINED=0 DISCARD_MODE_UNDEFINED value + * @property {number} DISCARD_ALL=1 DISCARD_ALL value + * @property {number} DISCARD_PLANS=2 DISCARD_PLANS value + * @property {number} DISCARD_SEQUENCES=3 DISCARD_SEQUENCES value + * @property {number} DISCARD_TEMP=4 DISCARD_TEMP value + */ + pg_query.DiscardMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISCARD_MODE_UNDEFINED"] = 0; + values[valuesById[1] = "DISCARD_ALL"] = 1; + values[valuesById[2] = "DISCARD_PLANS"] = 2; + values[valuesById[3] = "DISCARD_SEQUENCES"] = 3; + values[valuesById[4] = "DISCARD_TEMP"] = 4; + return values; + })(); + + /** + * ReindexObjectType enum. + * @name pg_query.ReindexObjectType + * @enum {number} + * @property {number} REINDEX_OBJECT_TYPE_UNDEFINED=0 REINDEX_OBJECT_TYPE_UNDEFINED value + * @property {number} REINDEX_OBJECT_INDEX=1 REINDEX_OBJECT_INDEX value + * @property {number} REINDEX_OBJECT_TABLE=2 REINDEX_OBJECT_TABLE value + * @property {number} REINDEX_OBJECT_SCHEMA=3 REINDEX_OBJECT_SCHEMA value + * @property {number} REINDEX_OBJECT_SYSTEM=4 REINDEX_OBJECT_SYSTEM value + * @property {number} REINDEX_OBJECT_DATABASE=5 REINDEX_OBJECT_DATABASE value + */ + pg_query.ReindexObjectType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REINDEX_OBJECT_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "REINDEX_OBJECT_INDEX"] = 1; + values[valuesById[2] = "REINDEX_OBJECT_TABLE"] = 2; + values[valuesById[3] = "REINDEX_OBJECT_SCHEMA"] = 3; + values[valuesById[4] = "REINDEX_OBJECT_SYSTEM"] = 4; + values[valuesById[5] = "REINDEX_OBJECT_DATABASE"] = 5; + return values; + })(); + + /** + * AlterTSConfigType enum. + * @name pg_query.AlterTSConfigType + * @enum {number} + * @property {number} ALTER_TSCONFIG_TYPE_UNDEFINED=0 ALTER_TSCONFIG_TYPE_UNDEFINED value + * @property {number} ALTER_TSCONFIG_ADD_MAPPING=1 ALTER_TSCONFIG_ADD_MAPPING value + * @property {number} ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN=2 ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN value + * @property {number} ALTER_TSCONFIG_REPLACE_DICT=3 ALTER_TSCONFIG_REPLACE_DICT value + * @property {number} ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN=4 ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN value + * @property {number} ALTER_TSCONFIG_DROP_MAPPING=5 ALTER_TSCONFIG_DROP_MAPPING value + */ + pg_query.AlterTSConfigType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ALTER_TSCONFIG_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "ALTER_TSCONFIG_ADD_MAPPING"] = 1; + values[valuesById[2] = "ALTER_TSCONFIG_ALTER_MAPPING_FOR_TOKEN"] = 2; + values[valuesById[3] = "ALTER_TSCONFIG_REPLACE_DICT"] = 3; + values[valuesById[4] = "ALTER_TSCONFIG_REPLACE_DICT_FOR_TOKEN"] = 4; + values[valuesById[5] = "ALTER_TSCONFIG_DROP_MAPPING"] = 5; + return values; + })(); + + /** + * AlterSubscriptionType enum. + * @name pg_query.AlterSubscriptionType + * @enum {number} + * @property {number} ALTER_SUBSCRIPTION_TYPE_UNDEFINED=0 ALTER_SUBSCRIPTION_TYPE_UNDEFINED value + * @property {number} ALTER_SUBSCRIPTION_OPTIONS=1 ALTER_SUBSCRIPTION_OPTIONS value + * @property {number} ALTER_SUBSCRIPTION_CONNECTION=2 ALTER_SUBSCRIPTION_CONNECTION value + * @property {number} ALTER_SUBSCRIPTION_PUBLICATION=3 ALTER_SUBSCRIPTION_PUBLICATION value + * @property {number} ALTER_SUBSCRIPTION_REFRESH=4 ALTER_SUBSCRIPTION_REFRESH value + * @property {number} ALTER_SUBSCRIPTION_ENABLED=5 ALTER_SUBSCRIPTION_ENABLED value + */ + pg_query.AlterSubscriptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ALTER_SUBSCRIPTION_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "ALTER_SUBSCRIPTION_OPTIONS"] = 1; + values[valuesById[2] = "ALTER_SUBSCRIPTION_CONNECTION"] = 2; + values[valuesById[3] = "ALTER_SUBSCRIPTION_PUBLICATION"] = 3; + values[valuesById[4] = "ALTER_SUBSCRIPTION_REFRESH"] = 4; + values[valuesById[5] = "ALTER_SUBSCRIPTION_ENABLED"] = 5; + return values; + })(); + + /** + * OnCommitAction enum. + * @name pg_query.OnCommitAction + * @enum {number} + * @property {number} ON_COMMIT_ACTION_UNDEFINED=0 ON_COMMIT_ACTION_UNDEFINED value + * @property {number} ONCOMMIT_NOOP=1 ONCOMMIT_NOOP value + * @property {number} ONCOMMIT_PRESERVE_ROWS=2 ONCOMMIT_PRESERVE_ROWS value + * @property {number} ONCOMMIT_DELETE_ROWS=3 ONCOMMIT_DELETE_ROWS value + * @property {number} ONCOMMIT_DROP=4 ONCOMMIT_DROP value + */ + pg_query.OnCommitAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ON_COMMIT_ACTION_UNDEFINED"] = 0; + values[valuesById[1] = "ONCOMMIT_NOOP"] = 1; + values[valuesById[2] = "ONCOMMIT_PRESERVE_ROWS"] = 2; + values[valuesById[3] = "ONCOMMIT_DELETE_ROWS"] = 3; + values[valuesById[4] = "ONCOMMIT_DROP"] = 4; + return values; + })(); + + /** + * ParamKind enum. + * @name pg_query.ParamKind + * @enum {number} + * @property {number} PARAM_KIND_UNDEFINED=0 PARAM_KIND_UNDEFINED value + * @property {number} PARAM_EXTERN=1 PARAM_EXTERN value + * @property {number} PARAM_EXEC=2 PARAM_EXEC value + * @property {number} PARAM_SUBLINK=3 PARAM_SUBLINK value + * @property {number} PARAM_MULTIEXPR=4 PARAM_MULTIEXPR value + */ + pg_query.ParamKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARAM_KIND_UNDEFINED"] = 0; + values[valuesById[1] = "PARAM_EXTERN"] = 1; + values[valuesById[2] = "PARAM_EXEC"] = 2; + values[valuesById[3] = "PARAM_SUBLINK"] = 3; + values[valuesById[4] = "PARAM_MULTIEXPR"] = 4; + return values; + })(); + + /** + * CoercionContext enum. + * @name pg_query.CoercionContext + * @enum {number} + * @property {number} COERCION_CONTEXT_UNDEFINED=0 COERCION_CONTEXT_UNDEFINED value + * @property {number} COERCION_IMPLICIT=1 COERCION_IMPLICIT value + * @property {number} COERCION_ASSIGNMENT=2 COERCION_ASSIGNMENT value + * @property {number} COERCION_EXPLICIT=3 COERCION_EXPLICIT value + */ + pg_query.CoercionContext = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COERCION_CONTEXT_UNDEFINED"] = 0; + values[valuesById[1] = "COERCION_IMPLICIT"] = 1; + values[valuesById[2] = "COERCION_ASSIGNMENT"] = 2; + values[valuesById[3] = "COERCION_EXPLICIT"] = 3; + return values; + })(); + + /** + * CoercionForm enum. + * @name pg_query.CoercionForm + * @enum {number} + * @property {number} COERCION_FORM_UNDEFINED=0 COERCION_FORM_UNDEFINED value + * @property {number} COERCE_EXPLICIT_CALL=1 COERCE_EXPLICIT_CALL value + * @property {number} COERCE_EXPLICIT_CAST=2 COERCE_EXPLICIT_CAST value + * @property {number} COERCE_IMPLICIT_CAST=3 COERCE_IMPLICIT_CAST value + */ + pg_query.CoercionForm = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COERCION_FORM_UNDEFINED"] = 0; + values[valuesById[1] = "COERCE_EXPLICIT_CALL"] = 1; + values[valuesById[2] = "COERCE_EXPLICIT_CAST"] = 2; + values[valuesById[3] = "COERCE_IMPLICIT_CAST"] = 3; + return values; + })(); + + /** + * BoolExprType enum. + * @name pg_query.BoolExprType + * @enum {number} + * @property {number} BOOL_EXPR_TYPE_UNDEFINED=0 BOOL_EXPR_TYPE_UNDEFINED value + * @property {number} AND_EXPR=1 AND_EXPR value + * @property {number} OR_EXPR=2 OR_EXPR value + * @property {number} NOT_EXPR=3 NOT_EXPR value + */ + pg_query.BoolExprType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BOOL_EXPR_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "AND_EXPR"] = 1; + values[valuesById[2] = "OR_EXPR"] = 2; + values[valuesById[3] = "NOT_EXPR"] = 3; + return values; + })(); + + /** + * SubLinkType enum. + * @name pg_query.SubLinkType + * @enum {number} + * @property {number} SUB_LINK_TYPE_UNDEFINED=0 SUB_LINK_TYPE_UNDEFINED value + * @property {number} EXISTS_SUBLINK=1 EXISTS_SUBLINK value + * @property {number} ALL_SUBLINK=2 ALL_SUBLINK value + * @property {number} ANY_SUBLINK=3 ANY_SUBLINK value + * @property {number} ROWCOMPARE_SUBLINK=4 ROWCOMPARE_SUBLINK value + * @property {number} EXPR_SUBLINK=5 EXPR_SUBLINK value + * @property {number} MULTIEXPR_SUBLINK=6 MULTIEXPR_SUBLINK value + * @property {number} ARRAY_SUBLINK=7 ARRAY_SUBLINK value + * @property {number} CTE_SUBLINK=8 CTE_SUBLINK value + */ + pg_query.SubLinkType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SUB_LINK_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "EXISTS_SUBLINK"] = 1; + values[valuesById[2] = "ALL_SUBLINK"] = 2; + values[valuesById[3] = "ANY_SUBLINK"] = 3; + values[valuesById[4] = "ROWCOMPARE_SUBLINK"] = 4; + values[valuesById[5] = "EXPR_SUBLINK"] = 5; + values[valuesById[6] = "MULTIEXPR_SUBLINK"] = 6; + values[valuesById[7] = "ARRAY_SUBLINK"] = 7; + values[valuesById[8] = "CTE_SUBLINK"] = 8; + return values; + })(); + + /** + * RowCompareType enum. + * @name pg_query.RowCompareType + * @enum {number} + * @property {number} ROW_COMPARE_TYPE_UNDEFINED=0 ROW_COMPARE_TYPE_UNDEFINED value + * @property {number} ROWCOMPARE_LT=1 ROWCOMPARE_LT value + * @property {number} ROWCOMPARE_LE=2 ROWCOMPARE_LE value + * @property {number} ROWCOMPARE_EQ=3 ROWCOMPARE_EQ value + * @property {number} ROWCOMPARE_GE=4 ROWCOMPARE_GE value + * @property {number} ROWCOMPARE_GT=5 ROWCOMPARE_GT value + * @property {number} ROWCOMPARE_NE=6 ROWCOMPARE_NE value + */ + pg_query.RowCompareType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROW_COMPARE_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "ROWCOMPARE_LT"] = 1; + values[valuesById[2] = "ROWCOMPARE_LE"] = 2; + values[valuesById[3] = "ROWCOMPARE_EQ"] = 3; + values[valuesById[4] = "ROWCOMPARE_GE"] = 4; + values[valuesById[5] = "ROWCOMPARE_GT"] = 5; + values[valuesById[6] = "ROWCOMPARE_NE"] = 6; + return values; + })(); + + /** + * MinMaxOp enum. + * @name pg_query.MinMaxOp + * @enum {number} + * @property {number} MIN_MAX_OP_UNDEFINED=0 MIN_MAX_OP_UNDEFINED value + * @property {number} IS_GREATEST=1 IS_GREATEST value + * @property {number} IS_LEAST=2 IS_LEAST value + */ + pg_query.MinMaxOp = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MIN_MAX_OP_UNDEFINED"] = 0; + values[valuesById[1] = "IS_GREATEST"] = 1; + values[valuesById[2] = "IS_LEAST"] = 2; + return values; + })(); + + /** + * SQLValueFunctionOp enum. + * @name pg_query.SQLValueFunctionOp + * @enum {number} + * @property {number} SQLVALUE_FUNCTION_OP_UNDEFINED=0 SQLVALUE_FUNCTION_OP_UNDEFINED value + * @property {number} SVFOP_CURRENT_DATE=1 SVFOP_CURRENT_DATE value + * @property {number} SVFOP_CURRENT_TIME=2 SVFOP_CURRENT_TIME value + * @property {number} SVFOP_CURRENT_TIME_N=3 SVFOP_CURRENT_TIME_N value + * @property {number} SVFOP_CURRENT_TIMESTAMP=4 SVFOP_CURRENT_TIMESTAMP value + * @property {number} SVFOP_CURRENT_TIMESTAMP_N=5 SVFOP_CURRENT_TIMESTAMP_N value + * @property {number} SVFOP_LOCALTIME=6 SVFOP_LOCALTIME value + * @property {number} SVFOP_LOCALTIME_N=7 SVFOP_LOCALTIME_N value + * @property {number} SVFOP_LOCALTIMESTAMP=8 SVFOP_LOCALTIMESTAMP value + * @property {number} SVFOP_LOCALTIMESTAMP_N=9 SVFOP_LOCALTIMESTAMP_N value + * @property {number} SVFOP_CURRENT_ROLE=10 SVFOP_CURRENT_ROLE value + * @property {number} SVFOP_CURRENT_USER=11 SVFOP_CURRENT_USER value + * @property {number} SVFOP_USER=12 SVFOP_USER value + * @property {number} SVFOP_SESSION_USER=13 SVFOP_SESSION_USER value + * @property {number} SVFOP_CURRENT_CATALOG=14 SVFOP_CURRENT_CATALOG value + * @property {number} SVFOP_CURRENT_SCHEMA=15 SVFOP_CURRENT_SCHEMA value + */ + pg_query.SQLValueFunctionOp = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SQLVALUE_FUNCTION_OP_UNDEFINED"] = 0; + values[valuesById[1] = "SVFOP_CURRENT_DATE"] = 1; + values[valuesById[2] = "SVFOP_CURRENT_TIME"] = 2; + values[valuesById[3] = "SVFOP_CURRENT_TIME_N"] = 3; + values[valuesById[4] = "SVFOP_CURRENT_TIMESTAMP"] = 4; + values[valuesById[5] = "SVFOP_CURRENT_TIMESTAMP_N"] = 5; + values[valuesById[6] = "SVFOP_LOCALTIME"] = 6; + values[valuesById[7] = "SVFOP_LOCALTIME_N"] = 7; + values[valuesById[8] = "SVFOP_LOCALTIMESTAMP"] = 8; + values[valuesById[9] = "SVFOP_LOCALTIMESTAMP_N"] = 9; + values[valuesById[10] = "SVFOP_CURRENT_ROLE"] = 10; + values[valuesById[11] = "SVFOP_CURRENT_USER"] = 11; + values[valuesById[12] = "SVFOP_USER"] = 12; + values[valuesById[13] = "SVFOP_SESSION_USER"] = 13; + values[valuesById[14] = "SVFOP_CURRENT_CATALOG"] = 14; + values[valuesById[15] = "SVFOP_CURRENT_SCHEMA"] = 15; + return values; + })(); + + /** + * XmlExprOp enum. + * @name pg_query.XmlExprOp + * @enum {number} + * @property {number} XML_EXPR_OP_UNDEFINED=0 XML_EXPR_OP_UNDEFINED value + * @property {number} IS_XMLCONCAT=1 IS_XMLCONCAT value + * @property {number} IS_XMLELEMENT=2 IS_XMLELEMENT value + * @property {number} IS_XMLFOREST=3 IS_XMLFOREST value + * @property {number} IS_XMLPARSE=4 IS_XMLPARSE value + * @property {number} IS_XMLPI=5 IS_XMLPI value + * @property {number} IS_XMLROOT=6 IS_XMLROOT value + * @property {number} IS_XMLSERIALIZE=7 IS_XMLSERIALIZE value + * @property {number} IS_DOCUMENT=8 IS_DOCUMENT value + */ + pg_query.XmlExprOp = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "XML_EXPR_OP_UNDEFINED"] = 0; + values[valuesById[1] = "IS_XMLCONCAT"] = 1; + values[valuesById[2] = "IS_XMLELEMENT"] = 2; + values[valuesById[3] = "IS_XMLFOREST"] = 3; + values[valuesById[4] = "IS_XMLPARSE"] = 4; + values[valuesById[5] = "IS_XMLPI"] = 5; + values[valuesById[6] = "IS_XMLROOT"] = 6; + values[valuesById[7] = "IS_XMLSERIALIZE"] = 7; + values[valuesById[8] = "IS_DOCUMENT"] = 8; + return values; + })(); + + /** + * XmlOptionType enum. + * @name pg_query.XmlOptionType + * @enum {number} + * @property {number} XML_OPTION_TYPE_UNDEFINED=0 XML_OPTION_TYPE_UNDEFINED value + * @property {number} XMLOPTION_DOCUMENT=1 XMLOPTION_DOCUMENT value + * @property {number} XMLOPTION_CONTENT=2 XMLOPTION_CONTENT value + */ + pg_query.XmlOptionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "XML_OPTION_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "XMLOPTION_DOCUMENT"] = 1; + values[valuesById[2] = "XMLOPTION_CONTENT"] = 2; + return values; + })(); + + /** + * NullTestType enum. + * @name pg_query.NullTestType + * @enum {number} + * @property {number} NULL_TEST_TYPE_UNDEFINED=0 NULL_TEST_TYPE_UNDEFINED value + * @property {number} IS_NULL=1 IS_NULL value + * @property {number} IS_NOT_NULL=2 IS_NOT_NULL value + */ + pg_query.NullTestType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_TEST_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "IS_NULL"] = 1; + values[valuesById[2] = "IS_NOT_NULL"] = 2; + return values; + })(); + + /** + * BoolTestType enum. + * @name pg_query.BoolTestType + * @enum {number} + * @property {number} BOOL_TEST_TYPE_UNDEFINED=0 BOOL_TEST_TYPE_UNDEFINED value + * @property {number} IS_TRUE=1 IS_TRUE value + * @property {number} IS_NOT_TRUE=2 IS_NOT_TRUE value + * @property {number} IS_FALSE=3 IS_FALSE value + * @property {number} IS_NOT_FALSE=4 IS_NOT_FALSE value + * @property {number} IS_UNKNOWN=5 IS_UNKNOWN value + * @property {number} IS_NOT_UNKNOWN=6 IS_NOT_UNKNOWN value + */ + pg_query.BoolTestType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BOOL_TEST_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "IS_TRUE"] = 1; + values[valuesById[2] = "IS_NOT_TRUE"] = 2; + values[valuesById[3] = "IS_FALSE"] = 3; + values[valuesById[4] = "IS_NOT_FALSE"] = 4; + values[valuesById[5] = "IS_UNKNOWN"] = 5; + values[valuesById[6] = "IS_NOT_UNKNOWN"] = 6; + return values; + })(); + + /** + * CmdType enum. + * @name pg_query.CmdType + * @enum {number} + * @property {number} CMD_TYPE_UNDEFINED=0 CMD_TYPE_UNDEFINED value + * @property {number} CMD_UNKNOWN=1 CMD_UNKNOWN value + * @property {number} CMD_SELECT=2 CMD_SELECT value + * @property {number} CMD_UPDATE=3 CMD_UPDATE value + * @property {number} CMD_INSERT=4 CMD_INSERT value + * @property {number} CMD_DELETE=5 CMD_DELETE value + * @property {number} CMD_UTILITY=6 CMD_UTILITY value + * @property {number} CMD_NOTHING=7 CMD_NOTHING value + */ + pg_query.CmdType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CMD_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "CMD_UNKNOWN"] = 1; + values[valuesById[2] = "CMD_SELECT"] = 2; + values[valuesById[3] = "CMD_UPDATE"] = 3; + values[valuesById[4] = "CMD_INSERT"] = 4; + values[valuesById[5] = "CMD_DELETE"] = 5; + values[valuesById[6] = "CMD_UTILITY"] = 6; + values[valuesById[7] = "CMD_NOTHING"] = 7; + return values; + })(); + + /** + * JoinType enum. + * @name pg_query.JoinType + * @enum {number} + * @property {number} JOIN_TYPE_UNDEFINED=0 JOIN_TYPE_UNDEFINED value + * @property {number} JOIN_INNER=1 JOIN_INNER value + * @property {number} JOIN_LEFT=2 JOIN_LEFT value + * @property {number} JOIN_FULL=3 JOIN_FULL value + * @property {number} JOIN_RIGHT=4 JOIN_RIGHT value + * @property {number} JOIN_SEMI=5 JOIN_SEMI value + * @property {number} JOIN_ANTI=6 JOIN_ANTI value + * @property {number} JOIN_UNIQUE_OUTER=7 JOIN_UNIQUE_OUTER value + * @property {number} JOIN_UNIQUE_INNER=8 JOIN_UNIQUE_INNER value + */ + pg_query.JoinType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOIN_TYPE_UNDEFINED"] = 0; + values[valuesById[1] = "JOIN_INNER"] = 1; + values[valuesById[2] = "JOIN_LEFT"] = 2; + values[valuesById[3] = "JOIN_FULL"] = 3; + values[valuesById[4] = "JOIN_RIGHT"] = 4; + values[valuesById[5] = "JOIN_SEMI"] = 5; + values[valuesById[6] = "JOIN_ANTI"] = 6; + values[valuesById[7] = "JOIN_UNIQUE_OUTER"] = 7; + values[valuesById[8] = "JOIN_UNIQUE_INNER"] = 8; + return values; + })(); + + /** + * AggStrategy enum. + * @name pg_query.AggStrategy + * @enum {number} + * @property {number} AGG_STRATEGY_UNDEFINED=0 AGG_STRATEGY_UNDEFINED value + * @property {number} AGG_PLAIN=1 AGG_PLAIN value + * @property {number} AGG_SORTED=2 AGG_SORTED value + * @property {number} AGG_HASHED=3 AGG_HASHED value + * @property {number} AGG_MIXED=4 AGG_MIXED value + */ + pg_query.AggStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AGG_STRATEGY_UNDEFINED"] = 0; + values[valuesById[1] = "AGG_PLAIN"] = 1; + values[valuesById[2] = "AGG_SORTED"] = 2; + values[valuesById[3] = "AGG_HASHED"] = 3; + values[valuesById[4] = "AGG_MIXED"] = 4; + return values; + })(); + + /** + * AggSplit enum. + * @name pg_query.AggSplit + * @enum {number} + * @property {number} AGG_SPLIT_UNDEFINED=0 AGG_SPLIT_UNDEFINED value + * @property {number} AGGSPLIT_SIMPLE=1 AGGSPLIT_SIMPLE value + * @property {number} AGGSPLIT_INITIAL_SERIAL=2 AGGSPLIT_INITIAL_SERIAL value + * @property {number} AGGSPLIT_FINAL_DESERIAL=3 AGGSPLIT_FINAL_DESERIAL value + */ + pg_query.AggSplit = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AGG_SPLIT_UNDEFINED"] = 0; + values[valuesById[1] = "AGGSPLIT_SIMPLE"] = 1; + values[valuesById[2] = "AGGSPLIT_INITIAL_SERIAL"] = 2; + values[valuesById[3] = "AGGSPLIT_FINAL_DESERIAL"] = 3; + return values; + })(); + + /** + * SetOpCmd enum. + * @name pg_query.SetOpCmd + * @enum {number} + * @property {number} SET_OP_CMD_UNDEFINED=0 SET_OP_CMD_UNDEFINED value + * @property {number} SETOPCMD_INTERSECT=1 SETOPCMD_INTERSECT value + * @property {number} SETOPCMD_INTERSECT_ALL=2 SETOPCMD_INTERSECT_ALL value + * @property {number} SETOPCMD_EXCEPT=3 SETOPCMD_EXCEPT value + * @property {number} SETOPCMD_EXCEPT_ALL=4 SETOPCMD_EXCEPT_ALL value + */ + pg_query.SetOpCmd = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SET_OP_CMD_UNDEFINED"] = 0; + values[valuesById[1] = "SETOPCMD_INTERSECT"] = 1; + values[valuesById[2] = "SETOPCMD_INTERSECT_ALL"] = 2; + values[valuesById[3] = "SETOPCMD_EXCEPT"] = 3; + values[valuesById[4] = "SETOPCMD_EXCEPT_ALL"] = 4; + return values; + })(); + + /** + * SetOpStrategy enum. + * @name pg_query.SetOpStrategy + * @enum {number} + * @property {number} SET_OP_STRATEGY_UNDEFINED=0 SET_OP_STRATEGY_UNDEFINED value + * @property {number} SETOP_SORTED=1 SETOP_SORTED value + * @property {number} SETOP_HASHED=2 SETOP_HASHED value + */ + pg_query.SetOpStrategy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SET_OP_STRATEGY_UNDEFINED"] = 0; + values[valuesById[1] = "SETOP_SORTED"] = 1; + values[valuesById[2] = "SETOP_HASHED"] = 2; + return values; + })(); + + /** + * OnConflictAction enum. + * @name pg_query.OnConflictAction + * @enum {number} + * @property {number} ON_CONFLICT_ACTION_UNDEFINED=0 ON_CONFLICT_ACTION_UNDEFINED value + * @property {number} ONCONFLICT_NONE=1 ONCONFLICT_NONE value + * @property {number} ONCONFLICT_NOTHING=2 ONCONFLICT_NOTHING value + * @property {number} ONCONFLICT_UPDATE=3 ONCONFLICT_UPDATE value + */ + pg_query.OnConflictAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ON_CONFLICT_ACTION_UNDEFINED"] = 0; + values[valuesById[1] = "ONCONFLICT_NONE"] = 1; + values[valuesById[2] = "ONCONFLICT_NOTHING"] = 2; + values[valuesById[3] = "ONCONFLICT_UPDATE"] = 3; + return values; + })(); + + /** + * LimitOption enum. + * @name pg_query.LimitOption + * @enum {number} + * @property {number} LIMIT_OPTION_UNDEFINED=0 LIMIT_OPTION_UNDEFINED value + * @property {number} LIMIT_OPTION_DEFAULT=1 LIMIT_OPTION_DEFAULT value + * @property {number} LIMIT_OPTION_COUNT=2 LIMIT_OPTION_COUNT value + * @property {number} LIMIT_OPTION_WITH_TIES=3 LIMIT_OPTION_WITH_TIES value + */ + pg_query.LimitOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LIMIT_OPTION_UNDEFINED"] = 0; + values[valuesById[1] = "LIMIT_OPTION_DEFAULT"] = 1; + values[valuesById[2] = "LIMIT_OPTION_COUNT"] = 2; + values[valuesById[3] = "LIMIT_OPTION_WITH_TIES"] = 3; + return values; + })(); + + /** + * LockClauseStrength enum. + * @name pg_query.LockClauseStrength + * @enum {number} + * @property {number} LOCK_CLAUSE_STRENGTH_UNDEFINED=0 LOCK_CLAUSE_STRENGTH_UNDEFINED value + * @property {number} LCS_NONE=1 LCS_NONE value + * @property {number} LCS_FORKEYSHARE=2 LCS_FORKEYSHARE value + * @property {number} LCS_FORSHARE=3 LCS_FORSHARE value + * @property {number} LCS_FORNOKEYUPDATE=4 LCS_FORNOKEYUPDATE value + * @property {number} LCS_FORUPDATE=5 LCS_FORUPDATE value + */ + pg_query.LockClauseStrength = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOCK_CLAUSE_STRENGTH_UNDEFINED"] = 0; + values[valuesById[1] = "LCS_NONE"] = 1; + values[valuesById[2] = "LCS_FORKEYSHARE"] = 2; + values[valuesById[3] = "LCS_FORSHARE"] = 3; + values[valuesById[4] = "LCS_FORNOKEYUPDATE"] = 4; + values[valuesById[5] = "LCS_FORUPDATE"] = 5; + return values; + })(); + + /** + * LockWaitPolicy enum. + * @name pg_query.LockWaitPolicy + * @enum {number} + * @property {number} LOCK_WAIT_POLICY_UNDEFINED=0 LOCK_WAIT_POLICY_UNDEFINED value + * @property {number} LockWaitBlock=1 LockWaitBlock value + * @property {number} LockWaitSkip=2 LockWaitSkip value + * @property {number} LockWaitError=3 LockWaitError value + */ + pg_query.LockWaitPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOCK_WAIT_POLICY_UNDEFINED"] = 0; + values[valuesById[1] = "LockWaitBlock"] = 1; + values[valuesById[2] = "LockWaitSkip"] = 2; + values[valuesById[3] = "LockWaitError"] = 3; + return values; + })(); + + /** + * LockTupleMode enum. + * @name pg_query.LockTupleMode + * @enum {number} + * @property {number} LOCK_TUPLE_MODE_UNDEFINED=0 LOCK_TUPLE_MODE_UNDEFINED value + * @property {number} LockTupleKeyShare=1 LockTupleKeyShare value + * @property {number} LockTupleShare=2 LockTupleShare value + * @property {number} LockTupleNoKeyExclusive=3 LockTupleNoKeyExclusive value + * @property {number} LockTupleExclusive=4 LockTupleExclusive value + */ + pg_query.LockTupleMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOCK_TUPLE_MODE_UNDEFINED"] = 0; + values[valuesById[1] = "LockTupleKeyShare"] = 1; + values[valuesById[2] = "LockTupleShare"] = 2; + values[valuesById[3] = "LockTupleNoKeyExclusive"] = 3; + values[valuesById[4] = "LockTupleExclusive"] = 4; + return values; + })(); + + pg_query.ScanToken = (function() { + + /** + * Properties of a ScanToken. + * @memberof pg_query + * @interface IScanToken + * @property {number|null} [start] ScanToken start + * @property {number|null} [end] ScanToken end + * @property {pg_query.Token|null} [token] ScanToken token + * @property {pg_query.KeywordKind|null} [keyword_kind] ScanToken keyword_kind + */ + + /** + * Constructs a new ScanToken. + * @memberof pg_query + * @classdesc Represents a ScanToken. + * @implements IScanToken + * @constructor + * @param {pg_query.IScanToken=} [properties] Properties to set + */ + function ScanToken(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScanToken start. + * @member {number} start + * @memberof pg_query.ScanToken + * @instance + */ + ScanToken.prototype.start = 0; + + /** + * ScanToken end. + * @member {number} end + * @memberof pg_query.ScanToken + * @instance + */ + ScanToken.prototype.end = 0; + + /** + * ScanToken token. + * @member {pg_query.Token} token + * @memberof pg_query.ScanToken + * @instance + */ + ScanToken.prototype.token = 0; + + /** + * ScanToken keyword_kind. + * @member {pg_query.KeywordKind} keyword_kind + * @memberof pg_query.ScanToken + * @instance + */ + ScanToken.prototype.keyword_kind = 0; + + /** + * Creates a new ScanToken instance using the specified properties. + * @function create + * @memberof pg_query.ScanToken + * @static + * @param {pg_query.IScanToken=} [properties] Properties to set + * @returns {pg_query.ScanToken} ScanToken instance + */ + ScanToken.create = function create(properties) { + return new ScanToken(properties); + }; + + /** + * Encodes the specified ScanToken message. Does not implicitly {@link pg_query.ScanToken.verify|verify} messages. + * @function encode + * @memberof pg_query.ScanToken + * @static + * @param {pg_query.IScanToken} message ScanToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanToken.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.token); + if (message.keyword_kind != null && Object.hasOwnProperty.call(message, "keyword_kind")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.keyword_kind); + return writer; + }; + + /** + * Encodes the specified ScanToken message, length delimited. Does not implicitly {@link pg_query.ScanToken.verify|verify} messages. + * @function encodeDelimited + * @memberof pg_query.ScanToken + * @static + * @param {pg_query.IScanToken} message ScanToken message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScanToken.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScanToken message from the specified reader or buffer. + * @function decode + * @memberof pg_query.ScanToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {pg_query.ScanToken} ScanToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanToken.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.pg_query.ScanToken(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 4: { + message.token = reader.int32(); + break; + } + case 5: { + message.keyword_kind = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScanToken message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof pg_query.ScanToken + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {pg_query.ScanToken} ScanToken + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScanToken.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScanToken message. + * @function verify + * @memberof pg_query.ScanToken + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScanToken.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.token != null && message.hasOwnProperty("token")) + switch (message.token) { + default: + return "token: enum value expected"; + case 0: + case 37: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 91: + case 92: + case 93: + case 94: + case 258: + case 259: + case 260: + case 261: + case 262: + case 263: + case 264: + case 265: + case 266: + case 267: + case 268: + case 269: + case 270: + case 271: + case 272: + case 273: + case 274: + case 275: + case 276: + case 277: + case 278: + case 279: + case 280: + case 281: + case 282: + case 283: + case 284: + case 285: + case 286: + case 287: + case 288: + case 289: + case 290: + case 291: + case 292: + case 293: + case 294: + case 295: + case 296: + case 297: + case 298: + case 299: + case 300: + case 301: + case 302: + case 303: + case 304: + case 305: + case 306: + case 307: + case 308: + case 309: + case 310: + case 311: + case 312: + case 313: + case 314: + case 315: + case 316: + case 317: + case 318: + case 319: + case 320: + case 321: + case 322: + case 323: + case 324: + case 325: + case 326: + case 327: + case 328: + case 329: + case 330: + case 331: + case 332: + case 333: + case 334: + case 335: + case 336: + case 337: + case 338: + case 339: + case 340: + case 341: + case 342: + case 343: + case 344: + case 345: + case 346: + case 347: + case 348: + case 349: + case 350: + case 351: + case 352: + case 353: + case 354: + case 355: + case 356: + case 357: + case 358: + case 359: + case 360: + case 361: + case 362: + case 363: + case 364: + case 365: + case 366: + case 367: + case 368: + case 369: + case 370: + case 371: + case 372: + case 373: + case 374: + case 375: + case 376: + case 377: + case 378: + case 379: + case 380: + case 381: + case 382: + case 383: + case 384: + case 385: + case 386: + case 387: + case 388: + case 389: + case 390: + case 391: + case 392: + case 393: + case 394: + case 395: + case 396: + case 397: + case 398: + case 399: + case 400: + case 401: + case 402: + case 403: + case 404: + case 405: + case 406: + case 407: + case 408: + case 409: + case 410: + case 411: + case 412: + case 413: + case 414: + case 415: + case 416: + case 417: + case 418: + case 419: + case 420: + case 421: + case 422: + case 423: + case 424: + case 425: + case 426: + case 427: + case 428: + case 429: + case 430: + case 431: + case 432: + case 433: + case 434: + case 435: + case 436: + case 437: + case 438: + case 439: + case 440: + case 441: + case 442: + case 443: + case 444: + case 445: + case 446: + case 447: + case 448: + case 449: + case 450: + case 451: + case 452: + case 453: + case 454: + case 455: + case 456: + case 457: + case 458: + case 459: + case 460: + case 461: + case 462: + case 463: + case 464: + case 465: + case 466: + case 467: + case 468: + case 469: + case 470: + case 471: + case 472: + case 473: + case 474: + case 475: + case 476: + case 477: + case 478: + case 479: + case 480: + case 481: + case 482: + case 483: + case 484: + case 485: + case 486: + case 487: + case 488: + case 489: + case 490: + case 491: + case 492: + case 493: + case 494: + case 495: + case 496: + case 497: + case 498: + case 499: + case 500: + case 501: + case 502: + case 503: + case 504: + case 505: + case 506: + case 507: + case 508: + case 509: + case 510: + case 511: + case 512: + case 513: + case 514: + case 515: + case 516: + case 517: + case 518: + case 519: + case 520: + case 521: + case 522: + case 523: + case 524: + case 525: + case 526: + case 527: + case 528: + case 529: + case 530: + case 531: + case 532: + case 533: + case 534: + case 535: + case 536: + case 537: + case 538: + case 539: + case 540: + case 541: + case 542: + case 543: + case 544: + case 545: + case 546: + case 547: + case 548: + case 549: + case 550: + case 551: + case 552: + case 553: + case 554: + case 555: + case 556: + case 557: + case 558: + case 559: + case 560: + case 561: + case 562: + case 563: + case 564: + case 565: + case 566: + case 567: + case 568: + case 569: + case 570: + case 571: + case 572: + case 573: + case 574: + case 575: + case 576: + case 577: + case 578: + case 579: + case 580: + case 581: + case 582: + case 583: + case 584: + case 585: + case 586: + case 587: + case 588: + case 589: + case 590: + case 591: + case 592: + case 593: + case 594: + case 595: + case 596: + case 597: + case 598: + case 599: + case 600: + case 601: + case 602: + case 603: + case 604: + case 605: + case 606: + case 607: + case 608: + case 609: + case 610: + case 611: + case 612: + case 613: + case 614: + case 615: + case 616: + case 617: + case 618: + case 619: + case 620: + case 621: + case 622: + case 623: + case 624: + case 625: + case 626: + case 627: + case 628: + case 629: + case 630: + case 631: + case 632: + case 633: + case 634: + case 635: + case 636: + case 637: + case 638: + case 639: + case 640: + case 641: + case 642: + case 643: + case 644: + case 645: + case 646: + case 647: + case 648: + case 649: + case 650: + case 651: + case 652: + case 653: + case 654: + case 655: + case 656: + case 657: + case 658: + case 659: + case 660: + case 661: + case 662: + case 663: + case 664: + case 665: + case 666: + case 667: + case 668: + case 669: + case 670: + case 671: + case 672: + case 673: + case 674: + case 675: + case 676: + case 677: + case 678: + case 679: + case 680: + case 681: + case 682: + case 683: + case 684: + case 685: + case 686: + case 687: + case 688: + case 689: + case 690: + case 691: + case 692: + case 693: + case 694: + case 695: + case 696: + case 697: + case 698: + case 699: + case 700: + case 701: + case 702: + case 703: + case 704: + case 705: + case 706: + case 707: + case 708: + case 709: + case 710: + case 711: + case 712: + case 713: + case 714: + case 715: + case 716: + case 717: + case 718: + case 719: + case 720: + case 721: + case 722: + case 723: + case 724: + case 725: + case 726: + case 727: + case 728: + case 729: + case 730: + case 731: + break; + } + if (message.keyword_kind != null && message.hasOwnProperty("keyword_kind")) + switch (message.keyword_kind) { + default: + return "keyword_kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a ScanToken message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof pg_query.ScanToken + * @static + * @param {Object.} object Plain object + * @returns {pg_query.ScanToken} ScanToken + */ + ScanToken.fromObject = function fromObject(object) { + if (object instanceof $root.pg_query.ScanToken) + return object; + var message = new $root.pg_query.ScanToken(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.token) { + default: + if (typeof object.token === "number") { + message.token = object.token; + break; + } + break; + case "NUL": + case 0: + message.token = 0; + break; + case "ASCII_37": + case 37: + message.token = 37; + break; + case "ASCII_40": + case 40: + message.token = 40; + break; + case "ASCII_41": + case 41: + message.token = 41; + break; + case "ASCII_42": + case 42: + message.token = 42; + break; + case "ASCII_43": + case 43: + message.token = 43; + break; + case "ASCII_44": + case 44: + message.token = 44; + break; + case "ASCII_45": + case 45: + message.token = 45; + break; + case "ASCII_46": + case 46: + message.token = 46; + break; + case "ASCII_47": + case 47: + message.token = 47; + break; + case "ASCII_58": + case 58: + message.token = 58; + break; + case "ASCII_59": + case 59: + message.token = 59; + break; + case "ASCII_60": + case 60: + message.token = 60; + break; + case "ASCII_61": + case 61: + message.token = 61; + break; + case "ASCII_62": + case 62: + message.token = 62; + break; + case "ASCII_63": + case 63: + message.token = 63; + break; + case "ASCII_91": + case 91: + message.token = 91; + break; + case "ASCII_92": + case 92: + message.token = 92; + break; + case "ASCII_93": + case 93: + message.token = 93; + break; + case "ASCII_94": + case 94: + message.token = 94; + break; + case "IDENT": + case 258: + message.token = 258; + break; + case "UIDENT": + case 259: + message.token = 259; + break; + case "FCONST": + case 260: + message.token = 260; + break; + case "SCONST": + case 261: + message.token = 261; + break; + case "USCONST": + case 262: + message.token = 262; + break; + case "BCONST": + case 263: + message.token = 263; + break; + case "XCONST": + case 264: + message.token = 264; + break; + case "Op": + case 265: + message.token = 265; + break; + case "ICONST": + case 266: + message.token = 266; + break; + case "PARAM": + case 267: + message.token = 267; + break; + case "TYPECAST": + case 268: + message.token = 268; + break; + case "DOT_DOT": + case 269: + message.token = 269; + break; + case "COLON_EQUALS": + case 270: + message.token = 270; + break; + case "EQUALS_GREATER": + case 271: + message.token = 271; + break; + case "LESS_EQUALS": + case 272: + message.token = 272; + break; + case "GREATER_EQUALS": + case 273: + message.token = 273; + break; + case "NOT_EQUALS": + case 274: + message.token = 274; + break; + case "SQL_COMMENT": + case 275: + message.token = 275; + break; + case "C_COMMENT": + case 276: + message.token = 276; + break; + case "ABORT_P": + case 277: + message.token = 277; + break; + case "ABSOLUTE_P": + case 278: + message.token = 278; + break; + case "ACCESS": + case 279: + message.token = 279; + break; + case "ACTION": + case 280: + message.token = 280; + break; + case "ADD_P": + case 281: + message.token = 281; + break; + case "ADMIN": + case 282: + message.token = 282; + break; + case "AFTER": + case 283: + message.token = 283; + break; + case "AGGREGATE": + case 284: + message.token = 284; + break; + case "ALL": + case 285: + message.token = 285; + break; + case "ALSO": + case 286: + message.token = 286; + break; + case "ALTER": + case 287: + message.token = 287; + break; + case "ALWAYS": + case 288: + message.token = 288; + break; + case "ANALYSE": + case 289: + message.token = 289; + break; + case "ANALYZE": + case 290: + message.token = 290; + break; + case "AND": + case 291: + message.token = 291; + break; + case "ANY": + case 292: + message.token = 292; + break; + case "ARRAY": + case 293: + message.token = 293; + break; + case "AS": + case 294: + message.token = 294; + break; + case "ASC": + case 295: + message.token = 295; + break; + case "ASSERTION": + case 296: + message.token = 296; + break; + case "ASSIGNMENT": + case 297: + message.token = 297; + break; + case "ASYMMETRIC": + case 298: + message.token = 298; + break; + case "AT": + case 299: + message.token = 299; + break; + case "ATTACH": + case 300: + message.token = 300; + break; + case "ATTRIBUTE": + case 301: + message.token = 301; + break; + case "AUTHORIZATION": + case 302: + message.token = 302; + break; + case "BACKWARD": + case 303: + message.token = 303; + break; + case "BEFORE": + case 304: + message.token = 304; + break; + case "BEGIN_P": + case 305: + message.token = 305; + break; + case "BETWEEN": + case 306: + message.token = 306; + break; + case "BIGINT": + case 307: + message.token = 307; + break; + case "BINARY": + case 308: + message.token = 308; + break; + case "BIT": + case 309: + message.token = 309; + break; + case "BOOLEAN_P": + case 310: + message.token = 310; + break; + case "BOTH": + case 311: + message.token = 311; + break; + case "BY": + case 312: + message.token = 312; + break; + case "CACHE": + case 313: + message.token = 313; + break; + case "CALL": + case 314: + message.token = 314; + break; + case "CALLED": + case 315: + message.token = 315; + break; + case "CASCADE": + case 316: + message.token = 316; + break; + case "CASCADED": + case 317: + message.token = 317; + break; + case "CASE": + case 318: + message.token = 318; + break; + case "CAST": + case 319: + message.token = 319; + break; + case "CATALOG_P": + case 320: + message.token = 320; + break; + case "CHAIN": + case 321: + message.token = 321; + break; + case "CHAR_P": + case 322: + message.token = 322; + break; + case "CHARACTER": + case 323: + message.token = 323; + break; + case "CHARACTERISTICS": + case 324: + message.token = 324; + break; + case "CHECK": + case 325: + message.token = 325; + break; + case "CHECKPOINT": + case 326: + message.token = 326; + break; + case "CLASS": + case 327: + message.token = 327; + break; + case "CLOSE": + case 328: + message.token = 328; + break; + case "CLUSTER": + case 329: + message.token = 329; + break; + case "COALESCE": + case 330: + message.token = 330; + break; + case "COLLATE": + case 331: + message.token = 331; + break; + case "COLLATION": + case 332: + message.token = 332; + break; + case "COLUMN": + case 333: + message.token = 333; + break; + case "COLUMNS": + case 334: + message.token = 334; + break; + case "COMMENT": + case 335: + message.token = 335; + break; + case "COMMENTS": + case 336: + message.token = 336; + break; + case "COMMIT": + case 337: + message.token = 337; + break; + case "COMMITTED": + case 338: + message.token = 338; + break; + case "CONCURRENTLY": + case 339: + message.token = 339; + break; + case "CONFIGURATION": + case 340: + message.token = 340; + break; + case "CONFLICT": + case 341: + message.token = 341; + break; + case "CONNECTION": + case 342: + message.token = 342; + break; + case "CONSTRAINT": + case 343: + message.token = 343; + break; + case "CONSTRAINTS": + case 344: + message.token = 344; + break; + case "CONTENT_P": + case 345: + message.token = 345; + break; + case "CONTINUE_P": + case 346: + message.token = 346; + break; + case "CONVERSION_P": + case 347: + message.token = 347; + break; + case "COPY": + case 348: + message.token = 348; + break; + case "COST": + case 349: + message.token = 349; + break; + case "CREATE": + case 350: + message.token = 350; + break; + case "CROSS": + case 351: + message.token = 351; + break; + case "CSV": + case 352: + message.token = 352; + break; + case "CUBE": + case 353: + message.token = 353; + break; + case "CURRENT_P": + case 354: + message.token = 354; + break; + case "CURRENT_CATALOG": + case 355: + message.token = 355; + break; + case "CURRENT_DATE": + case 356: + message.token = 356; + break; + case "CURRENT_ROLE": + case 357: + message.token = 357; + break; + case "CURRENT_SCHEMA": + case 358: + message.token = 358; + break; + case "CURRENT_TIME": + case 359: + message.token = 359; + break; + case "CURRENT_TIMESTAMP": + case 360: + message.token = 360; + break; + case "CURRENT_USER": + case 361: + message.token = 361; + break; + case "CURSOR": + case 362: + message.token = 362; + break; + case "CYCLE": + case 363: + message.token = 363; + break; + case "DATA_P": + case 364: + message.token = 364; + break; + case "DATABASE": + case 365: + message.token = 365; + break; + case "DAY_P": + case 366: + message.token = 366; + break; + case "DEALLOCATE": + case 367: + message.token = 367; + break; + case "DEC": + case 368: + message.token = 368; + break; + case "DECIMAL_P": + case 369: + message.token = 369; + break; + case "DECLARE": + case 370: + message.token = 370; + break; + case "DEFAULT": + case 371: + message.token = 371; + break; + case "DEFAULTS": + case 372: + message.token = 372; + break; + case "DEFERRABLE": + case 373: + message.token = 373; + break; + case "DEFERRED": + case 374: + message.token = 374; + break; + case "DEFINER": + case 375: + message.token = 375; + break; + case "DELETE_P": + case 376: + message.token = 376; + break; + case "DELIMITER": + case 377: + message.token = 377; + break; + case "DELIMITERS": + case 378: + message.token = 378; + break; + case "DEPENDS": + case 379: + message.token = 379; + break; + case "DESC": + case 380: + message.token = 380; + break; + case "DETACH": + case 381: + message.token = 381; + break; + case "DICTIONARY": + case 382: + message.token = 382; + break; + case "DISABLE_P": + case 383: + message.token = 383; + break; + case "DISCARD": + case 384: + message.token = 384; + break; + case "DISTINCT": + case 385: + message.token = 385; + break; + case "DO": + case 386: + message.token = 386; + break; + case "DOCUMENT_P": + case 387: + message.token = 387; + break; + case "DOMAIN_P": + case 388: + message.token = 388; + break; + case "DOUBLE_P": + case 389: + message.token = 389; + break; + case "DROP": + case 390: + message.token = 390; + break; + case "EACH": + case 391: + message.token = 391; + break; + case "ELSE": + case 392: + message.token = 392; + break; + case "ENABLE_P": + case 393: + message.token = 393; + break; + case "ENCODING": + case 394: + message.token = 394; + break; + case "ENCRYPTED": + case 395: + message.token = 395; + break; + case "END_P": + case 396: + message.token = 396; + break; + case "ENUM_P": + case 397: + message.token = 397; + break; + case "ESCAPE": + case 398: + message.token = 398; + break; + case "EVENT": + case 399: + message.token = 399; + break; + case "EXCEPT": + case 400: + message.token = 400; + break; + case "EXCLUDE": + case 401: + message.token = 401; + break; + case "EXCLUDING": + case 402: + message.token = 402; + break; + case "EXCLUSIVE": + case 403: + message.token = 403; + break; + case "EXECUTE": + case 404: + message.token = 404; + break; + case "EXISTS": + case 405: + message.token = 405; + break; + case "EXPLAIN": + case 406: + message.token = 406; + break; + case "EXPRESSION": + case 407: + message.token = 407; + break; + case "EXTENSION": + case 408: + message.token = 408; + break; + case "EXTERNAL": + case 409: + message.token = 409; + break; + case "EXTRACT": + case 410: + message.token = 410; + break; + case "FALSE_P": + case 411: + message.token = 411; + break; + case "FAMILY": + case 412: + message.token = 412; + break; + case "FETCH": + case 413: + message.token = 413; + break; + case "FILTER": + case 414: + message.token = 414; + break; + case "FIRST_P": + case 415: + message.token = 415; + break; + case "FLOAT_P": + case 416: + message.token = 416; + break; + case "FOLLOWING": + case 417: + message.token = 417; + break; + case "FOR": + case 418: + message.token = 418; + break; + case "FORCE": + case 419: + message.token = 419; + break; + case "FOREIGN": + case 420: + message.token = 420; + break; + case "FORWARD": + case 421: + message.token = 421; + break; + case "FREEZE": + case 422: + message.token = 422; + break; + case "FROM": + case 423: + message.token = 423; + break; + case "FULL": + case 424: + message.token = 424; + break; + case "FUNCTION": + case 425: + message.token = 425; + break; + case "FUNCTIONS": + case 426: + message.token = 426; + break; + case "GENERATED": + case 427: + message.token = 427; + break; + case "GLOBAL": + case 428: + message.token = 428; + break; + case "GRANT": + case 429: + message.token = 429; + break; + case "GRANTED": + case 430: + message.token = 430; + break; + case "GREATEST": + case 431: + message.token = 431; + break; + case "GROUP_P": + case 432: + message.token = 432; + break; + case "GROUPING": + case 433: + message.token = 433; + break; + case "GROUPS": + case 434: + message.token = 434; + break; + case "HANDLER": + case 435: + message.token = 435; + break; + case "HAVING": + case 436: + message.token = 436; + break; + case "HEADER_P": + case 437: + message.token = 437; + break; + case "HOLD": + case 438: + message.token = 438; + break; + case "HOUR_P": + case 439: + message.token = 439; + break; + case "IDENTITY_P": + case 440: + message.token = 440; + break; + case "IF_P": + case 441: + message.token = 441; + break; + case "ILIKE": + case 442: + message.token = 442; + break; + case "IMMEDIATE": + case 443: + message.token = 443; + break; + case "IMMUTABLE": + case 444: + message.token = 444; + break; + case "IMPLICIT_P": + case 445: + message.token = 445; + break; + case "IMPORT_P": + case 446: + message.token = 446; + break; + case "IN_P": + case 447: + message.token = 447; + break; + case "INCLUDE": + case 448: + message.token = 448; + break; + case "INCLUDING": + case 449: + message.token = 449; + break; + case "INCREMENT": + case 450: + message.token = 450; + break; + case "INDEX": + case 451: + message.token = 451; + break; + case "INDEXES": + case 452: + message.token = 452; + break; + case "INHERIT": + case 453: + message.token = 453; + break; + case "INHERITS": + case 454: + message.token = 454; + break; + case "INITIALLY": + case 455: + message.token = 455; + break; + case "INLINE_P": + case 456: + message.token = 456; + break; + case "INNER_P": + case 457: + message.token = 457; + break; + case "INOUT": + case 458: + message.token = 458; + break; + case "INPUT_P": + case 459: + message.token = 459; + break; + case "INSENSITIVE": + case 460: + message.token = 460; + break; + case "INSERT": + case 461: + message.token = 461; + break; + case "INSTEAD": + case 462: + message.token = 462; + break; + case "INT_P": + case 463: + message.token = 463; + break; + case "INTEGER": + case 464: + message.token = 464; + break; + case "INTERSECT": + case 465: + message.token = 465; + break; + case "INTERVAL": + case 466: + message.token = 466; + break; + case "INTO": + case 467: + message.token = 467; + break; + case "INVOKER": + case 468: + message.token = 468; + break; + case "IS": + case 469: + message.token = 469; + break; + case "ISNULL": + case 470: + message.token = 470; + break; + case "ISOLATION": + case 471: + message.token = 471; + break; + case "JOIN": + case 472: + message.token = 472; + break; + case "KEY": + case 473: + message.token = 473; + break; + case "LABEL": + case 474: + message.token = 474; + break; + case "LANGUAGE": + case 475: + message.token = 475; + break; + case "LARGE_P": + case 476: + message.token = 476; + break; + case "LAST_P": + case 477: + message.token = 477; + break; + case "LATERAL_P": + case 478: + message.token = 478; + break; + case "LEADING": + case 479: + message.token = 479; + break; + case "LEAKPROOF": + case 480: + message.token = 480; + break; + case "LEAST": + case 481: + message.token = 481; + break; + case "LEFT": + case 482: + message.token = 482; + break; + case "LEVEL": + case 483: + message.token = 483; + break; + case "LIKE": + case 484: + message.token = 484; + break; + case "LIMIT": + case 485: + message.token = 485; + break; + case "LISTEN": + case 486: + message.token = 486; + break; + case "LOAD": + case 487: + message.token = 487; + break; + case "LOCAL": + case 488: + message.token = 488; + break; + case "LOCALTIME": + case 489: + message.token = 489; + break; + case "LOCALTIMESTAMP": + case 490: + message.token = 490; + break; + case "LOCATION": + case 491: + message.token = 491; + break; + case "LOCK_P": + case 492: + message.token = 492; + break; + case "LOCKED": + case 493: + message.token = 493; + break; + case "LOGGED": + case 494: + message.token = 494; + break; + case "MAPPING": + case 495: + message.token = 495; + break; + case "MATCH": + case 496: + message.token = 496; + break; + case "MATERIALIZED": + case 497: + message.token = 497; + break; + case "MAXVALUE": + case 498: + message.token = 498; + break; + case "METHOD": + case 499: + message.token = 499; + break; + case "MINUTE_P": + case 500: + message.token = 500; + break; + case "MINVALUE": + case 501: + message.token = 501; + break; + case "MODE": + case 502: + message.token = 502; + break; + case "MONTH_P": + case 503: + message.token = 503; + break; + case "MOVE": + case 504: + message.token = 504; + break; + case "NAME_P": + case 505: + message.token = 505; + break; + case "NAMES": + case 506: + message.token = 506; + break; + case "NATIONAL": + case 507: + message.token = 507; + break; + case "NATURAL": + case 508: + message.token = 508; + break; + case "NCHAR": + case 509: + message.token = 509; + break; + case "NEW": + case 510: + message.token = 510; + break; + case "NEXT": + case 511: + message.token = 511; + break; + case "NFC": + case 512: + message.token = 512; + break; + case "NFD": + case 513: + message.token = 513; + break; + case "NFKC": + case 514: + message.token = 514; + break; + case "NFKD": + case 515: + message.token = 515; + break; + case "NO": + case 516: + message.token = 516; + break; + case "NONE": + case 517: + message.token = 517; + break; + case "NORMALIZE": + case 518: + message.token = 518; + break; + case "NORMALIZED": + case 519: + message.token = 519; + break; + case "NOT": + case 520: + message.token = 520; + break; + case "NOTHING": + case 521: + message.token = 521; + break; + case "NOTIFY": + case 522: + message.token = 522; + break; + case "NOTNULL": + case 523: + message.token = 523; + break; + case "NOWAIT": + case 524: + message.token = 524; + break; + case "NULL_P": + case 525: + message.token = 525; + break; + case "NULLIF": + case 526: + message.token = 526; + break; + case "NULLS_P": + case 527: + message.token = 527; + break; + case "NUMERIC": + case 528: + message.token = 528; + break; + case "OBJECT_P": + case 529: + message.token = 529; + break; + case "OF": + case 530: + message.token = 530; + break; + case "OFF": + case 531: + message.token = 531; + break; + case "OFFSET": + case 532: + message.token = 532; + break; + case "OIDS": + case 533: + message.token = 533; + break; + case "OLD": + case 534: + message.token = 534; + break; + case "ON": + case 535: + message.token = 535; + break; + case "ONLY": + case 536: + message.token = 536; + break; + case "OPERATOR": + case 537: + message.token = 537; + break; + case "OPTION": + case 538: + message.token = 538; + break; + case "OPTIONS": + case 539: + message.token = 539; + break; + case "OR": + case 540: + message.token = 540; + break; + case "ORDER": + case 541: + message.token = 541; + break; + case "ORDINALITY": + case 542: + message.token = 542; + break; + case "OTHERS": + case 543: + message.token = 543; + break; + case "OUT_P": + case 544: + message.token = 544; + break; + case "OUTER_P": + case 545: + message.token = 545; + break; + case "OVER": + case 546: + message.token = 546; + break; + case "OVERLAPS": + case 547: + message.token = 547; + break; + case "OVERLAY": + case 548: + message.token = 548; + break; + case "OVERRIDING": + case 549: + message.token = 549; + break; + case "OWNED": + case 550: + message.token = 550; + break; + case "OWNER": + case 551: + message.token = 551; + break; + case "PARALLEL": + case 552: + message.token = 552; + break; + case "PARSER": + case 553: + message.token = 553; + break; + case "PARTIAL": + case 554: + message.token = 554; + break; + case "PARTITION": + case 555: + message.token = 555; + break; + case "PASSING": + case 556: + message.token = 556; + break; + case "PASSWORD": + case 557: + message.token = 557; + break; + case "PLACING": + case 558: + message.token = 558; + break; + case "PLANS": + case 559: + message.token = 559; + break; + case "POLICY": + case 560: + message.token = 560; + break; + case "POSITION": + case 561: + message.token = 561; + break; + case "PRECEDING": + case 562: + message.token = 562; + break; + case "PRECISION": + case 563: + message.token = 563; + break; + case "PRESERVE": + case 564: + message.token = 564; + break; + case "PREPARE": + case 565: + message.token = 565; + break; + case "PREPARED": + case 566: + message.token = 566; + break; + case "PRIMARY": + case 567: + message.token = 567; + break; + case "PRIOR": + case 568: + message.token = 568; + break; + case "PRIVILEGES": + case 569: + message.token = 569; + break; + case "PROCEDURAL": + case 570: + message.token = 570; + break; + case "PROCEDURE": + case 571: + message.token = 571; + break; + case "PROCEDURES": + case 572: + message.token = 572; + break; + case "PROGRAM": + case 573: + message.token = 573; + break; + case "PUBLICATION": + case 574: + message.token = 574; + break; + case "QUOTE": + case 575: + message.token = 575; + break; + case "RANGE": + case 576: + message.token = 576; + break; + case "READ": + case 577: + message.token = 577; + break; + case "REAL": + case 578: + message.token = 578; + break; + case "REASSIGN": + case 579: + message.token = 579; + break; + case "RECHECK": + case 580: + message.token = 580; + break; + case "RECURSIVE": + case 581: + message.token = 581; + break; + case "REF_P": + case 582: + message.token = 582; + break; + case "REFERENCES": + case 583: + message.token = 583; + break; + case "REFERENCING": + case 584: + message.token = 584; + break; + case "REFRESH": + case 585: + message.token = 585; + break; + case "REINDEX": + case 586: + message.token = 586; + break; + case "RELATIVE_P": + case 587: + message.token = 587; + break; + case "RELEASE": + case 588: + message.token = 588; + break; + case "RENAME": + case 589: + message.token = 589; + break; + case "REPEATABLE": + case 590: + message.token = 590; + break; + case "REPLACE": + case 591: + message.token = 591; + break; + case "REPLICA": + case 592: + message.token = 592; + break; + case "RESET": + case 593: + message.token = 593; + break; + case "RESTART": + case 594: + message.token = 594; + break; + case "RESTRICT": + case 595: + message.token = 595; + break; + case "RETURNING": + case 596: + message.token = 596; + break; + case "RETURNS": + case 597: + message.token = 597; + break; + case "REVOKE": + case 598: + message.token = 598; + break; + case "RIGHT": + case 599: + message.token = 599; + break; + case "ROLE": + case 600: + message.token = 600; + break; + case "ROLLBACK": + case 601: + message.token = 601; + break; + case "ROLLUP": + case 602: + message.token = 602; + break; + case "ROUTINE": + case 603: + message.token = 603; + break; + case "ROUTINES": + case 604: + message.token = 604; + break; + case "ROW": + case 605: + message.token = 605; + break; + case "ROWS": + case 606: + message.token = 606; + break; + case "RULE": + case 607: + message.token = 607; + break; + case "SAVEPOINT": + case 608: + message.token = 608; + break; + case "SCHEMA": + case 609: + message.token = 609; + break; + case "SCHEMAS": + case 610: + message.token = 610; + break; + case "SCROLL": + case 611: + message.token = 611; + break; + case "SEARCH": + case 612: + message.token = 612; + break; + case "SECOND_P": + case 613: + message.token = 613; + break; + case "SECURITY": + case 614: + message.token = 614; + break; + case "SELECT": + case 615: + message.token = 615; + break; + case "SEQUENCE": + case 616: + message.token = 616; + break; + case "SEQUENCES": + case 617: + message.token = 617; + break; + case "SERIALIZABLE": + case 618: + message.token = 618; + break; + case "SERVER": + case 619: + message.token = 619; + break; + case "SESSION": + case 620: + message.token = 620; + break; + case "SESSION_USER": + case 621: + message.token = 621; + break; + case "SET": + case 622: + message.token = 622; + break; + case "SETS": + case 623: + message.token = 623; + break; + case "SETOF": + case 624: + message.token = 624; + break; + case "SHARE": + case 625: + message.token = 625; + break; + case "SHOW": + case 626: + message.token = 626; + break; + case "SIMILAR": + case 627: + message.token = 627; + break; + case "SIMPLE": + case 628: + message.token = 628; + break; + case "SKIP": + case 629: + message.token = 629; + break; + case "SMALLINT": + case 630: + message.token = 630; + break; + case "SNAPSHOT": + case 631: + message.token = 631; + break; + case "SOME": + case 632: + message.token = 632; + break; + case "SQL_P": + case 633: + message.token = 633; + break; + case "STABLE": + case 634: + message.token = 634; + break; + case "STANDALONE_P": + case 635: + message.token = 635; + break; + case "START": + case 636: + message.token = 636; + break; + case "STATEMENT": + case 637: + message.token = 637; + break; + case "STATISTICS": + case 638: + message.token = 638; + break; + case "STDIN": + case 639: + message.token = 639; + break; + case "STDOUT": + case 640: + message.token = 640; + break; + case "STORAGE": + case 641: + message.token = 641; + break; + case "STORED": + case 642: + message.token = 642; + break; + case "STRICT_P": + case 643: + message.token = 643; + break; + case "STRIP_P": + case 644: + message.token = 644; + break; + case "SUBSCRIPTION": + case 645: + message.token = 645; + break; + case "SUBSTRING": + case 646: + message.token = 646; + break; + case "SUPPORT": + case 647: + message.token = 647; + break; + case "SYMMETRIC": + case 648: + message.token = 648; + break; + case "SYSID": + case 649: + message.token = 649; + break; + case "SYSTEM_P": + case 650: + message.token = 650; + break; + case "TABLE": + case 651: + message.token = 651; + break; + case "TABLES": + case 652: + message.token = 652; + break; + case "TABLESAMPLE": + case 653: + message.token = 653; + break; + case "TABLESPACE": + case 654: + message.token = 654; + break; + case "TEMP": + case 655: + message.token = 655; + break; + case "TEMPLATE": + case 656: + message.token = 656; + break; + case "TEMPORARY": + case 657: + message.token = 657; + break; + case "TEXT_P": + case 658: + message.token = 658; + break; + case "THEN": + case 659: + message.token = 659; + break; + case "TIES": + case 660: + message.token = 660; + break; + case "TIME": + case 661: + message.token = 661; + break; + case "TIMESTAMP": + case 662: + message.token = 662; + break; + case "TO": + case 663: + message.token = 663; + break; + case "TRAILING": + case 664: + message.token = 664; + break; + case "TRANSACTION": + case 665: + message.token = 665; + break; + case "TRANSFORM": + case 666: + message.token = 666; + break; + case "TREAT": + case 667: + message.token = 667; + break; + case "TRIGGER": + case 668: + message.token = 668; + break; + case "TRIM": + case 669: + message.token = 669; + break; + case "TRUE_P": + case 670: + message.token = 670; + break; + case "TRUNCATE": + case 671: + message.token = 671; + break; + case "TRUSTED": + case 672: + message.token = 672; + break; + case "TYPE_P": + case 673: + message.token = 673; + break; + case "TYPES_P": + case 674: + message.token = 674; + break; + case "UESCAPE": + case 675: + message.token = 675; + break; + case "UNBOUNDED": + case 676: + message.token = 676; + break; + case "UNCOMMITTED": + case 677: + message.token = 677; + break; + case "UNENCRYPTED": + case 678: + message.token = 678; + break; + case "UNION": + case 679: + message.token = 679; + break; + case "UNIQUE": + case 680: + message.token = 680; + break; + case "UNKNOWN": + case 681: + message.token = 681; + break; + case "UNLISTEN": + case 682: + message.token = 682; + break; + case "UNLOGGED": + case 683: + message.token = 683; + break; + case "UNTIL": + case 684: + message.token = 684; + break; + case "UPDATE": + case 685: + message.token = 685; + break; + case "USER": + case 686: + message.token = 686; + break; + case "USING": + case 687: + message.token = 687; + break; + case "VACUUM": + case 688: + message.token = 688; + break; + case "VALID": + case 689: + message.token = 689; + break; + case "VALIDATE": + case 690: + message.token = 690; + break; + case "VALIDATOR": + case 691: + message.token = 691; + break; + case "VALUE_P": + case 692: + message.token = 692; + break; + case "VALUES": + case 693: + message.token = 693; + break; + case "VARCHAR": + case 694: + message.token = 694; + break; + case "VARIADIC": + case 695: + message.token = 695; + break; + case "VARYING": + case 696: + message.token = 696; + break; + case "VERBOSE": + case 697: + message.token = 697; + break; + case "VERSION_P": + case 698: + message.token = 698; + break; + case "VIEW": + case 699: + message.token = 699; + break; + case "VIEWS": + case 700: + message.token = 700; + break; + case "VOLATILE": + case 701: + message.token = 701; + break; + case "WHEN": + case 702: + message.token = 702; + break; + case "WHERE": + case 703: + message.token = 703; + break; + case "WHITESPACE_P": + case 704: + message.token = 704; + break; + case "WINDOW": + case 705: + message.token = 705; + break; + case "WITH": + case 706: + message.token = 706; + break; + case "WITHIN": + case 707: + message.token = 707; + break; + case "WITHOUT": + case 708: + message.token = 708; + break; + case "WORK": + case 709: + message.token = 709; + break; + case "WRAPPER": + case 710: + message.token = 710; + break; + case "WRITE": + case 711: + message.token = 711; + break; + case "XML_P": + case 712: + message.token = 712; + break; + case "XMLATTRIBUTES": + case 713: + message.token = 713; + break; + case "XMLCONCAT": + case 714: + message.token = 714; + break; + case "XMLELEMENT": + case 715: + message.token = 715; + break; + case "XMLEXISTS": + case 716: + message.token = 716; + break; + case "XMLFOREST": + case 717: + message.token = 717; + break; + case "XMLNAMESPACES": + case 718: + message.token = 718; + break; + case "XMLPARSE": + case 719: + message.token = 719; + break; + case "XMLPI": + case 720: + message.token = 720; + break; + case "XMLROOT": + case 721: + message.token = 721; + break; + case "XMLSERIALIZE": + case 722: + message.token = 722; + break; + case "XMLTABLE": + case 723: + message.token = 723; + break; + case "YEAR_P": + case 724: + message.token = 724; + break; + case "YES_P": + case 725: + message.token = 725; + break; + case "ZONE": + case 726: + message.token = 726; + break; + case "NOT_LA": + case 727: + message.token = 727; + break; + case "NULLS_LA": + case 728: + message.token = 728; + break; + case "WITH_LA": + case 729: + message.token = 729; + break; + case "POSTFIXOP": + case 730: + message.token = 730; + break; + case "UMINUS": + case 731: + message.token = 731; + break; + } + switch (object.keyword_kind) { + default: + if (typeof object.keyword_kind === "number") { + message.keyword_kind = object.keyword_kind; + break; + } + break; + case "NO_KEYWORD": + case 0: + message.keyword_kind = 0; + break; + case "UNRESERVED_KEYWORD": + case 1: + message.keyword_kind = 1; + break; + case "COL_NAME_KEYWORD": + case 2: + message.keyword_kind = 2; + break; + case "TYPE_FUNC_NAME_KEYWORD": + case 3: + message.keyword_kind = 3; + break; + case "RESERVED_KEYWORD": + case 4: + message.keyword_kind = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a ScanToken message. Also converts values to other types if specified. + * @function toObject + * @memberof pg_query.ScanToken + * @static + * @param {pg_query.ScanToken} message ScanToken + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScanToken.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.token = options.enums === String ? "NUL" : 0; + object.keyword_kind = options.enums === String ? "NO_KEYWORD" : 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.token != null && message.hasOwnProperty("token")) + object.token = options.enums === String ? $root.pg_query.Token[message.token] === undefined ? message.token : $root.pg_query.Token[message.token] : message.token; + if (message.keyword_kind != null && message.hasOwnProperty("keyword_kind")) + object.keyword_kind = options.enums === String ? $root.pg_query.KeywordKind[message.keyword_kind] === undefined ? message.keyword_kind : $root.pg_query.KeywordKind[message.keyword_kind] : message.keyword_kind; + return object; + }; + + /** + * Converts this ScanToken to JSON. + * @function toJSON + * @memberof pg_query.ScanToken + * @instance + * @returns {Object.} JSON object + */ + ScanToken.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScanToken + * @function getTypeUrl + * @memberof pg_query.ScanToken + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScanToken.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/pg_query.ScanToken"; + }; + + return ScanToken; + })(); + + /** + * KeywordKind enum. + * @name pg_query.KeywordKind + * @enum {number} + * @property {number} NO_KEYWORD=0 NO_KEYWORD value + * @property {number} UNRESERVED_KEYWORD=1 UNRESERVED_KEYWORD value + * @property {number} COL_NAME_KEYWORD=2 COL_NAME_KEYWORD value + * @property {number} TYPE_FUNC_NAME_KEYWORD=3 TYPE_FUNC_NAME_KEYWORD value + * @property {number} RESERVED_KEYWORD=4 RESERVED_KEYWORD value + */ + pg_query.KeywordKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NO_KEYWORD"] = 0; + values[valuesById[1] = "UNRESERVED_KEYWORD"] = 1; + values[valuesById[2] = "COL_NAME_KEYWORD"] = 2; + values[valuesById[3] = "TYPE_FUNC_NAME_KEYWORD"] = 3; + values[valuesById[4] = "RESERVED_KEYWORD"] = 4; + return values; + })(); + + /** + * Token enum. + * @name pg_query.Token + * @enum {number} + * @property {number} NUL=0 NUL value + * @property {number} ASCII_37=37 ASCII_37 value + * @property {number} ASCII_40=40 ASCII_40 value + * @property {number} ASCII_41=41 ASCII_41 value + * @property {number} ASCII_42=42 ASCII_42 value + * @property {number} ASCII_43=43 ASCII_43 value + * @property {number} ASCII_44=44 ASCII_44 value + * @property {number} ASCII_45=45 ASCII_45 value + * @property {number} ASCII_46=46 ASCII_46 value + * @property {number} ASCII_47=47 ASCII_47 value + * @property {number} ASCII_58=58 ASCII_58 value + * @property {number} ASCII_59=59 ASCII_59 value + * @property {number} ASCII_60=60 ASCII_60 value + * @property {number} ASCII_61=61 ASCII_61 value + * @property {number} ASCII_62=62 ASCII_62 value + * @property {number} ASCII_63=63 ASCII_63 value + * @property {number} ASCII_91=91 ASCII_91 value + * @property {number} ASCII_92=92 ASCII_92 value + * @property {number} ASCII_93=93 ASCII_93 value + * @property {number} ASCII_94=94 ASCII_94 value + * @property {number} IDENT=258 IDENT value + * @property {number} UIDENT=259 UIDENT value + * @property {number} FCONST=260 FCONST value + * @property {number} SCONST=261 SCONST value + * @property {number} USCONST=262 USCONST value + * @property {number} BCONST=263 BCONST value + * @property {number} XCONST=264 XCONST value + * @property {number} Op=265 Op value + * @property {number} ICONST=266 ICONST value + * @property {number} PARAM=267 PARAM value + * @property {number} TYPECAST=268 TYPECAST value + * @property {number} DOT_DOT=269 DOT_DOT value + * @property {number} COLON_EQUALS=270 COLON_EQUALS value + * @property {number} EQUALS_GREATER=271 EQUALS_GREATER value + * @property {number} LESS_EQUALS=272 LESS_EQUALS value + * @property {number} GREATER_EQUALS=273 GREATER_EQUALS value + * @property {number} NOT_EQUALS=274 NOT_EQUALS value + * @property {number} SQL_COMMENT=275 SQL_COMMENT value + * @property {number} C_COMMENT=276 C_COMMENT value + * @property {number} ABORT_P=277 ABORT_P value + * @property {number} ABSOLUTE_P=278 ABSOLUTE_P value + * @property {number} ACCESS=279 ACCESS value + * @property {number} ACTION=280 ACTION value + * @property {number} ADD_P=281 ADD_P value + * @property {number} ADMIN=282 ADMIN value + * @property {number} AFTER=283 AFTER value + * @property {number} AGGREGATE=284 AGGREGATE value + * @property {number} ALL=285 ALL value + * @property {number} ALSO=286 ALSO value + * @property {number} ALTER=287 ALTER value + * @property {number} ALWAYS=288 ALWAYS value + * @property {number} ANALYSE=289 ANALYSE value + * @property {number} ANALYZE=290 ANALYZE value + * @property {number} AND=291 AND value + * @property {number} ANY=292 ANY value + * @property {number} ARRAY=293 ARRAY value + * @property {number} AS=294 AS value + * @property {number} ASC=295 ASC value + * @property {number} ASSERTION=296 ASSERTION value + * @property {number} ASSIGNMENT=297 ASSIGNMENT value + * @property {number} ASYMMETRIC=298 ASYMMETRIC value + * @property {number} AT=299 AT value + * @property {number} ATTACH=300 ATTACH value + * @property {number} ATTRIBUTE=301 ATTRIBUTE value + * @property {number} AUTHORIZATION=302 AUTHORIZATION value + * @property {number} BACKWARD=303 BACKWARD value + * @property {number} BEFORE=304 BEFORE value + * @property {number} BEGIN_P=305 BEGIN_P value + * @property {number} BETWEEN=306 BETWEEN value + * @property {number} BIGINT=307 BIGINT value + * @property {number} BINARY=308 BINARY value + * @property {number} BIT=309 BIT value + * @property {number} BOOLEAN_P=310 BOOLEAN_P value + * @property {number} BOTH=311 BOTH value + * @property {number} BY=312 BY value + * @property {number} CACHE=313 CACHE value + * @property {number} CALL=314 CALL value + * @property {number} CALLED=315 CALLED value + * @property {number} CASCADE=316 CASCADE value + * @property {number} CASCADED=317 CASCADED value + * @property {number} CASE=318 CASE value + * @property {number} CAST=319 CAST value + * @property {number} CATALOG_P=320 CATALOG_P value + * @property {number} CHAIN=321 CHAIN value + * @property {number} CHAR_P=322 CHAR_P value + * @property {number} CHARACTER=323 CHARACTER value + * @property {number} CHARACTERISTICS=324 CHARACTERISTICS value + * @property {number} CHECK=325 CHECK value + * @property {number} CHECKPOINT=326 CHECKPOINT value + * @property {number} CLASS=327 CLASS value + * @property {number} CLOSE=328 CLOSE value + * @property {number} CLUSTER=329 CLUSTER value + * @property {number} COALESCE=330 COALESCE value + * @property {number} COLLATE=331 COLLATE value + * @property {number} COLLATION=332 COLLATION value + * @property {number} COLUMN=333 COLUMN value + * @property {number} COLUMNS=334 COLUMNS value + * @property {number} COMMENT=335 COMMENT value + * @property {number} COMMENTS=336 COMMENTS value + * @property {number} COMMIT=337 COMMIT value + * @property {number} COMMITTED=338 COMMITTED value + * @property {number} CONCURRENTLY=339 CONCURRENTLY value + * @property {number} CONFIGURATION=340 CONFIGURATION value + * @property {number} CONFLICT=341 CONFLICT value + * @property {number} CONNECTION=342 CONNECTION value + * @property {number} CONSTRAINT=343 CONSTRAINT value + * @property {number} CONSTRAINTS=344 CONSTRAINTS value + * @property {number} CONTENT_P=345 CONTENT_P value + * @property {number} CONTINUE_P=346 CONTINUE_P value + * @property {number} CONVERSION_P=347 CONVERSION_P value + * @property {number} COPY=348 COPY value + * @property {number} COST=349 COST value + * @property {number} CREATE=350 CREATE value + * @property {number} CROSS=351 CROSS value + * @property {number} CSV=352 CSV value + * @property {number} CUBE=353 CUBE value + * @property {number} CURRENT_P=354 CURRENT_P value + * @property {number} CURRENT_CATALOG=355 CURRENT_CATALOG value + * @property {number} CURRENT_DATE=356 CURRENT_DATE value + * @property {number} CURRENT_ROLE=357 CURRENT_ROLE value + * @property {number} CURRENT_SCHEMA=358 CURRENT_SCHEMA value + * @property {number} CURRENT_TIME=359 CURRENT_TIME value + * @property {number} CURRENT_TIMESTAMP=360 CURRENT_TIMESTAMP value + * @property {number} CURRENT_USER=361 CURRENT_USER value + * @property {number} CURSOR=362 CURSOR value + * @property {number} CYCLE=363 CYCLE value + * @property {number} DATA_P=364 DATA_P value + * @property {number} DATABASE=365 DATABASE value + * @property {number} DAY_P=366 DAY_P value + * @property {number} DEALLOCATE=367 DEALLOCATE value + * @property {number} DEC=368 DEC value + * @property {number} DECIMAL_P=369 DECIMAL_P value + * @property {number} DECLARE=370 DECLARE value + * @property {number} DEFAULT=371 DEFAULT value + * @property {number} DEFAULTS=372 DEFAULTS value + * @property {number} DEFERRABLE=373 DEFERRABLE value + * @property {number} DEFERRED=374 DEFERRED value + * @property {number} DEFINER=375 DEFINER value + * @property {number} DELETE_P=376 DELETE_P value + * @property {number} DELIMITER=377 DELIMITER value + * @property {number} DELIMITERS=378 DELIMITERS value + * @property {number} DEPENDS=379 DEPENDS value + * @property {number} DESC=380 DESC value + * @property {number} DETACH=381 DETACH value + * @property {number} DICTIONARY=382 DICTIONARY value + * @property {number} DISABLE_P=383 DISABLE_P value + * @property {number} DISCARD=384 DISCARD value + * @property {number} DISTINCT=385 DISTINCT value + * @property {number} DO=386 DO value + * @property {number} DOCUMENT_P=387 DOCUMENT_P value + * @property {number} DOMAIN_P=388 DOMAIN_P value + * @property {number} DOUBLE_P=389 DOUBLE_P value + * @property {number} DROP=390 DROP value + * @property {number} EACH=391 EACH value + * @property {number} ELSE=392 ELSE value + * @property {number} ENABLE_P=393 ENABLE_P value + * @property {number} ENCODING=394 ENCODING value + * @property {number} ENCRYPTED=395 ENCRYPTED value + * @property {number} END_P=396 END_P value + * @property {number} ENUM_P=397 ENUM_P value + * @property {number} ESCAPE=398 ESCAPE value + * @property {number} EVENT=399 EVENT value + * @property {number} EXCEPT=400 EXCEPT value + * @property {number} EXCLUDE=401 EXCLUDE value + * @property {number} EXCLUDING=402 EXCLUDING value + * @property {number} EXCLUSIVE=403 EXCLUSIVE value + * @property {number} EXECUTE=404 EXECUTE value + * @property {number} EXISTS=405 EXISTS value + * @property {number} EXPLAIN=406 EXPLAIN value + * @property {number} EXPRESSION=407 EXPRESSION value + * @property {number} EXTENSION=408 EXTENSION value + * @property {number} EXTERNAL=409 EXTERNAL value + * @property {number} EXTRACT=410 EXTRACT value + * @property {number} FALSE_P=411 FALSE_P value + * @property {number} FAMILY=412 FAMILY value + * @property {number} FETCH=413 FETCH value + * @property {number} FILTER=414 FILTER value + * @property {number} FIRST_P=415 FIRST_P value + * @property {number} FLOAT_P=416 FLOAT_P value + * @property {number} FOLLOWING=417 FOLLOWING value + * @property {number} FOR=418 FOR value + * @property {number} FORCE=419 FORCE value + * @property {number} FOREIGN=420 FOREIGN value + * @property {number} FORWARD=421 FORWARD value + * @property {number} FREEZE=422 FREEZE value + * @property {number} FROM=423 FROM value + * @property {number} FULL=424 FULL value + * @property {number} FUNCTION=425 FUNCTION value + * @property {number} FUNCTIONS=426 FUNCTIONS value + * @property {number} GENERATED=427 GENERATED value + * @property {number} GLOBAL=428 GLOBAL value + * @property {number} GRANT=429 GRANT value + * @property {number} GRANTED=430 GRANTED value + * @property {number} GREATEST=431 GREATEST value + * @property {number} GROUP_P=432 GROUP_P value + * @property {number} GROUPING=433 GROUPING value + * @property {number} GROUPS=434 GROUPS value + * @property {number} HANDLER=435 HANDLER value + * @property {number} HAVING=436 HAVING value + * @property {number} HEADER_P=437 HEADER_P value + * @property {number} HOLD=438 HOLD value + * @property {number} HOUR_P=439 HOUR_P value + * @property {number} IDENTITY_P=440 IDENTITY_P value + * @property {number} IF_P=441 IF_P value + * @property {number} ILIKE=442 ILIKE value + * @property {number} IMMEDIATE=443 IMMEDIATE value + * @property {number} IMMUTABLE=444 IMMUTABLE value + * @property {number} IMPLICIT_P=445 IMPLICIT_P value + * @property {number} IMPORT_P=446 IMPORT_P value + * @property {number} IN_P=447 IN_P value + * @property {number} INCLUDE=448 INCLUDE value + * @property {number} INCLUDING=449 INCLUDING value + * @property {number} INCREMENT=450 INCREMENT value + * @property {number} INDEX=451 INDEX value + * @property {number} INDEXES=452 INDEXES value + * @property {number} INHERIT=453 INHERIT value + * @property {number} INHERITS=454 INHERITS value + * @property {number} INITIALLY=455 INITIALLY value + * @property {number} INLINE_P=456 INLINE_P value + * @property {number} INNER_P=457 INNER_P value + * @property {number} INOUT=458 INOUT value + * @property {number} INPUT_P=459 INPUT_P value + * @property {number} INSENSITIVE=460 INSENSITIVE value + * @property {number} INSERT=461 INSERT value + * @property {number} INSTEAD=462 INSTEAD value + * @property {number} INT_P=463 INT_P value + * @property {number} INTEGER=464 INTEGER value + * @property {number} INTERSECT=465 INTERSECT value + * @property {number} INTERVAL=466 INTERVAL value + * @property {number} INTO=467 INTO value + * @property {number} INVOKER=468 INVOKER value + * @property {number} IS=469 IS value + * @property {number} ISNULL=470 ISNULL value + * @property {number} ISOLATION=471 ISOLATION value + * @property {number} JOIN=472 JOIN value + * @property {number} KEY=473 KEY value + * @property {number} LABEL=474 LABEL value + * @property {number} LANGUAGE=475 LANGUAGE value + * @property {number} LARGE_P=476 LARGE_P value + * @property {number} LAST_P=477 LAST_P value + * @property {number} LATERAL_P=478 LATERAL_P value + * @property {number} LEADING=479 LEADING value + * @property {number} LEAKPROOF=480 LEAKPROOF value + * @property {number} LEAST=481 LEAST value + * @property {number} LEFT=482 LEFT value + * @property {number} LEVEL=483 LEVEL value + * @property {number} LIKE=484 LIKE value + * @property {number} LIMIT=485 LIMIT value + * @property {number} LISTEN=486 LISTEN value + * @property {number} LOAD=487 LOAD value + * @property {number} LOCAL=488 LOCAL value + * @property {number} LOCALTIME=489 LOCALTIME value + * @property {number} LOCALTIMESTAMP=490 LOCALTIMESTAMP value + * @property {number} LOCATION=491 LOCATION value + * @property {number} LOCK_P=492 LOCK_P value + * @property {number} LOCKED=493 LOCKED value + * @property {number} LOGGED=494 LOGGED value + * @property {number} MAPPING=495 MAPPING value + * @property {number} MATCH=496 MATCH value + * @property {number} MATERIALIZED=497 MATERIALIZED value + * @property {number} MAXVALUE=498 MAXVALUE value + * @property {number} METHOD=499 METHOD value + * @property {number} MINUTE_P=500 MINUTE_P value + * @property {number} MINVALUE=501 MINVALUE value + * @property {number} MODE=502 MODE value + * @property {number} MONTH_P=503 MONTH_P value + * @property {number} MOVE=504 MOVE value + * @property {number} NAME_P=505 NAME_P value + * @property {number} NAMES=506 NAMES value + * @property {number} NATIONAL=507 NATIONAL value + * @property {number} NATURAL=508 NATURAL value + * @property {number} NCHAR=509 NCHAR value + * @property {number} NEW=510 NEW value + * @property {number} NEXT=511 NEXT value + * @property {number} NFC=512 NFC value + * @property {number} NFD=513 NFD value + * @property {number} NFKC=514 NFKC value + * @property {number} NFKD=515 NFKD value + * @property {number} NO=516 NO value + * @property {number} NONE=517 NONE value + * @property {number} NORMALIZE=518 NORMALIZE value + * @property {number} NORMALIZED=519 NORMALIZED value + * @property {number} NOT=520 NOT value + * @property {number} NOTHING=521 NOTHING value + * @property {number} NOTIFY=522 NOTIFY value + * @property {number} NOTNULL=523 NOTNULL value + * @property {number} NOWAIT=524 NOWAIT value + * @property {number} NULL_P=525 NULL_P value + * @property {number} NULLIF=526 NULLIF value + * @property {number} NULLS_P=527 NULLS_P value + * @property {number} NUMERIC=528 NUMERIC value + * @property {number} OBJECT_P=529 OBJECT_P value + * @property {number} OF=530 OF value + * @property {number} OFF=531 OFF value + * @property {number} OFFSET=532 OFFSET value + * @property {number} OIDS=533 OIDS value + * @property {number} OLD=534 OLD value + * @property {number} ON=535 ON value + * @property {number} ONLY=536 ONLY value + * @property {number} OPERATOR=537 OPERATOR value + * @property {number} OPTION=538 OPTION value + * @property {number} OPTIONS=539 OPTIONS value + * @property {number} OR=540 OR value + * @property {number} ORDER=541 ORDER value + * @property {number} ORDINALITY=542 ORDINALITY value + * @property {number} OTHERS=543 OTHERS value + * @property {number} OUT_P=544 OUT_P value + * @property {number} OUTER_P=545 OUTER_P value + * @property {number} OVER=546 OVER value + * @property {number} OVERLAPS=547 OVERLAPS value + * @property {number} OVERLAY=548 OVERLAY value + * @property {number} OVERRIDING=549 OVERRIDING value + * @property {number} OWNED=550 OWNED value + * @property {number} OWNER=551 OWNER value + * @property {number} PARALLEL=552 PARALLEL value + * @property {number} PARSER=553 PARSER value + * @property {number} PARTIAL=554 PARTIAL value + * @property {number} PARTITION=555 PARTITION value + * @property {number} PASSING=556 PASSING value + * @property {number} PASSWORD=557 PASSWORD value + * @property {number} PLACING=558 PLACING value + * @property {number} PLANS=559 PLANS value + * @property {number} POLICY=560 POLICY value + * @property {number} POSITION=561 POSITION value + * @property {number} PRECEDING=562 PRECEDING value + * @property {number} PRECISION=563 PRECISION value + * @property {number} PRESERVE=564 PRESERVE value + * @property {number} PREPARE=565 PREPARE value + * @property {number} PREPARED=566 PREPARED value + * @property {number} PRIMARY=567 PRIMARY value + * @property {number} PRIOR=568 PRIOR value + * @property {number} PRIVILEGES=569 PRIVILEGES value + * @property {number} PROCEDURAL=570 PROCEDURAL value + * @property {number} PROCEDURE=571 PROCEDURE value + * @property {number} PROCEDURES=572 PROCEDURES value + * @property {number} PROGRAM=573 PROGRAM value + * @property {number} PUBLICATION=574 PUBLICATION value + * @property {number} QUOTE=575 QUOTE value + * @property {number} RANGE=576 RANGE value + * @property {number} READ=577 READ value + * @property {number} REAL=578 REAL value + * @property {number} REASSIGN=579 REASSIGN value + * @property {number} RECHECK=580 RECHECK value + * @property {number} RECURSIVE=581 RECURSIVE value + * @property {number} REF_P=582 REF_P value + * @property {number} REFERENCES=583 REFERENCES value + * @property {number} REFERENCING=584 REFERENCING value + * @property {number} REFRESH=585 REFRESH value + * @property {number} REINDEX=586 REINDEX value + * @property {number} RELATIVE_P=587 RELATIVE_P value + * @property {number} RELEASE=588 RELEASE value + * @property {number} RENAME=589 RENAME value + * @property {number} REPEATABLE=590 REPEATABLE value + * @property {number} REPLACE=591 REPLACE value + * @property {number} REPLICA=592 REPLICA value + * @property {number} RESET=593 RESET value + * @property {number} RESTART=594 RESTART value + * @property {number} RESTRICT=595 RESTRICT value + * @property {number} RETURNING=596 RETURNING value + * @property {number} RETURNS=597 RETURNS value + * @property {number} REVOKE=598 REVOKE value + * @property {number} RIGHT=599 RIGHT value + * @property {number} ROLE=600 ROLE value + * @property {number} ROLLBACK=601 ROLLBACK value + * @property {number} ROLLUP=602 ROLLUP value + * @property {number} ROUTINE=603 ROUTINE value + * @property {number} ROUTINES=604 ROUTINES value + * @property {number} ROW=605 ROW value + * @property {number} ROWS=606 ROWS value + * @property {number} RULE=607 RULE value + * @property {number} SAVEPOINT=608 SAVEPOINT value + * @property {number} SCHEMA=609 SCHEMA value + * @property {number} SCHEMAS=610 SCHEMAS value + * @property {number} SCROLL=611 SCROLL value + * @property {number} SEARCH=612 SEARCH value + * @property {number} SECOND_P=613 SECOND_P value + * @property {number} SECURITY=614 SECURITY value + * @property {number} SELECT=615 SELECT value + * @property {number} SEQUENCE=616 SEQUENCE value + * @property {number} SEQUENCES=617 SEQUENCES value + * @property {number} SERIALIZABLE=618 SERIALIZABLE value + * @property {number} SERVER=619 SERVER value + * @property {number} SESSION=620 SESSION value + * @property {number} SESSION_USER=621 SESSION_USER value + * @property {number} SET=622 SET value + * @property {number} SETS=623 SETS value + * @property {number} SETOF=624 SETOF value + * @property {number} SHARE=625 SHARE value + * @property {number} SHOW=626 SHOW value + * @property {number} SIMILAR=627 SIMILAR value + * @property {number} SIMPLE=628 SIMPLE value + * @property {number} SKIP=629 SKIP value + * @property {number} SMALLINT=630 SMALLINT value + * @property {number} SNAPSHOT=631 SNAPSHOT value + * @property {number} SOME=632 SOME value + * @property {number} SQL_P=633 SQL_P value + * @property {number} STABLE=634 STABLE value + * @property {number} STANDALONE_P=635 STANDALONE_P value + * @property {number} START=636 START value + * @property {number} STATEMENT=637 STATEMENT value + * @property {number} STATISTICS=638 STATISTICS value + * @property {number} STDIN=639 STDIN value + * @property {number} STDOUT=640 STDOUT value + * @property {number} STORAGE=641 STORAGE value + * @property {number} STORED=642 STORED value + * @property {number} STRICT_P=643 STRICT_P value + * @property {number} STRIP_P=644 STRIP_P value + * @property {number} SUBSCRIPTION=645 SUBSCRIPTION value + * @property {number} SUBSTRING=646 SUBSTRING value + * @property {number} SUPPORT=647 SUPPORT value + * @property {number} SYMMETRIC=648 SYMMETRIC value + * @property {number} SYSID=649 SYSID value + * @property {number} SYSTEM_P=650 SYSTEM_P value + * @property {number} TABLE=651 TABLE value + * @property {number} TABLES=652 TABLES value + * @property {number} TABLESAMPLE=653 TABLESAMPLE value + * @property {number} TABLESPACE=654 TABLESPACE value + * @property {number} TEMP=655 TEMP value + * @property {number} TEMPLATE=656 TEMPLATE value + * @property {number} TEMPORARY=657 TEMPORARY value + * @property {number} TEXT_P=658 TEXT_P value + * @property {number} THEN=659 THEN value + * @property {number} TIES=660 TIES value + * @property {number} TIME=661 TIME value + * @property {number} TIMESTAMP=662 TIMESTAMP value + * @property {number} TO=663 TO value + * @property {number} TRAILING=664 TRAILING value + * @property {number} TRANSACTION=665 TRANSACTION value + * @property {number} TRANSFORM=666 TRANSFORM value + * @property {number} TREAT=667 TREAT value + * @property {number} TRIGGER=668 TRIGGER value + * @property {number} TRIM=669 TRIM value + * @property {number} TRUE_P=670 TRUE_P value + * @property {number} TRUNCATE=671 TRUNCATE value + * @property {number} TRUSTED=672 TRUSTED value + * @property {number} TYPE_P=673 TYPE_P value + * @property {number} TYPES_P=674 TYPES_P value + * @property {number} UESCAPE=675 UESCAPE value + * @property {number} UNBOUNDED=676 UNBOUNDED value + * @property {number} UNCOMMITTED=677 UNCOMMITTED value + * @property {number} UNENCRYPTED=678 UNENCRYPTED value + * @property {number} UNION=679 UNION value + * @property {number} UNIQUE=680 UNIQUE value + * @property {number} UNKNOWN=681 UNKNOWN value + * @property {number} UNLISTEN=682 UNLISTEN value + * @property {number} UNLOGGED=683 UNLOGGED value + * @property {number} UNTIL=684 UNTIL value + * @property {number} UPDATE=685 UPDATE value + * @property {number} USER=686 USER value + * @property {number} USING=687 USING value + * @property {number} VACUUM=688 VACUUM value + * @property {number} VALID=689 VALID value + * @property {number} VALIDATE=690 VALIDATE value + * @property {number} VALIDATOR=691 VALIDATOR value + * @property {number} VALUE_P=692 VALUE_P value + * @property {number} VALUES=693 VALUES value + * @property {number} VARCHAR=694 VARCHAR value + * @property {number} VARIADIC=695 VARIADIC value + * @property {number} VARYING=696 VARYING value + * @property {number} VERBOSE=697 VERBOSE value + * @property {number} VERSION_P=698 VERSION_P value + * @property {number} VIEW=699 VIEW value + * @property {number} VIEWS=700 VIEWS value + * @property {number} VOLATILE=701 VOLATILE value + * @property {number} WHEN=702 WHEN value + * @property {number} WHERE=703 WHERE value + * @property {number} WHITESPACE_P=704 WHITESPACE_P value + * @property {number} WINDOW=705 WINDOW value + * @property {number} WITH=706 WITH value + * @property {number} WITHIN=707 WITHIN value + * @property {number} WITHOUT=708 WITHOUT value + * @property {number} WORK=709 WORK value + * @property {number} WRAPPER=710 WRAPPER value + * @property {number} WRITE=711 WRITE value + * @property {number} XML_P=712 XML_P value + * @property {number} XMLATTRIBUTES=713 XMLATTRIBUTES value + * @property {number} XMLCONCAT=714 XMLCONCAT value + * @property {number} XMLELEMENT=715 XMLELEMENT value + * @property {number} XMLEXISTS=716 XMLEXISTS value + * @property {number} XMLFOREST=717 XMLFOREST value + * @property {number} XMLNAMESPACES=718 XMLNAMESPACES value + * @property {number} XMLPARSE=719 XMLPARSE value + * @property {number} XMLPI=720 XMLPI value + * @property {number} XMLROOT=721 XMLROOT value + * @property {number} XMLSERIALIZE=722 XMLSERIALIZE value + * @property {number} XMLTABLE=723 XMLTABLE value + * @property {number} YEAR_P=724 YEAR_P value + * @property {number} YES_P=725 YES_P value + * @property {number} ZONE=726 ZONE value + * @property {number} NOT_LA=727 NOT_LA value + * @property {number} NULLS_LA=728 NULLS_LA value + * @property {number} WITH_LA=729 WITH_LA value + * @property {number} POSTFIXOP=730 POSTFIXOP value + * @property {number} UMINUS=731 UMINUS value + */ + pg_query.Token = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NUL"] = 0; + values[valuesById[37] = "ASCII_37"] = 37; + values[valuesById[40] = "ASCII_40"] = 40; + values[valuesById[41] = "ASCII_41"] = 41; + values[valuesById[42] = "ASCII_42"] = 42; + values[valuesById[43] = "ASCII_43"] = 43; + values[valuesById[44] = "ASCII_44"] = 44; + values[valuesById[45] = "ASCII_45"] = 45; + values[valuesById[46] = "ASCII_46"] = 46; + values[valuesById[47] = "ASCII_47"] = 47; + values[valuesById[58] = "ASCII_58"] = 58; + values[valuesById[59] = "ASCII_59"] = 59; + values[valuesById[60] = "ASCII_60"] = 60; + values[valuesById[61] = "ASCII_61"] = 61; + values[valuesById[62] = "ASCII_62"] = 62; + values[valuesById[63] = "ASCII_63"] = 63; + values[valuesById[91] = "ASCII_91"] = 91; + values[valuesById[92] = "ASCII_92"] = 92; + values[valuesById[93] = "ASCII_93"] = 93; + values[valuesById[94] = "ASCII_94"] = 94; + values[valuesById[258] = "IDENT"] = 258; + values[valuesById[259] = "UIDENT"] = 259; + values[valuesById[260] = "FCONST"] = 260; + values[valuesById[261] = "SCONST"] = 261; + values[valuesById[262] = "USCONST"] = 262; + values[valuesById[263] = "BCONST"] = 263; + values[valuesById[264] = "XCONST"] = 264; + values[valuesById[265] = "Op"] = 265; + values[valuesById[266] = "ICONST"] = 266; + values[valuesById[267] = "PARAM"] = 267; + values[valuesById[268] = "TYPECAST"] = 268; + values[valuesById[269] = "DOT_DOT"] = 269; + values[valuesById[270] = "COLON_EQUALS"] = 270; + values[valuesById[271] = "EQUALS_GREATER"] = 271; + values[valuesById[272] = "LESS_EQUALS"] = 272; + values[valuesById[273] = "GREATER_EQUALS"] = 273; + values[valuesById[274] = "NOT_EQUALS"] = 274; + values[valuesById[275] = "SQL_COMMENT"] = 275; + values[valuesById[276] = "C_COMMENT"] = 276; + values[valuesById[277] = "ABORT_P"] = 277; + values[valuesById[278] = "ABSOLUTE_P"] = 278; + values[valuesById[279] = "ACCESS"] = 279; + values[valuesById[280] = "ACTION"] = 280; + values[valuesById[281] = "ADD_P"] = 281; + values[valuesById[282] = "ADMIN"] = 282; + values[valuesById[283] = "AFTER"] = 283; + values[valuesById[284] = "AGGREGATE"] = 284; + values[valuesById[285] = "ALL"] = 285; + values[valuesById[286] = "ALSO"] = 286; + values[valuesById[287] = "ALTER"] = 287; + values[valuesById[288] = "ALWAYS"] = 288; + values[valuesById[289] = "ANALYSE"] = 289; + values[valuesById[290] = "ANALYZE"] = 290; + values[valuesById[291] = "AND"] = 291; + values[valuesById[292] = "ANY"] = 292; + values[valuesById[293] = "ARRAY"] = 293; + values[valuesById[294] = "AS"] = 294; + values[valuesById[295] = "ASC"] = 295; + values[valuesById[296] = "ASSERTION"] = 296; + values[valuesById[297] = "ASSIGNMENT"] = 297; + values[valuesById[298] = "ASYMMETRIC"] = 298; + values[valuesById[299] = "AT"] = 299; + values[valuesById[300] = "ATTACH"] = 300; + values[valuesById[301] = "ATTRIBUTE"] = 301; + values[valuesById[302] = "AUTHORIZATION"] = 302; + values[valuesById[303] = "BACKWARD"] = 303; + values[valuesById[304] = "BEFORE"] = 304; + values[valuesById[305] = "BEGIN_P"] = 305; + values[valuesById[306] = "BETWEEN"] = 306; + values[valuesById[307] = "BIGINT"] = 307; + values[valuesById[308] = "BINARY"] = 308; + values[valuesById[309] = "BIT"] = 309; + values[valuesById[310] = "BOOLEAN_P"] = 310; + values[valuesById[311] = "BOTH"] = 311; + values[valuesById[312] = "BY"] = 312; + values[valuesById[313] = "CACHE"] = 313; + values[valuesById[314] = "CALL"] = 314; + values[valuesById[315] = "CALLED"] = 315; + values[valuesById[316] = "CASCADE"] = 316; + values[valuesById[317] = "CASCADED"] = 317; + values[valuesById[318] = "CASE"] = 318; + values[valuesById[319] = "CAST"] = 319; + values[valuesById[320] = "CATALOG_P"] = 320; + values[valuesById[321] = "CHAIN"] = 321; + values[valuesById[322] = "CHAR_P"] = 322; + values[valuesById[323] = "CHARACTER"] = 323; + values[valuesById[324] = "CHARACTERISTICS"] = 324; + values[valuesById[325] = "CHECK"] = 325; + values[valuesById[326] = "CHECKPOINT"] = 326; + values[valuesById[327] = "CLASS"] = 327; + values[valuesById[328] = "CLOSE"] = 328; + values[valuesById[329] = "CLUSTER"] = 329; + values[valuesById[330] = "COALESCE"] = 330; + values[valuesById[331] = "COLLATE"] = 331; + values[valuesById[332] = "COLLATION"] = 332; + values[valuesById[333] = "COLUMN"] = 333; + values[valuesById[334] = "COLUMNS"] = 334; + values[valuesById[335] = "COMMENT"] = 335; + values[valuesById[336] = "COMMENTS"] = 336; + values[valuesById[337] = "COMMIT"] = 337; + values[valuesById[338] = "COMMITTED"] = 338; + values[valuesById[339] = "CONCURRENTLY"] = 339; + values[valuesById[340] = "CONFIGURATION"] = 340; + values[valuesById[341] = "CONFLICT"] = 341; + values[valuesById[342] = "CONNECTION"] = 342; + values[valuesById[343] = "CONSTRAINT"] = 343; + values[valuesById[344] = "CONSTRAINTS"] = 344; + values[valuesById[345] = "CONTENT_P"] = 345; + values[valuesById[346] = "CONTINUE_P"] = 346; + values[valuesById[347] = "CONVERSION_P"] = 347; + values[valuesById[348] = "COPY"] = 348; + values[valuesById[349] = "COST"] = 349; + values[valuesById[350] = "CREATE"] = 350; + values[valuesById[351] = "CROSS"] = 351; + values[valuesById[352] = "CSV"] = 352; + values[valuesById[353] = "CUBE"] = 353; + values[valuesById[354] = "CURRENT_P"] = 354; + values[valuesById[355] = "CURRENT_CATALOG"] = 355; + values[valuesById[356] = "CURRENT_DATE"] = 356; + values[valuesById[357] = "CURRENT_ROLE"] = 357; + values[valuesById[358] = "CURRENT_SCHEMA"] = 358; + values[valuesById[359] = "CURRENT_TIME"] = 359; + values[valuesById[360] = "CURRENT_TIMESTAMP"] = 360; + values[valuesById[361] = "CURRENT_USER"] = 361; + values[valuesById[362] = "CURSOR"] = 362; + values[valuesById[363] = "CYCLE"] = 363; + values[valuesById[364] = "DATA_P"] = 364; + values[valuesById[365] = "DATABASE"] = 365; + values[valuesById[366] = "DAY_P"] = 366; + values[valuesById[367] = "DEALLOCATE"] = 367; + values[valuesById[368] = "DEC"] = 368; + values[valuesById[369] = "DECIMAL_P"] = 369; + values[valuesById[370] = "DECLARE"] = 370; + values[valuesById[371] = "DEFAULT"] = 371; + values[valuesById[372] = "DEFAULTS"] = 372; + values[valuesById[373] = "DEFERRABLE"] = 373; + values[valuesById[374] = "DEFERRED"] = 374; + values[valuesById[375] = "DEFINER"] = 375; + values[valuesById[376] = "DELETE_P"] = 376; + values[valuesById[377] = "DELIMITER"] = 377; + values[valuesById[378] = "DELIMITERS"] = 378; + values[valuesById[379] = "DEPENDS"] = 379; + values[valuesById[380] = "DESC"] = 380; + values[valuesById[381] = "DETACH"] = 381; + values[valuesById[382] = "DICTIONARY"] = 382; + values[valuesById[383] = "DISABLE_P"] = 383; + values[valuesById[384] = "DISCARD"] = 384; + values[valuesById[385] = "DISTINCT"] = 385; + values[valuesById[386] = "DO"] = 386; + values[valuesById[387] = "DOCUMENT_P"] = 387; + values[valuesById[388] = "DOMAIN_P"] = 388; + values[valuesById[389] = "DOUBLE_P"] = 389; + values[valuesById[390] = "DROP"] = 390; + values[valuesById[391] = "EACH"] = 391; + values[valuesById[392] = "ELSE"] = 392; + values[valuesById[393] = "ENABLE_P"] = 393; + values[valuesById[394] = "ENCODING"] = 394; + values[valuesById[395] = "ENCRYPTED"] = 395; + values[valuesById[396] = "END_P"] = 396; + values[valuesById[397] = "ENUM_P"] = 397; + values[valuesById[398] = "ESCAPE"] = 398; + values[valuesById[399] = "EVENT"] = 399; + values[valuesById[400] = "EXCEPT"] = 400; + values[valuesById[401] = "EXCLUDE"] = 401; + values[valuesById[402] = "EXCLUDING"] = 402; + values[valuesById[403] = "EXCLUSIVE"] = 403; + values[valuesById[404] = "EXECUTE"] = 404; + values[valuesById[405] = "EXISTS"] = 405; + values[valuesById[406] = "EXPLAIN"] = 406; + values[valuesById[407] = "EXPRESSION"] = 407; + values[valuesById[408] = "EXTENSION"] = 408; + values[valuesById[409] = "EXTERNAL"] = 409; + values[valuesById[410] = "EXTRACT"] = 410; + values[valuesById[411] = "FALSE_P"] = 411; + values[valuesById[412] = "FAMILY"] = 412; + values[valuesById[413] = "FETCH"] = 413; + values[valuesById[414] = "FILTER"] = 414; + values[valuesById[415] = "FIRST_P"] = 415; + values[valuesById[416] = "FLOAT_P"] = 416; + values[valuesById[417] = "FOLLOWING"] = 417; + values[valuesById[418] = "FOR"] = 418; + values[valuesById[419] = "FORCE"] = 419; + values[valuesById[420] = "FOREIGN"] = 420; + values[valuesById[421] = "FORWARD"] = 421; + values[valuesById[422] = "FREEZE"] = 422; + values[valuesById[423] = "FROM"] = 423; + values[valuesById[424] = "FULL"] = 424; + values[valuesById[425] = "FUNCTION"] = 425; + values[valuesById[426] = "FUNCTIONS"] = 426; + values[valuesById[427] = "GENERATED"] = 427; + values[valuesById[428] = "GLOBAL"] = 428; + values[valuesById[429] = "GRANT"] = 429; + values[valuesById[430] = "GRANTED"] = 430; + values[valuesById[431] = "GREATEST"] = 431; + values[valuesById[432] = "GROUP_P"] = 432; + values[valuesById[433] = "GROUPING"] = 433; + values[valuesById[434] = "GROUPS"] = 434; + values[valuesById[435] = "HANDLER"] = 435; + values[valuesById[436] = "HAVING"] = 436; + values[valuesById[437] = "HEADER_P"] = 437; + values[valuesById[438] = "HOLD"] = 438; + values[valuesById[439] = "HOUR_P"] = 439; + values[valuesById[440] = "IDENTITY_P"] = 440; + values[valuesById[441] = "IF_P"] = 441; + values[valuesById[442] = "ILIKE"] = 442; + values[valuesById[443] = "IMMEDIATE"] = 443; + values[valuesById[444] = "IMMUTABLE"] = 444; + values[valuesById[445] = "IMPLICIT_P"] = 445; + values[valuesById[446] = "IMPORT_P"] = 446; + values[valuesById[447] = "IN_P"] = 447; + values[valuesById[448] = "INCLUDE"] = 448; + values[valuesById[449] = "INCLUDING"] = 449; + values[valuesById[450] = "INCREMENT"] = 450; + values[valuesById[451] = "INDEX"] = 451; + values[valuesById[452] = "INDEXES"] = 452; + values[valuesById[453] = "INHERIT"] = 453; + values[valuesById[454] = "INHERITS"] = 454; + values[valuesById[455] = "INITIALLY"] = 455; + values[valuesById[456] = "INLINE_P"] = 456; + values[valuesById[457] = "INNER_P"] = 457; + values[valuesById[458] = "INOUT"] = 458; + values[valuesById[459] = "INPUT_P"] = 459; + values[valuesById[460] = "INSENSITIVE"] = 460; + values[valuesById[461] = "INSERT"] = 461; + values[valuesById[462] = "INSTEAD"] = 462; + values[valuesById[463] = "INT_P"] = 463; + values[valuesById[464] = "INTEGER"] = 464; + values[valuesById[465] = "INTERSECT"] = 465; + values[valuesById[466] = "INTERVAL"] = 466; + values[valuesById[467] = "INTO"] = 467; + values[valuesById[468] = "INVOKER"] = 468; + values[valuesById[469] = "IS"] = 469; + values[valuesById[470] = "ISNULL"] = 470; + values[valuesById[471] = "ISOLATION"] = 471; + values[valuesById[472] = "JOIN"] = 472; + values[valuesById[473] = "KEY"] = 473; + values[valuesById[474] = "LABEL"] = 474; + values[valuesById[475] = "LANGUAGE"] = 475; + values[valuesById[476] = "LARGE_P"] = 476; + values[valuesById[477] = "LAST_P"] = 477; + values[valuesById[478] = "LATERAL_P"] = 478; + values[valuesById[479] = "LEADING"] = 479; + values[valuesById[480] = "LEAKPROOF"] = 480; + values[valuesById[481] = "LEAST"] = 481; + values[valuesById[482] = "LEFT"] = 482; + values[valuesById[483] = "LEVEL"] = 483; + values[valuesById[484] = "LIKE"] = 484; + values[valuesById[485] = "LIMIT"] = 485; + values[valuesById[486] = "LISTEN"] = 486; + values[valuesById[487] = "LOAD"] = 487; + values[valuesById[488] = "LOCAL"] = 488; + values[valuesById[489] = "LOCALTIME"] = 489; + values[valuesById[490] = "LOCALTIMESTAMP"] = 490; + values[valuesById[491] = "LOCATION"] = 491; + values[valuesById[492] = "LOCK_P"] = 492; + values[valuesById[493] = "LOCKED"] = 493; + values[valuesById[494] = "LOGGED"] = 494; + values[valuesById[495] = "MAPPING"] = 495; + values[valuesById[496] = "MATCH"] = 496; + values[valuesById[497] = "MATERIALIZED"] = 497; + values[valuesById[498] = "MAXVALUE"] = 498; + values[valuesById[499] = "METHOD"] = 499; + values[valuesById[500] = "MINUTE_P"] = 500; + values[valuesById[501] = "MINVALUE"] = 501; + values[valuesById[502] = "MODE"] = 502; + values[valuesById[503] = "MONTH_P"] = 503; + values[valuesById[504] = "MOVE"] = 504; + values[valuesById[505] = "NAME_P"] = 505; + values[valuesById[506] = "NAMES"] = 506; + values[valuesById[507] = "NATIONAL"] = 507; + values[valuesById[508] = "NATURAL"] = 508; + values[valuesById[509] = "NCHAR"] = 509; + values[valuesById[510] = "NEW"] = 510; + values[valuesById[511] = "NEXT"] = 511; + values[valuesById[512] = "NFC"] = 512; + values[valuesById[513] = "NFD"] = 513; + values[valuesById[514] = "NFKC"] = 514; + values[valuesById[515] = "NFKD"] = 515; + values[valuesById[516] = "NO"] = 516; + values[valuesById[517] = "NONE"] = 517; + values[valuesById[518] = "NORMALIZE"] = 518; + values[valuesById[519] = "NORMALIZED"] = 519; + values[valuesById[520] = "NOT"] = 520; + values[valuesById[521] = "NOTHING"] = 521; + values[valuesById[522] = "NOTIFY"] = 522; + values[valuesById[523] = "NOTNULL"] = 523; + values[valuesById[524] = "NOWAIT"] = 524; + values[valuesById[525] = "NULL_P"] = 525; + values[valuesById[526] = "NULLIF"] = 526; + values[valuesById[527] = "NULLS_P"] = 527; + values[valuesById[528] = "NUMERIC"] = 528; + values[valuesById[529] = "OBJECT_P"] = 529; + values[valuesById[530] = "OF"] = 530; + values[valuesById[531] = "OFF"] = 531; + values[valuesById[532] = "OFFSET"] = 532; + values[valuesById[533] = "OIDS"] = 533; + values[valuesById[534] = "OLD"] = 534; + values[valuesById[535] = "ON"] = 535; + values[valuesById[536] = "ONLY"] = 536; + values[valuesById[537] = "OPERATOR"] = 537; + values[valuesById[538] = "OPTION"] = 538; + values[valuesById[539] = "OPTIONS"] = 539; + values[valuesById[540] = "OR"] = 540; + values[valuesById[541] = "ORDER"] = 541; + values[valuesById[542] = "ORDINALITY"] = 542; + values[valuesById[543] = "OTHERS"] = 543; + values[valuesById[544] = "OUT_P"] = 544; + values[valuesById[545] = "OUTER_P"] = 545; + values[valuesById[546] = "OVER"] = 546; + values[valuesById[547] = "OVERLAPS"] = 547; + values[valuesById[548] = "OVERLAY"] = 548; + values[valuesById[549] = "OVERRIDING"] = 549; + values[valuesById[550] = "OWNED"] = 550; + values[valuesById[551] = "OWNER"] = 551; + values[valuesById[552] = "PARALLEL"] = 552; + values[valuesById[553] = "PARSER"] = 553; + values[valuesById[554] = "PARTIAL"] = 554; + values[valuesById[555] = "PARTITION"] = 555; + values[valuesById[556] = "PASSING"] = 556; + values[valuesById[557] = "PASSWORD"] = 557; + values[valuesById[558] = "PLACING"] = 558; + values[valuesById[559] = "PLANS"] = 559; + values[valuesById[560] = "POLICY"] = 560; + values[valuesById[561] = "POSITION"] = 561; + values[valuesById[562] = "PRECEDING"] = 562; + values[valuesById[563] = "PRECISION"] = 563; + values[valuesById[564] = "PRESERVE"] = 564; + values[valuesById[565] = "PREPARE"] = 565; + values[valuesById[566] = "PREPARED"] = 566; + values[valuesById[567] = "PRIMARY"] = 567; + values[valuesById[568] = "PRIOR"] = 568; + values[valuesById[569] = "PRIVILEGES"] = 569; + values[valuesById[570] = "PROCEDURAL"] = 570; + values[valuesById[571] = "PROCEDURE"] = 571; + values[valuesById[572] = "PROCEDURES"] = 572; + values[valuesById[573] = "PROGRAM"] = 573; + values[valuesById[574] = "PUBLICATION"] = 574; + values[valuesById[575] = "QUOTE"] = 575; + values[valuesById[576] = "RANGE"] = 576; + values[valuesById[577] = "READ"] = 577; + values[valuesById[578] = "REAL"] = 578; + values[valuesById[579] = "REASSIGN"] = 579; + values[valuesById[580] = "RECHECK"] = 580; + values[valuesById[581] = "RECURSIVE"] = 581; + values[valuesById[582] = "REF_P"] = 582; + values[valuesById[583] = "REFERENCES"] = 583; + values[valuesById[584] = "REFERENCING"] = 584; + values[valuesById[585] = "REFRESH"] = 585; + values[valuesById[586] = "REINDEX"] = 586; + values[valuesById[587] = "RELATIVE_P"] = 587; + values[valuesById[588] = "RELEASE"] = 588; + values[valuesById[589] = "RENAME"] = 589; + values[valuesById[590] = "REPEATABLE"] = 590; + values[valuesById[591] = "REPLACE"] = 591; + values[valuesById[592] = "REPLICA"] = 592; + values[valuesById[593] = "RESET"] = 593; + values[valuesById[594] = "RESTART"] = 594; + values[valuesById[595] = "RESTRICT"] = 595; + values[valuesById[596] = "RETURNING"] = 596; + values[valuesById[597] = "RETURNS"] = 597; + values[valuesById[598] = "REVOKE"] = 598; + values[valuesById[599] = "RIGHT"] = 599; + values[valuesById[600] = "ROLE"] = 600; + values[valuesById[601] = "ROLLBACK"] = 601; + values[valuesById[602] = "ROLLUP"] = 602; + values[valuesById[603] = "ROUTINE"] = 603; + values[valuesById[604] = "ROUTINES"] = 604; + values[valuesById[605] = "ROW"] = 605; + values[valuesById[606] = "ROWS"] = 606; + values[valuesById[607] = "RULE"] = 607; + values[valuesById[608] = "SAVEPOINT"] = 608; + values[valuesById[609] = "SCHEMA"] = 609; + values[valuesById[610] = "SCHEMAS"] = 610; + values[valuesById[611] = "SCROLL"] = 611; + values[valuesById[612] = "SEARCH"] = 612; + values[valuesById[613] = "SECOND_P"] = 613; + values[valuesById[614] = "SECURITY"] = 614; + values[valuesById[615] = "SELECT"] = 615; + values[valuesById[616] = "SEQUENCE"] = 616; + values[valuesById[617] = "SEQUENCES"] = 617; + values[valuesById[618] = "SERIALIZABLE"] = 618; + values[valuesById[619] = "SERVER"] = 619; + values[valuesById[620] = "SESSION"] = 620; + values[valuesById[621] = "SESSION_USER"] = 621; + values[valuesById[622] = "SET"] = 622; + values[valuesById[623] = "SETS"] = 623; + values[valuesById[624] = "SETOF"] = 624; + values[valuesById[625] = "SHARE"] = 625; + values[valuesById[626] = "SHOW"] = 626; + values[valuesById[627] = "SIMILAR"] = 627; + values[valuesById[628] = "SIMPLE"] = 628; + values[valuesById[629] = "SKIP"] = 629; + values[valuesById[630] = "SMALLINT"] = 630; + values[valuesById[631] = "SNAPSHOT"] = 631; + values[valuesById[632] = "SOME"] = 632; + values[valuesById[633] = "SQL_P"] = 633; + values[valuesById[634] = "STABLE"] = 634; + values[valuesById[635] = "STANDALONE_P"] = 635; + values[valuesById[636] = "START"] = 636; + values[valuesById[637] = "STATEMENT"] = 637; + values[valuesById[638] = "STATISTICS"] = 638; + values[valuesById[639] = "STDIN"] = 639; + values[valuesById[640] = "STDOUT"] = 640; + values[valuesById[641] = "STORAGE"] = 641; + values[valuesById[642] = "STORED"] = 642; + values[valuesById[643] = "STRICT_P"] = 643; + values[valuesById[644] = "STRIP_P"] = 644; + values[valuesById[645] = "SUBSCRIPTION"] = 645; + values[valuesById[646] = "SUBSTRING"] = 646; + values[valuesById[647] = "SUPPORT"] = 647; + values[valuesById[648] = "SYMMETRIC"] = 648; + values[valuesById[649] = "SYSID"] = 649; + values[valuesById[650] = "SYSTEM_P"] = 650; + values[valuesById[651] = "TABLE"] = 651; + values[valuesById[652] = "TABLES"] = 652; + values[valuesById[653] = "TABLESAMPLE"] = 653; + values[valuesById[654] = "TABLESPACE"] = 654; + values[valuesById[655] = "TEMP"] = 655; + values[valuesById[656] = "TEMPLATE"] = 656; + values[valuesById[657] = "TEMPORARY"] = 657; + values[valuesById[658] = "TEXT_P"] = 658; + values[valuesById[659] = "THEN"] = 659; + values[valuesById[660] = "TIES"] = 660; + values[valuesById[661] = "TIME"] = 661; + values[valuesById[662] = "TIMESTAMP"] = 662; + values[valuesById[663] = "TO"] = 663; + values[valuesById[664] = "TRAILING"] = 664; + values[valuesById[665] = "TRANSACTION"] = 665; + values[valuesById[666] = "TRANSFORM"] = 666; + values[valuesById[667] = "TREAT"] = 667; + values[valuesById[668] = "TRIGGER"] = 668; + values[valuesById[669] = "TRIM"] = 669; + values[valuesById[670] = "TRUE_P"] = 670; + values[valuesById[671] = "TRUNCATE"] = 671; + values[valuesById[672] = "TRUSTED"] = 672; + values[valuesById[673] = "TYPE_P"] = 673; + values[valuesById[674] = "TYPES_P"] = 674; + values[valuesById[675] = "UESCAPE"] = 675; + values[valuesById[676] = "UNBOUNDED"] = 676; + values[valuesById[677] = "UNCOMMITTED"] = 677; + values[valuesById[678] = "UNENCRYPTED"] = 678; + values[valuesById[679] = "UNION"] = 679; + values[valuesById[680] = "UNIQUE"] = 680; + values[valuesById[681] = "UNKNOWN"] = 681; + values[valuesById[682] = "UNLISTEN"] = 682; + values[valuesById[683] = "UNLOGGED"] = 683; + values[valuesById[684] = "UNTIL"] = 684; + values[valuesById[685] = "UPDATE"] = 685; + values[valuesById[686] = "USER"] = 686; + values[valuesById[687] = "USING"] = 687; + values[valuesById[688] = "VACUUM"] = 688; + values[valuesById[689] = "VALID"] = 689; + values[valuesById[690] = "VALIDATE"] = 690; + values[valuesById[691] = "VALIDATOR"] = 691; + values[valuesById[692] = "VALUE_P"] = 692; + values[valuesById[693] = "VALUES"] = 693; + values[valuesById[694] = "VARCHAR"] = 694; + values[valuesById[695] = "VARIADIC"] = 695; + values[valuesById[696] = "VARYING"] = 696; + values[valuesById[697] = "VERBOSE"] = 697; + values[valuesById[698] = "VERSION_P"] = 698; + values[valuesById[699] = "VIEW"] = 699; + values[valuesById[700] = "VIEWS"] = 700; + values[valuesById[701] = "VOLATILE"] = 701; + values[valuesById[702] = "WHEN"] = 702; + values[valuesById[703] = "WHERE"] = 703; + values[valuesById[704] = "WHITESPACE_P"] = 704; + values[valuesById[705] = "WINDOW"] = 705; + values[valuesById[706] = "WITH"] = 706; + values[valuesById[707] = "WITHIN"] = 707; + values[valuesById[708] = "WITHOUT"] = 708; + values[valuesById[709] = "WORK"] = 709; + values[valuesById[710] = "WRAPPER"] = 710; + values[valuesById[711] = "WRITE"] = 711; + values[valuesById[712] = "XML_P"] = 712; + values[valuesById[713] = "XMLATTRIBUTES"] = 713; + values[valuesById[714] = "XMLCONCAT"] = 714; + values[valuesById[715] = "XMLELEMENT"] = 715; + values[valuesById[716] = "XMLEXISTS"] = 716; + values[valuesById[717] = "XMLFOREST"] = 717; + values[valuesById[718] = "XMLNAMESPACES"] = 718; + values[valuesById[719] = "XMLPARSE"] = 719; + values[valuesById[720] = "XMLPI"] = 720; + values[valuesById[721] = "XMLROOT"] = 721; + values[valuesById[722] = "XMLSERIALIZE"] = 722; + values[valuesById[723] = "XMLTABLE"] = 723; + values[valuesById[724] = "YEAR_P"] = 724; + values[valuesById[725] = "YES_P"] = 725; + values[valuesById[726] = "ZONE"] = 726; + values[valuesById[727] = "NOT_LA"] = 727; + values[valuesById[728] = "NULLS_LA"] = 728; + values[valuesById[729] = "WITH_LA"] = 729; + values[valuesById[730] = "POSTFIXOP"] = 730; + values[valuesById[731] = "UMINUS"] = 731; + return values; + })(); + + return pg_query; + })(); + + return $root; +}); diff --git a/queryparser.cc b/queryparser.cc deleted file mode 100644 index c383c50..0000000 --- a/queryparser.cc +++ /dev/null @@ -1,235 +0,0 @@ -#include -#include -#include "pg_query.h" -#include - -using namespace v8; - -Local CreateError(Isolate* isolate, const PgQueryError& err) -{ - v8::EscapableHandleScope handleScope(isolate); - Local error = Object::New(isolate); - - error->Set(String::NewFromUtf8(isolate, "message"), String::NewFromUtf8(isolate, err.message)); - error->Set(String::NewFromUtf8(isolate, "fileName"), String::NewFromUtf8(isolate, err.filename)); - error->Set(String::NewFromUtf8(isolate, "functionName"), String::NewFromUtf8(isolate, err.funcname)); - error->Set(String::NewFromUtf8(isolate, "lineNumber"), Integer::New(isolate, err.lineno)); - error->Set(String::NewFromUtf8(isolate, "cursorPosition"), Integer::New(isolate, err.cursorpos)); - - if (err.context) { - error->Set(String::NewFromUtf8(isolate, "context"), String::NewFromUtf8(isolate, err.context)); - } - else { - error->Set(String::NewFromUtf8(isolate, "context"), Null(isolate)); - } - - return handleScope.Escape(error); -} - -Local QueryParseResponse(Isolate* isolate, const PgQueryParseResult& result) -{ - v8::EscapableHandleScope handleScope(isolate); - Local obj = Object::New(isolate); - - if (result.error) { - obj->Set( - String::NewFromUtf8(isolate, "error"), - CreateError(isolate, *result.error) - ); - } - - if (result.parse_tree) { - Local parseResult; - bool parseSucceeded = JSON::Parse( - isolate, - String::NewFromUtf8(isolate, result.parse_tree) - ).ToLocal(&parseResult); - - if(parseSucceeded == true) - obj->Set(String::NewFromUtf8(isolate, "query"),parseResult); - } - - if (result.stderr_buffer) { - obj->Set( - String::NewFromUtf8(isolate, "stderr"), - String::NewFromUtf8(isolate, result.stderr_buffer) - ); - } - - pg_query_free_parse_result(result); - return handleScope.Escape(obj); -} - -Local PlPgSQLParseResponse(Isolate* isolate, const PgQueryPlpgsqlParseResult& result) -{ - v8::EscapableHandleScope handleScope(isolate); - Local obj = Object::New(isolate); - - if (result.error) { - obj->Set( - String::NewFromUtf8(isolate, "error"), - CreateError(isolate, *result.error) - ); - } - - if (result.plpgsql_funcs) { - Local parseResult; - bool parseSucceeded = JSON::Parse( - isolate, - String::NewFromUtf8(isolate, result.plpgsql_funcs) - ).ToLocal(&parseResult); - - if(parseSucceeded == true) - obj->Set(String::NewFromUtf8(isolate, "functions"),parseResult); - } - - pg_query_free_plpgsql_parse_result(result); - return handleScope.Escape(obj); -} - -void Method(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - String::Utf8Value query(args[0]->ToString()); - PgQueryParseResult result = pg_query_parse(*query); - args.GetReturnValue().Set(QueryParseResponse(isolate, result)); -} - -void MethodPlPgSQL(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - String::Utf8Value query(args[0]->ToString()); - PgQueryPlpgsqlParseResult result = pg_query_parse_plpgsql(*query); - args.GetReturnValue().Set(PlPgSQLParseResponse(isolate, result)); -} - -struct Work { - uv_work_t request; - Persistent callback; - std::string ss; - PgQueryParseResult result; -}; - -struct WorkPlPgSQL { - uv_work_t request; - Persistent callback; - std::string ss; - PgQueryPlpgsqlParseResult result; -}; - -// called by libuv worker in separate thread -static void WorkAsync(uv_work_t* req) -{ - Work* work = static_cast(req->data); - work->result = pg_query_parse(work->ss.data()); -} - -static void WorkPlPgSQLAsync(uv_work_t* req) -{ - WorkPlPgSQL* work = static_cast(req->data); - work->result = pg_query_parse_plpgsql(work->ss.data()); -} - -// called by libuv in event loop when async function completes -static void WorkAsyncComplete(uv_work_t *req, int status) -{ - Isolate* isolate = Isolate::GetCurrent(); - Work* work = static_cast(req->data); - - // Set up return arguments. - // Rather than calling back to node with an error if the parse failed, - // as would be more correct, we just call back object that may have an - // error property; caller can deal with it. - v8::HandleScope handleScope(isolate); - Handle argv[1] = { - QueryParseResponse(isolate, work->result) - }; - - // execute the callback - // https://stackoverflow.com/questions/13826803/calling-javascript-function-from-a-c-callback-in-v8/28554065#28554065 - Local::New(isolate, work->callback)->Call( - isolate->GetEnteredOrMicrotaskContext()->Global(), - 1, - argv - ); - - // Free up the persistent function callback - work->callback.Reset(); - delete work; -} - -static void WorkPlPgSQLAsyncComplete(uv_work_t *req, int status) -{ - Isolate* isolate = Isolate::GetCurrent(); - WorkPlPgSQL* work = static_cast(req->data); - - // Set up return arguments. - // Rather than calling back to node with an error if the parse failed, - // as would be more correct, we just call back object that may have an - // error property; caller can deal with it. - v8::HandleScope handleScope(isolate); - Handle argv[1] = { - PlPgSQLParseResponse(isolate, work->result) - }; - - // execute the callback - Local::New(isolate, work->callback)->Call( - isolate->GetEnteredOrMicrotaskContext()->Global(), - 1, - argv - ); - - // Free up the persistent function callback - work->callback.Reset(); - delete work; -} - -void MethodAsync(const v8::FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - v8::EscapableHandleScope handleScope(isolate); - - // Set up the work object on the heap so that we can do our calculations - // in WorkAsync, and put our callback there too for use in WorkAsynComplete. - Work* work = new Work(); - work->request.data = work; - - String::Utf8Value query(args[0]->ToString()); - work->ss.assign(*query); - - // TODO: should check that this is actually a function. - Local callback = Local::Cast(args[1]); - work->callback.Reset(isolate, callback); - - // kick of the worker thread - uv_queue_work(uv_default_loop(),&work->request,WorkAsync,WorkAsyncComplete); - - args.GetReturnValue().Set(handleScope.Escape(Undefined(isolate))); -} - -void MethodPlPgSQLAsync(const v8::FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - - WorkPlPgSQL* work = new WorkPlPgSQL(); - work->request.data = work; - - String::Utf8Value query(args[0]->ToString()); - work->ss.assign(*query); - - // store the callback from JS in the work package so we can invoke it later - // TODO: should check that this is actually a function. - Local callback = Local::Cast(args[1]); - work->callback.Reset(isolate, callback); - - // kick of the worker thread - uv_queue_work(uv_default_loop(),&work->request,WorkPlPgSQLAsync,WorkPlPgSQLAsyncComplete); - - args.GetReturnValue().Set(Undefined(isolate)); -} - - -void init(Handle exports, Handle module) { - NODE_SET_METHOD(exports, "parseQuery", Method); - NODE_SET_METHOD(exports, "parseQueryAsync", MethodAsync); - NODE_SET_METHOD(exports, "parsePlPgSQL", MethodPlPgSQL); - NODE_SET_METHOD(exports, "parsePlPgSQLAsync", MethodPlPgSQLAsync); -} - -NODE_MODULE(addon, init) diff --git a/script/buildAddon.sh b/script/buildAddon.sh index ea2136c..de941c6 100755 --- a/script/buildAddon.sh +++ b/script/buildAddon.sh @@ -53,6 +53,7 @@ elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then fi cp $(pwd)/pg_query.h $rDIR/libpg_query/include/ +cp $(pwd)/protobuf/*.proto $rDIR/libpg_query/protobuf/ cd "$rDIR" rm -rf "$tmpDir" diff --git a/src/addon.cc b/src/addon.cc index 9fa735e..7c72c8a 100644 --- a/src/addon.cc +++ b/src/addon.cc @@ -14,6 +14,16 @@ Napi::Object Init(Napi::Env env, Napi::Object exports) { Napi::Function::New(env, ParseQueryAsync) ); + exports.Set( + Napi::String::New(env, "deparseSync"), + Napi::Function::New(env, DeparseSync) + ); + + exports.Set( + Napi::String::New(env, "deparseAsync"), + Napi::Function::New(env, DeparseAsync) + ); + exports.Set( Napi::String::New(env, "parsePlPgSQLSync"), Napi::Function::New(env, ParsePlPgSQLSync) diff --git a/src/async.cc b/src/async.cc index f7d2ed8..5436233 100644 --- a/src/async.cc +++ b/src/async.cc @@ -34,6 +34,37 @@ class QueryWorker : public Napi::AsyncWorker { PgQueryParseResult result; }; +class DeparseWorker : public Napi::AsyncWorker { + public: + DeparseWorker(Napi::Function& callback, PgQueryProtobuf parseTree) + : Napi::AsyncWorker(callback), parseTree(parseTree) {} + ~DeparseWorker() {} + + // Executed inside the worker-thread. + // It is not safe to access JS engine data structure + // here, so everything we need for input and output + // should go on `this`. + void Execute () { + result = pg_query_deparse_protobuf(parseTree); + } + + // Executed when the async work is complete + // this function will be run inside the main event loop + // so it is safe to use JS engine data again + void OnOK() { + Napi::HandleScope scope(Env()); + try { + Callback().Call({Env().Undefined(), DeparseResult(Env(), result) }); + } catch (const Napi::Error& e) { + Callback().Call({ e.Value(), Env().Undefined() }); + } + } + + private: + PgQueryProtobuf parseTree; + PgQueryDeparseResult result; +}; + class PgPlQSLWorker : public Napi::AsyncWorker { public: PgPlQSLWorker(Napi::Function& callback, const std::string& query) @@ -105,6 +136,22 @@ Napi::Value ParseQueryAsync(const Napi::CallbackInfo& info) { return info.Env().Undefined(); } +Napi::Value DeparseAsync(const Napi::CallbackInfo& info) { + if (info.Length() < 2 || !info[0].IsBuffer() || !info[1].IsFunction()) { + Napi::TypeError::New(info.Env(), "Invalid arguments").ThrowAsJavaScriptException(); + return info.Env().Undefined(); + } + Napi::Buffer data = info[0].As>(); + Napi::Function callback = info[1].As(); + PgQueryProtobuf parseTree = { + static_cast(data.Length()), + data.Data() + }; + DeparseWorker* worker = new DeparseWorker(callback, parseTree); + worker->Queue(); + return info.Env().Undefined(); +} + Napi::Value ParsePlPgSQLAsync(const Napi::CallbackInfo& info) { std::string query = info[0].As(); Napi::Function callback = info[1].As(); diff --git a/src/async.h b/src/async.h index 6ba19ce..b6f96b6 100644 --- a/src/async.h +++ b/src/async.h @@ -1,5 +1,6 @@ #include Napi::Value ParseQueryAsync(const Napi::CallbackInfo& info); +Napi::Value DeparseAsync(const Napi::CallbackInfo& info); Napi::Value ParsePlPgSQLAsync(const Napi::CallbackInfo& info); Napi::Value FingerprintAsync(const Napi::CallbackInfo& info); diff --git a/src/helpers.cc b/src/helpers.cc index 93fa7bd..e5d5968 100644 --- a/src/helpers.cc +++ b/src/helpers.cc @@ -27,6 +27,19 @@ Napi::String QueryParseResult(Napi::Env env, const PgQueryParseResult& result) return returnVal; } +Napi::String DeparseResult(Napi::Env env, const PgQueryDeparseResult& result) +{ + if (result.error) { + auto throwVal = CreateError(env, *result.error); + pg_query_free_deparse_result(result); + throw throwVal; + } + + auto returnVal = Napi::String::New(env, result.query); + pg_query_free_deparse_result(result); + return returnVal; +} + Napi::String PlPgSQLParseResult(Napi::Env env, const PgQueryPlpgsqlParseResult& result) { if (result.error) { diff --git a/src/helpers.h b/src/helpers.h index 189fe17..dffb681 100644 --- a/src/helpers.h +++ b/src/helpers.h @@ -3,5 +3,6 @@ Napi::Error CreateError(Napi::Env env, const PgQueryError& err); Napi::String QueryParseResult(Napi::Env env, const PgQueryParseResult& result); +Napi::String DeparseResult(Napi::Env env, const PgQueryDeparseResult& result); Napi::String PlPgSQLParseResult(Napi::Env env, const PgQueryPlpgsqlParseResult& result); Napi::String FingerprintResult(Napi::Env env, const PgQueryFingerprintResult & result); diff --git a/src/sync.cc b/src/sync.cc index 09964da..b440391 100644 --- a/src/sync.cc +++ b/src/sync.cc @@ -10,6 +10,17 @@ Napi::String ParseQuerySync(const Napi::CallbackInfo& info) { return QueryParseResult(info.Env(), result); } +Napi::String DeparseSync(const Napi::CallbackInfo& info) { + Napi::Buffer data = info[0].As>(); + PgQueryProtobuf parseTree = { + static_cast(data.Length()), + data.Data() + }; + PgQueryDeparseResult result = pg_query_deparse_protobuf(parseTree); + + return DeparseResult(info.Env(), result); +} + Napi::String ParsePlPgSQLSync(const Napi::CallbackInfo& info) { std::string query = info[0].As(); PgQueryPlpgsqlParseResult result = pg_query_parse_plpgsql(query.c_str()); diff --git a/src/sync.h b/src/sync.h index 56746ab..002a9e8 100644 --- a/src/sync.h +++ b/src/sync.h @@ -1,5 +1,6 @@ #include Napi::String ParseQuerySync(const Napi::CallbackInfo& info); +Napi::String DeparseSync(const Napi::CallbackInfo& info); Napi::String ParsePlPgSQLSync(const Napi::CallbackInfo& info); Napi::String FingerprintSync(const Napi::CallbackInfo& info); diff --git a/test/index.js b/test/index.js index 39fc2ca..4227157 100644 --- a/test/index.js +++ b/test/index.js @@ -73,6 +73,34 @@ describe("Queries", () => { }); }); + describe("Deparsing", () => { + it("async function should return a promise resolving to same SQL", async () => { + const testQuery = "select * from john;"; + const parsed = query.parseQuerySync(testQuery); + const deparsed = await query.deparse(parsed); + expect(deparsed).to.eq(`SELECT * FROM john`) + }); + + it("sync function should return a same SQL", async () => { + const testQuery = "select * from john;"; + const parsed = query.parseQuerySync(testQuery); + const deparsed = query.deparseSync(parsed); + expect(deparsed).to.eq(`SELECT * FROM john`) + }); + + it("should reject on bogus input", async () => { + return query.deparse({stmts: [{}]}).then( + () => { + throw new Error(`should have rejected`); + }, + (e) => { + expect(e).instanceof(Error); + expect(e.message).to.match(/deparse error/); + } + ); + }); + }); + describe("Fingerprint", () => { context("sync", () => { it("should not fingerprint a bogus query", () => { diff --git a/yarn.lock b/yarn.lock index fa32d7b..f4cfc6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,11 @@ # yarn lockfile v1 +"@babel/parser@^7.9.4": + version "7.21.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.3.tgz#1d285d67a19162ff9daa358d4cb41d50c06220b3" + integrity sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ== + "@mapbox/node-pre-gyp@^1.0.8": version "1.0.8" resolved "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.8.tgz" @@ -25,16 +30,102 @@ mkdirp "^1.0.4" rimraf "^3.0.2" +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz" integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== +"@types/linkify-it@*": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@types/linkify-it/-/linkify-it-3.0.2.tgz#fd2cd2edbaa7eaac7e7f3c1748b52a19143846c9" + integrity sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA== + +"@types/markdown-it@^12.2.3": + version "12.2.3" + resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-12.2.3.tgz#0d6f6e5e413f8daaa26522904597be3d6cd93b51" + integrity sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ== + dependencies: + "@types/linkify-it" "*" + "@types/mdurl" "*" + +"@types/mdurl@*": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@types/mdurl/-/mdurl-1.0.2.tgz#e2ce9d83a613bacf284c7be7d491945e39e1f8e9" + integrity sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA== + +"@types/node@>=13.7.0": + version "18.15.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.9.tgz#a9b529d2a16ae73122b3875969e7db18c9f3e790" + integrity sha512-dUxhiNzBLr6IqlZXz6e/rN2YQXlFgOei/Dxy+e3cyXTJ4txSUbGT2/fmnD6zd/75jDMeW5bDee+YXxlFKHoV0A== + abbrev@1: version "1.1.1" resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn@^8.8.0: + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + agent-base@6: version "6.0.2" resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz" @@ -69,6 +160,13 @@ ansi-regex@^5.0.1: resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + aproba@^1.0.3: version "1.2.0" resolved "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz" @@ -95,6 +193,11 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.6" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + assertion-error@^1.0.1: version "1.1.0" resolved "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz" @@ -105,6 +208,11 @@ balanced-match@^1.0.0: resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= +bluebird@^3.7.2: + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" @@ -113,6 +221,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz" @@ -141,6 +256,13 @@ cacache@^15.0.5: tar "^6.0.2" unique-filename "^1.1.1" +catharsis@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/catharsis/-/catharsis-0.9.0.tgz#40382a168be0e6da308c277d3a2b3eb40c7d2121" + integrity sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A== + dependencies: + lodash "^4.17.15" + chai@^3.5.0: version "3.5.0" resolved "https://registry.npmjs.org/chai/-/chai-3.5.0.tgz" @@ -150,6 +272,14 @@ chai@^3.5.0: deep-eql "^0.1.3" type-detect "^1.0.0" +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chownr@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz" @@ -165,6 +295,18 @@ code-point-at@^1.0.0: resolved "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + color-support@^1.1.2: version "1.1.3" resolved "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz" @@ -211,6 +353,11 @@ deep-eql@^0.1.3: dependencies: type-detect "0.1.1" +deep-is@~0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + delegates@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" @@ -243,6 +390,11 @@ encoding@^0.1.12: dependencies: iconv-lite "^0.6.2" +entities@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" + integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== + env-paths@^2.2.0: version "2.2.1" resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz" @@ -258,6 +410,62 @@ escape-string-regexp@1.0.5: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +escape-string-regexp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" + integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== + +escodegen@^1.13.0: + version "1.14.3" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.14.3.tgz#4e7b81fba61581dc97582ed78cab7f0e8d63f503" + integrity sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw== + dependencies: + esprima "^4.0.1" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + +espree@^9.0.0: + version "9.5.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.0.tgz#3646d4e3f58907464edba852fa047e6a27bdf113" + integrity sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw== + dependencies: + acorn "^8.8.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.3.0" + +esprima@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +estraverse@^4.2.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +fast-levenshtein@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + fs-minipass@^2.0.0: version "2.1.0" resolved "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz" @@ -323,6 +531,22 @@ glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" +glob@^8.0.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + +graceful-fs@^4.1.9: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + graceful-fs@^4.2.6: version "4.2.6" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz" @@ -338,6 +562,11 @@ has-flag@^3.0.0: resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz" @@ -444,11 +673,66 @@ isexe@^2.0.0: resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= -lodash@^4.17.15: +js2xmlparser@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/js2xmlparser/-/js2xmlparser-4.0.2.tgz#2a1fdf01e90585ef2ae872a01bc169c6a8d5e60a" + integrity sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA== + dependencies: + xmlcreate "^2.0.4" + +jsdoc@^3.6.3: + version "3.6.11" + resolved "https://registry.yarnpkg.com/jsdoc/-/jsdoc-3.6.11.tgz#8bbb5747e6f579f141a5238cbad4e95e004458ce" + integrity sha512-8UCU0TYeIYD9KeLzEcAu2q8N/mx9O3phAGl32nmHlE0LpaJL71mMkP4d+QE5zWfNt50qheHtOZ0qoxVrsX5TUg== + dependencies: + "@babel/parser" "^7.9.4" + "@types/markdown-it" "^12.2.3" + bluebird "^3.7.2" + catharsis "^0.9.0" + escape-string-regexp "^2.0.0" + js2xmlparser "^4.0.2" + klaw "^3.0.0" + markdown-it "^12.3.2" + markdown-it-anchor "^8.4.1" + marked "^4.0.10" + mkdirp "^1.0.4" + requizzle "^0.2.3" + strip-json-comments "^3.1.0" + taffydb "2.6.2" + underscore "~1.13.2" + +klaw@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-3.0.0.tgz#b11bec9cf2492f06756d6e809ab73a2910259146" + integrity sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g== + dependencies: + graceful-fs "^4.1.9" + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +linkify-it@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" + integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== + dependencies: + uc.micro "^1.0.1" + +lodash@^4.17.15, lodash@^4.17.21: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +long@^5.0.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/long/-/long-5.2.1.tgz#e27595d0083d103d2fa2c20c7699f8e0c92b897f" + integrity sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A== + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" @@ -484,6 +768,32 @@ make-fetch-happen@^8.0.14: socks-proxy-agent "^5.0.0" ssri "^8.0.0" +markdown-it-anchor@^8.4.1: + version "8.6.7" + resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-8.6.7.tgz#ee6926daf3ad1ed5e4e3968b1740eef1c6399634" + integrity sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA== + +markdown-it@^12.3.2: + version "12.3.2" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" + integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== + dependencies: + argparse "^2.0.1" + entities "~2.1.0" + linkify-it "^3.0.1" + mdurl "^1.0.1" + uc.micro "^1.0.5" + +marked@^4.0.10: + version "4.3.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" + integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== + +mdurl@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" + integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== + minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz" @@ -491,11 +801,23 @@ minimatch@3.0.4, minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" +minimatch@^5.0.1: + version "5.1.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + minimist@0.0.8: version "0.0.8" resolved "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= +minimist@^1.2.0: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + minipass-collect@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz" @@ -661,6 +983,18 @@ once@^1.3.0: dependencies: wrappy "1" +optionator@^0.8.1: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + p-map@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz" @@ -673,6 +1007,11 @@ path-is-absolute@^1.0.0: resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" @@ -691,6 +1030,38 @@ promise-retry@^2.0.1: err-code "^2.0.2" retry "^0.12.0" +"protobufjs-cli@https://gitpkg.now.sh/michaelbgreen/protobuf.js/cli?6254efb1bd9263978e9a90da3b05c4ccbcd6564a": + version "1.0.2" + resolved "https://gitpkg.now.sh/michaelbgreen/protobuf.js/cli?6254efb1bd9263978e9a90da3b05c4ccbcd6564a#6d82c95c0ae2ee7aed13313f239472fb350e5a81" + dependencies: + chalk "^4.0.0" + escodegen "^1.13.0" + espree "^9.0.0" + estraverse "^5.1.0" + glob "^8.0.0" + jsdoc "^3.6.3" + minimist "^1.2.0" + semver "^7.1.2" + tmp "^0.2.1" + uglify-js "^3.7.7" + +"protobufjs@git+https://github.com/michaelbgreen/protobuf.js.git#c0b68ac5c8fbb1ded261c0924bbce0538370333e": + version "7.1.3" + resolved "git+https://github.com/michaelbgreen/protobuf.js.git#c0b68ac5c8fbb1ded261c0924bbce0538370333e" + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/node" ">=13.7.0" + long "^5.0.0" + readable-stream@^2.0.6: version "2.3.7" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" @@ -713,12 +1084,19 @@ readable-stream@^3.6.0: string_decoder "^1.1.1" util-deprecate "^1.0.1" +requizzle@^0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/requizzle/-/requizzle-0.2.4.tgz#319eb658b28c370f0c20f968fa8ceab98c13d27c" + integrity sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw== + dependencies: + lodash "^4.17.21" + retry@^0.12.0: version "0.12.0" resolved "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz" integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs= -rimraf@^3.0.2: +rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== @@ -745,6 +1123,13 @@ semver@^6.0.0: resolved "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.1.2: + version "7.3.8" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== + dependencies: + lru-cache "^6.0.0" + semver@^7.3.5: version "7.3.5" resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz" @@ -784,6 +1169,11 @@ socks@^2.3.3: ip "^1.1.5" smart-buffer "^4.1.0" +source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + ssri@^8.0.0, ssri@^8.0.1: version "8.0.1" resolved "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz" @@ -837,6 +1227,11 @@ strip-ansi@^6.0.1: dependencies: ansi-regex "^5.0.1" +strip-json-comments@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + supports-color@5.4.0: version "5.4.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz" @@ -844,6 +1239,18 @@ supports-color@5.4.0: dependencies: has-flag "^3.0.0" +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +taffydb@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/taffydb/-/taffydb-2.6.2.tgz#7cbcb64b5a141b6a2efc2c5d2c67b4e150b2a268" + integrity sha512-y3JaeRSplks6NYQuCOj3ZFMO3j60rTwbuKCvZxsAraGYH2epusatvZ0baZYA01WsGqJBq/Dl6vOrMUJqyMj8kA== + tar@^6.0.2, tar@^6.1.0, tar@^6.1.11: version "6.1.11" resolved "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz" @@ -856,11 +1263,25 @@ tar@^6.0.2, tar@^6.1.0, tar@^6.1.11: mkdirp "^1.0.3" yallist "^4.0.0" +tmp@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" + integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== + dependencies: + rimraf "^3.0.0" + tr46@~0.0.3: version "0.0.3" resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== + dependencies: + prelude-ls "~1.1.2" + type-detect@0.1.1: version "0.1.1" resolved "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz" @@ -871,6 +1292,21 @@ type-detect@^1.0.0: resolved "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz" integrity sha1-diIXzAbbJY7EiQihKY6LlRIejqI= +uc.micro@^1.0.1, uc.micro@^1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" + integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== + +uglify-js@^3.7.7: + version "3.17.4" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" + integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g== + +underscore@~1.13.2: + version "1.13.6" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.6.tgz#04786a1f589dc6c09f761fc5f45b89e935136441" + integrity sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A== + unique-filename@^1.1.1: version "1.1.1" resolved "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz" @@ -917,11 +1353,21 @@ wide-align@^1.1.0, wide-align@^1.1.2: dependencies: string-width "^1.0.2 || 2 || 3 || 4" +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + wrappy@1: version "1.0.2" resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= +xmlcreate@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-2.0.4.tgz#0c5ab0f99cdd02a81065fa9cd8f8ae87624889be" + integrity sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg== + yallist@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz"