{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CursorReqBody = exports.PipelineReqBody = void 0;\nconst protobuf_encode_js_1 = require(\"../shared/protobuf_encode.js\");\nconst util_js_1 = require(\"../util.js\");\nfunction PipelineReqBody(w, msg) {\n if (msg.baton !== undefined) {\n w.string(1, msg.baton);\n }\n for (const req of msg.requests) {\n w.message(2, req, StreamRequest);\n }\n}\nexports.PipelineReqBody = PipelineReqBody;\nfunction StreamRequest(w, msg) {\n if (msg.type === \"close\") {\n w.message(1, msg, CloseStreamReq);\n } else if (msg.type === \"execute\") {\n w.message(2, msg, ExecuteStreamReq);\n } else if (msg.type === \"batch\") {\n w.message(3, msg, BatchStreamReq);\n } else if (msg.type === \"sequence\") {\n w.message(4, msg, SequenceStreamReq);\n } else if (msg.type === \"describe\") {\n w.message(5, msg, DescribeStreamReq);\n } else if (msg.type === \"store_sql\") {\n w.message(6, msg, StoreSqlStreamReq);\n } else if (msg.type === \"close_sql\") {\n w.message(7, msg, CloseSqlStreamReq);\n } else if (msg.type === \"get_autocommit\") {\n w.message(8, msg, GetAutocommitStreamReq);\n } else {\n throw (0, util_js_1.impossible)(msg, \"Impossible type of StreamRequest\");\n }\n}\nfunction CloseStreamReq(_w, _msg) {}\nfunction ExecuteStreamReq(w, msg) {\n w.message(1, msg.stmt, protobuf_encode_js_1.Stmt);\n}\nfunction BatchStreamReq(w, msg) {\n w.message(1, msg.batch, protobuf_encode_js_1.Batch);\n}\nfunction SequenceStreamReq(w, msg) {\n if (msg.sql !== undefined) {\n w.string(1, msg.sql);\n }\n if (msg.sqlId !== undefined) {\n w.int32(2, msg.sqlId);\n }\n}\nfunction DescribeStreamReq(w, msg) {\n if (msg.sql !== undefined) {\n w.string(1, msg.sql);\n }\n if (msg.sqlId !== undefined) {\n w.int32(2, msg.sqlId);\n }\n}\nfunction StoreSqlStreamReq(w, msg) {\n w.int32(1, msg.sqlId);\n w.string(2, msg.sql);\n}\nfunction CloseSqlStreamReq(w, msg) {\n w.int32(1, msg.sqlId);\n}\nfunction GetAutocommitStreamReq(_w, _msg) {}\nfunction CursorReqBody(w, msg) {\n if (msg.baton !== undefined) {\n w.string(1, msg.baton);\n }\n w.message(2, msg.batch, protobuf_encode_js_1.Batch);\n}\nexports.CursorReqBody = CursorReqBody;","map":{"version":3,"names":["Object","defineProperty","exports","value","CursorReqBody","PipelineReqBody","protobuf_encode_js_1","require","util_js_1","w","msg","baton","undefined","string","req","requests","message","StreamRequest","type","CloseStreamReq","ExecuteStreamReq","BatchStreamReq","SequenceStreamReq","DescribeStreamReq","StoreSqlStreamReq","CloseSqlStreamReq","GetAutocommitStreamReq","impossible","_w","_msg","stmt","Stmt","batch","Batch","sql","sqlId","int32"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@libsql/hrana-client/lib-cjs/http/protobuf_encode.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CursorReqBody = exports.PipelineReqBody = void 0;\nconst protobuf_encode_js_1 = require(\"../shared/protobuf_encode.js\");\nconst util_js_1 = require(\"../util.js\");\nfunction PipelineReqBody(w, msg) {\n if (msg.baton !== undefined) {\n w.string(1, msg.baton);\n }\n for (const req of msg.requests) {\n w.message(2, req, StreamRequest);\n }\n}\nexports.PipelineReqBody = PipelineReqBody;\nfunction StreamRequest(w, msg) {\n if (msg.type === \"close\") {\n w.message(1, msg, CloseStreamReq);\n }\n else if (msg.type === \"execute\") {\n w.message(2, msg, ExecuteStreamReq);\n }\n else if (msg.type === \"batch\") {\n w.message(3, msg, BatchStreamReq);\n }\n else if (msg.type === \"sequence\") {\n w.message(4, msg, SequenceStreamReq);\n }\n else if (msg.type === \"describe\") {\n w.message(5, msg, DescribeStreamReq);\n }\n else if (msg.type === \"store_sql\") {\n w.message(6, msg, StoreSqlStreamReq);\n }\n else if (msg.type === \"close_sql\") {\n w.message(7, msg, CloseSqlStreamReq);\n }\n else if (msg.type === \"get_autocommit\") {\n w.message(8, msg, GetAutocommitStreamReq);\n }\n else {\n throw (0, util_js_1.impossible)(msg, \"Impossible type of StreamRequest\");\n }\n}\nfunction CloseStreamReq(_w, _msg) {\n}\nfunction ExecuteStreamReq(w, msg) {\n w.message(1, msg.stmt, protobuf_encode_js_1.Stmt);\n}\nfunction BatchStreamReq(w, msg) {\n w.message(1, msg.batch, protobuf_encode_js_1.Batch);\n}\nfunction SequenceStreamReq(w, msg) {\n if (msg.sql !== undefined) {\n w.string(1, msg.sql);\n }\n if (msg.sqlId !== undefined) {\n w.int32(2, msg.sqlId);\n }\n}\nfunction DescribeStreamReq(w, msg) {\n if (msg.sql !== undefined) {\n w.string(1, msg.sql);\n }\n if (msg.sqlId !== undefined) {\n w.int32(2, msg.sqlId);\n }\n}\nfunction StoreSqlStreamReq(w, msg) {\n w.int32(1, msg.sqlId);\n w.string(2, msg.sql);\n}\nfunction CloseSqlStreamReq(w, msg) {\n w.int32(1, msg.sqlId);\n}\nfunction GetAutocommitStreamReq(_w, _msg) {\n}\nfunction CursorReqBody(w, msg) {\n if (msg.baton !== undefined) {\n w.string(1, msg.baton);\n }\n w.message(2, msg.batch, protobuf_encode_js_1.Batch);\n}\nexports.CursorReqBody = CursorReqBody;\n"],"mappings":"AAAA,YAAY;;AACZA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7DD,OAAO,CAACE,aAAa,GAAGF,OAAO,CAACG,eAAe,GAAG,KAAK,CAAC;AACxD,MAAMC,oBAAoB,GAAGC,OAAO,CAAC,8BAA8B,CAAC;AACpE,MAAMC,SAAS,GAAGD,OAAO,CAAC,YAAY,CAAC;AACvC,SAASF,eAAeA,CAACI,CAAC,EAAEC,GAAG,EAAE;EAC7B,IAAIA,GAAG,CAACC,KAAK,KAAKC,SAAS,EAAE;IACzBH,CAAC,CAACI,MAAM,CAAC,CAAC,EAAEH,GAAG,CAACC,KAAK,CAAC;EAC1B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