the-forest/client/node_modules/.cache/babel-loader/23ffeb3b974c3ee425897b57831c463405d37f2c5deb0f27e5818d03f5085dd2.json

1 line
8.4 KiB
JSON
Raw Normal View History

2024-09-17 20:35:18 -04:00
{"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, Cl