UNPKG

1.37 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/decorator/Generated.ts"],"names":[],"mappings":";;AAAA,yBAA2C;AAG3C;;;;;;;;GAQG;AACH,SAAgB,SAAS,CAAC,QAAkD;IAAlD,yBAAA,EAAA,sBAAkD;IACxE,OAAO,UAAU,MAAc,EAAE,YAAoB;QAEjD,0BAAsB,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;YACtC,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,QAAQ,EAAE,QAAQ;SACI,CAAC,CAAC;IAChC,CAAC,CAAC;AACN,CAAC;AATD,8BASC","file":"Generated.js","sourcesContent":["import {getMetadataArgsStorage} from \"../\";\nimport {GeneratedMetadataArgs} from \"../metadata-args/GeneratedMetadataArgs\";\n\n/**\n * Marks a column to generate a value on entity insertion.\n * There are three types of generation strategy - increment, uuid and rowid (cockroachdb only).\n * Increment uses a number which increases by one on each insertion.\n * Uuid generates a special UUID token.\n * Rowid supports only in CockroachDB and uses `unique_rowid()` function\n *\n * Note, some databases do not support non-primary generation columns.\n */\nexport function Generated(strategy: \"increment\"|\"uuid\"|\"rowid\" = \"increment\"): Function {\n return function (object: Object, propertyName: string) {\n\n getMetadataArgsStorage().generations.push({\n target: object.constructor,\n propertyName: propertyName,\n strategy: strategy\n } as GeneratedMetadataArgs);\n };\n}\n"],"sourceRoot":".."}
\No newline at end of file