the-forest/client/node_modules/.cache/babel-loader/1c7cc4c5e9cac1ac74c8faf82f8a7dc75bd00807cb3d675523da28c7730aa493.json

1 line
7.4 KiB
JSON
Raw Normal View History

2024-09-17 20:35:18 -04:00
{"ast":null,"code":"import { Stmt, Batch } from \"../shared/protobuf_encode.js\";\nimport { impossible } from \"../util.js\";\nexport function 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}\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 impossible(msg, \"Impossible type of StreamRequest\");\n }\n}\nfunction CloseStreamReq(_w, _msg) {}\nfunction ExecuteStreamReq(w, msg) {\n w.message(1, msg.stmt, Stmt);\n}\nfunction BatchStreamReq(w, msg) {\n w.message(1, msg.batch, 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) {}\nexport function CursorReqBody(w, msg) {\n if (msg.baton !== undefined) {\n w.string(1, msg.baton);\n }\n w.message(2, msg.batch, Batch);\n}","map":{"version":3,"names":["Stmt","Batch","impossible","PipelineReqBody","w","msg","baton","undefined","string","req","requests","message","StreamRequest","type","CloseStreamReq","ExecuteStreamReq","BatchStreamReq","SequenceStreamReq","DescribeStreamReq","StoreSqlStreamReq","CloseSqlStreamReq","GetAutocommitStreamReq","_w","_msg","stmt","batch","sql","sqlId","int32","CursorReqBody"],"sources":["/Users/shoofle/Projects/the-forest/node_modules/@libsql/hrana-client/lib-esm/http/protobuf_encode.js"],"sourcesContent":["import { Stmt, Batch } from \"../shared/protobuf_encode.js\";\nimport { impossible } from \"../util.js\";\nexport function 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}\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 impossible(msg, \"Impossible type of StreamRequest\");\n }\n}\nfunction CloseStreamReq(_w, _msg) {\n}\nfunction ExecuteStreamReq(w, msg) {\n w.message(1, msg.stmt, Stmt);\n}\nfunction BatchStreamReq(w, msg) {\n w.message(1, msg.batch, 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