1 line
7.4 KiB
JSON
1 line
7.4 KiB
JSON
{"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.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}\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}\n"],"mappings":"AAAA,SAASA,IAAI,EAAEC,KAAK,QAAQ,8BAA8B;AAC1D,SAASC,UAAU,QAAQ,YAAY;AACvC,OAAO,SAASC,eAAeA,CAACC,CAAC,EAAEC,GAAG,EAAE;EACpC,IAAIA,GAAG,CAACC,KAAK,KAAKC,SAAS,EAAE;IACzBH,CAAC,CAACI,MAAM,CAAC,CAAC,EAAEH,GAAG,CAACC,KAAK,CAAC;EAC1B;EACA,KAAK,MAAMG,GAAG,IAAIJ,GAAG,CAACK,QAAQ,EAAE;IAC5BN,CAAC,CAACO,OAAO,CAAC,CAAC,EAAEF,GAAG,EAAEG,aAAa,CAAC;EACpC;AACJ;AACA,SAASA,aAAaA,CAACR,CAAC,EAAEC,GAAG,EAAE;EAC3B,IAAIA,GAAG,CAACQ,IAAI,KAAK,OAAO,EAAE;IACtBT,CAAC,CAACO,OAAO,CAAC,CAAC,EAAEN,GAAG,EAAES,cAAc,CAAC;EACrC,CAAC,MACI,IAAIT,GAAG,CAACQ,IAAI,KAAK,SAAS,EAAE;IAC7BT,CAAC,CAACO,OAAO,CAAC,CAAC,EAAEN,GAAG,EAAEU,gBAAgB,CAAC;EACvC,CAAC,MACI,IAAIV,GAAG,CAACQ,IAAI,KAAK,OAAO,EAAE;IAC3BT,CAAC,CAACO,OAAO,CAAC,CAAC,EAAEN,GAAG,EAAEW,cAAc,CAAC;EACrC,CAAC,MACI,IAA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