1 | {"version":3,"file":"metadata-parser.js","names":["_collation","require","_dataType","_sprintfJs","_helpers","readCollation","buf","offset","length","NotEnoughDataError","collation","Collation","fromBuffer","slice","Result","readSchema","schemaPresent","value","readUInt8","undefined","dbname","readBVarChar","owningSchema","xmlSchemaCollection","readUsVarChar","readUDTInfo","maxByteSize","readUInt16LE","typeName","assemblyName","readMetadata","options","userType","tdsVersion","readUInt32LE","flags","typeNumber","type","TYPE","Error","sprintf","name","precision","scale","dataLength","schema","udtInfo","metadataParse","parser","callback","result","buffer","position","err","waitForChunk","_default","exports","default","module"],"sources":["../src/metadata-parser.ts"],"sourcesContent":["import { Collation } from './collation';\nimport Parser, { type ParserOptions } from './token/stream-parser';\nimport { TYPE, type DataType } from './data-type';\nimport { type CryptoMetadata } from './always-encrypted/types';\n\nimport { sprintf } from 'sprintf-js';\n\nimport { Result, NotEnoughDataError, readUInt8, readBVarChar, readUsVarChar, readUInt16LE, readUInt32LE } from './token/helpers';\n\ninterface XmlSchema {\n dbname: string;\n owningSchema: string;\n xmlSchemaCollection: string;\n}\n\ninterface UdtInfo {\n maxByteSize: number;\n dbname: string;\n owningSchema: string;\n typeName: string;\n assemblyName: string;\n}\n\nexport type BaseMetadata = {\n userType: number;\n\n flags: number;\n /**\n * The column's type, such as VarChar, Int or Binary.\n */\n type: DataType;\n\n collation: Collation | undefined;\n /**\n * The precision. Only applicable to numeric and decimal.\n */\n precision: number | undefined;\n\n /**\n * The scale. Only applicable to numeric, decimal, time, datetime2 and datetimeoffset.\n */\n scale: number | undefined;\n\n /**\n * The length, for char, varchar, nvarchar and varbinary.\n */\n dataLength: number | undefined;\n\n schema: XmlSchema | undefined;\n\n udtInfo: UdtInfo | undefined;\n}\n\nexport type Metadata = {\n cryptoMetadata?: CryptoMetadata;\n} & BaseMetadata;\n\nfunction readCollation(buf: Buffer, offset: number): Result<Collation> {\n offset = +offset;\n\n if (buf.length < offset + 5) {\n throw new NotEnoughDataError(offset + 5);\n }\n\n const collation = Collation.fromBuffer(buf.slice(offset, offset + 5));\n return new Result(collation, offset + 5);\n}\n\nfunction readSchema(buf: Buffer, offset: number): Result<XmlSchema | undefined> {\n offset = +offset;\n\n let schemaPresent;\n ({ offset, value: schemaPresent } = readUInt8(buf, offset));\n\n if (schemaPresent !== 0x01) {\n return new Result(undefined, offset);\n }\n\n let dbname;\n ({ offset, value: dbname } = readBVarChar(buf, offset));\n\n let owningSchema;\n ({ offset, value: owningSchema } = readBVarChar(buf, offset));\n\n let xmlSchemaCollection;\n ({ offset, value: xmlSchemaCollection } = readUsVarChar(buf, offset));\n\n return new Result({ dbname, owningSchema, xmlSchemaCollection }, offset);\n}\n\nfunction readUDTInfo(buf: Buffer, offset: number): Result<UdtInfo> {\n let maxByteSize;\n ({ offset, value: maxByteSize } = readUInt16LE(buf, offset));\n\n let dbname;\n ({ offset, value: dbname } = readBVarChar(buf, offset));\n\n let owningSchema;\n ({ offset, value: owningSchema } = readBVarChar(buf, offset));\n\n let typeName;\n ({ offset, value: typeName } = readBVarChar(buf, offset));\n\n let assemblyName;\n ({ offset, value: assemblyName } = readUsVarChar(buf, offset));\n\n return new Result({\n maxByteSize: maxByteSize,\n dbname: dbname,\n owningSchema: owningSchema,\n typeName: typeName,\n assemblyName: assemblyName\n }, offset);\n}\n\nfunction readMetadata(buf: Buffer, offset: number, options: ParserOptions): Result<Metadata> {\n let userType;\n ({ offset, value: userType } = (options.tdsVersion < '7_2' ? readUInt16LE : readUInt32LE)(buf, offset));\n\n let flags;\n ({ offset, value: flags } = readUInt16LE(buf, offset));\n\n let typeNumber;\n ({ offset, value: typeNumber } = readUInt8(buf, offset));\n\n const type: DataType = TYPE[typeNumber];\n if (!type) {\n throw new Error(sprintf('Unrecognised data type 0x%02X', typeNumber));\n }\n\n switch (type.name) {\n case 'Null':\n case 'TinyInt':\n case 'SmallInt':\n case 'Int':\n case 'BigInt':\n case 'Real':\n case 'Float':\n case 'SmallMoney':\n case 'Money':\n case 'Bit':\n case 'SmallDateTime':\n case 'DateTime':\n case 'Date':\n return new Result({\n userType: userType,\n flags: flags,\n type: type,\n collation: undefined,\n precision: undefined,\n scale: undefined,\n dataLength: undefined,\n schema: undefined,\n udtInfo: undefined\n }, offset);\n\n case 'IntN':\n case 'FloatN':\n case 'MoneyN':\n case 'BitN':\n case 'UniqueIdentifier':\n case 'DateTimeN': {\n let dataLength;\n ({ offset, value: dataLength } = readUInt8(buf, offset));\n\n return new Result({\n userType: userType,\n flags: flags,\n type: type,\n collation: undefined,\n precision: undefined,\n scale: undefined,\n dataLength: dataLength,\n schema: undefined,\n udtInfo: undefined\n }, offset);\n }\n\n case 'Variant': {\n let dataLength;\n ({ offset, value: dataLength } = readUInt32LE(buf, offset));\n\n return new Result({\n userType: userType,\n flags: flags,\n type: type,\n collation: undefined,\n precision: undefined,\n scale: undefined,\n dataLength: dataLength,\n schema: undefined,\n udtInfo: undefined\n }, offset);\n }\n\n case 'VarChar':\n case 'Char':\n case 'NVarChar':\n case 'NChar': {\n let dataLength;\n ({ offset, value: dataLength } = readUInt16LE(buf, offset));\n\n let collation;\n ({ offset, value: collation } = readCollation(buf, offset));\n\n return new Result({\n userType: userType,\n flags: flags,\n type: type,\n collation: collation,\n precision: undefined,\n scale: undefined,\n dataLength: dataLength,\n schema: undefined,\n udtInfo: undefined\n }, offset);\n }\n\n case 'Text':\n case 'NText': {\n let dataLength;\n ({ offset, value: dataLength } = readUInt32LE(buf, offset));\n\n let collation;\n ({ offset, value: collation } = readCollation(buf, offset));\n\n return new Result({\n userType: userType,\n flags: flags,\n type: type,\n collation: collation,\n precision: undefined,\n scale: undefined,\n dataLength: dataLength,\n schema: undefined,\n udtInfo: undefined\n }, offset);\n }\n\n case 'VarBinary':\n case 'Binary': {\n let dataLength;\n ({ offset, value: dataLength } = readUInt16LE(buf, offset));\n\n return new Result({\n userType: userType,\n flags: flags,\n type: type,\n collation: undefined,\n precision: undefined,\n scale: undefined,\n dataLength: dataLength,\n schema: undefined,\n udtInfo: undefined\n }, offset);\n }\n\n case 'Image': {\n let dataLength;\n ({ offset, value: dataLength } = readUInt32LE(buf, offset));\n\n return new Result({\n userType: userType,\n flags: flags,\n type: type,\n collation: undefined,\n precision: undefined,\n scale: undefined,\n dataLength: dataLength,\n schema: undefined,\n udtInfo: undefined\n }, offset);\n }\n\n case 'Xml': {\n let schema;\n ({ offset, value: schema } = readSchema(buf, offset));\n\n return new Result({\n userType: userType,\n flags: flags,\n type: type,\n collation: undefined,\n precision: undefined,\n scale: undefined,\n dataLength: undefined,\n schema: schema,\n udtInfo: undefined\n }, offset);\n }\n\n case 'Time':\n case 'DateTime2':\n case 'DateTimeOffset': {\n let scale;\n ({ offset, value: scale } = readUInt8(buf, offset));\n\n return new Result({\n userType: userType,\n flags: flags,\n type: type,\n collation: undefined,\n precision: undefined,\n scale: scale,\n dataLength: undefined,\n schema: undefined,\n udtInfo: undefined\n }, offset);\n }\n\n case 'NumericN':\n case 'DecimalN': {\n let dataLength;\n ({ offset, value: dataLength } = readUInt8(buf, offset));\n\n let precision;\n ({ offset, value: precision } = readUInt8(buf, offset));\n\n let scale;\n ({ offset, value: scale } = readUInt8(buf, offset));\n\n return new Result({\n userType: userType,\n flags: flags,\n type: type,\n collation: undefined,\n precision: precision,\n scale: scale,\n dataLength: dataLength,\n schema: undefined,\n udtInfo: undefined\n }, offset);\n }\n\n case 'UDT': {\n let udtInfo;\n ({ offset, value: udtInfo } = readUDTInfo(buf, offset));\n\n return new Result({\n userType: userType,\n flags: flags,\n type: type,\n collation: undefined,\n precision: undefined,\n scale: undefined,\n dataLength: undefined,\n schema: undefined,\n udtInfo: udtInfo\n }, offset);\n }\n\n default:\n throw new Error(sprintf('Unrecognised type %s', type.name));\n }\n}\n\nfunction metadataParse(parser: Parser, options: ParserOptions, callback: (metadata: Metadata) => void) {\n (async () => {\n while (true) {\n let result;\n try {\n result = readMetadata(parser.buffer, parser.position, options);\n } catch (err: any) {\n if (err instanceof NotEnoughDataError) {\n await parser.waitForChunk();\n continue;\n }\n\n throw err;\n }\n\n parser.position = result.offset;\n return callback(result.value);\n }\n })();\n}\n\nexport default metadataParse;\nexport { readCollation, readMetadata };\n\nmodule.exports = metadataParse;\nmodule.exports.readCollation = readCollation;\nmodule.exports.readMetadata = readMetadata;\n"],"mappings":";;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAGA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AAkDA,SAASI,aAAaA,CAACC,GAAW,EAAEC,MAAc,EAAqB;EACrEA,MAAM,GAAG,CAACA,MAAM;EAEhB,IAAID,GAAG,CAACE,MAAM,GAAGD,MAAM,GAAG,CAAC,EAAE;IAC3B,MAAM,IAAIE,2BAAkB,CAACF,MAAM,GAAG,CAAC,CAAC;EAC1C;EAEA,MAAMG,SAAS,GAAGC,oBAAS,CAACC,UAAU,CAACN,GAAG,CAACO,KAAK,CAACN,MAAM,EAAEA,MAAM,GAAG,CAAC,CAAC,CAAC;EACrE,OAAO,IAAIO,eAAM,CAACJ,SAAS,EAAEH,MAAM,GAAG,CAAC,CAAC;AAC1C;AAEA,SAASQ,UAAUA,CAACT,GAAW,EAAEC,MAAc,EAAiC;EAC9EA,MAAM,GAAG,CAACA,MAAM;EAEhB,IAAIS,aAAa;EACjB,CAAC;IAAET,MAAM;IAAEU,KAAK,EAAED;EAAc,CAAC,GAAG,IAAAE,kBAAS,EAACZ,GAAG,EAAEC,MAAM,CAAC;EAE1D,IAAIS,aAAa,KAAK,IAAI,EAAE;IAC1B,OAAO,IAAIF,eAAM,CAACK,SAAS,EAAEZ,MAAM,CAAC;EACtC;EAEA,IAAIa,MAAM;EACV,CAAC;IAAEb,MAAM;IAAEU,KAAK,EAAEG;EAAO,CAAC,GAAG,IAAAC,qBAAY,EAACf,GAAG,EAAEC,MAAM,CAAC;EAEtD,IAAIe,YAAY;EAChB,CAAC;IAAEf,MAAM;IAAEU,KAAK,EAAEK;EAAa,CAAC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