{"version":3,"file":"float.cjs","names":["MsSqlColumnBuilderWithIdentity","entityKind","MsSqlColumnWithIdentity"],"sources":["../../../src/mssql-core/columns/float.ts"],"sourcesContent":["import type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnyMsSqlTable } from '~/mssql-core/table.ts';\nimport { getColumnNameAndConfig } from '~/utils.ts';\nimport { MsSqlColumnBuilderWithIdentity, MsSqlColumnWithIdentity } from './common.ts';\n\nexport class MsSqlFloatBuilder extends MsSqlColumnBuilderWithIdentity<{\n\tdataType: 'number double';\n\tdata: number;\n\tdriverParam: number;\n}, MsSqlFloatConfig> {\n\tstatic override readonly [entityKind]: string = 'MsSqlFloatBuilder';\n\n\tconstructor(name: string, config?: MsSqlFloatConfig) {\n\t\tsuper(name, 'number double', 'MsSqlFloat');\n\t\tthis.config.precision = config?.precision;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnyMsSqlTable<{ name: TTableName }>,\n\t) {\n\t\treturn new MsSqlFloat(table, this.config);\n\t}\n}\n\nexport class MsSqlFloat<T extends ColumnBaseConfig<'number double'>>\n\textends MsSqlColumnWithIdentity<T, MsSqlFloatConfig>\n{\n\tstatic override readonly [entityKind]: string = 'MsSqlFloat';\n\n\treadonly precision: number | undefined = this.config.precision;\n\n\tgetSQLType(): string {\n\t\tconst precision = this.precision === undefined ? '' : `(${this.precision})`;\n\t\treturn `float${precision}`;\n\t}\n}\n\nexport interface MsSqlFloatConfig {\n\tprecision?: number;\n}\n\nexport function float(\n\tconfig?: MsSqlFloatConfig,\n): MsSqlFloatBuilder;\nexport function float(\n\tname: string,\n\tconfig?: MsSqlFloatConfig,\n): MsSqlFloatBuilder;\nexport function float(a?: string | MsSqlFloatConfig, b: MsSqlFloatConfig = {}) {\n\tconst { name, config } = getColumnNameAndConfig<MsSqlFloatConfig>(a, b);\n\treturn new MsSqlFloatBuilder(name, config);\n}\n"],"mappings":";;;;;;;AAMA,IAAa,oBAAb,cAAuCA,iEAIlB;CACpB,QAA0BC,0BAAsB;CAEhD,YAAY,MAAc,QAA2B;AACpD,QAAM,MAAM,iBAAiB,aAAa;AAC1C,OAAK,OAAO,YAAY,QAAQ;;;CAIjC,AAAS,MACR,OACC;AACD,SAAO,IAAI,WAAW,OAAO,KAAK,OAAO;;;AAI3C,IAAa,aAAb,cACSC,0DACT;CACC,QAA0BD,0BAAsB;CAEhD,AAAS,YAAgC,KAAK,OAAO;CAErD,aAAqB;AAEpB,SAAO,QADW,KAAK,cAAc,SAAY,KAAK,IAAI,KAAK,UAAU;;;AAgB3E,SAAgB,MAAM,GAA+B,IAAsB,EAAE,EAAE;CAC9E,MAAM,EAAE,MAAM,kDAAoD,GAAG,EAAE;AACvE,QAAO,IAAI,kBAAkB,MAAM,OAAO"}