@m1212e/rumble 0.12.7 → 0.12.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/index.d.cts CHANGED
@@ -828,7 +828,7 @@ declare const rumble: <UserContext extends Record<string, any>, DB extends Drizz
828
828
  * The other helpers use this helper internally so in most cases you do not have to
829
829
  * call this helper directly, unless you need the reference to an enum type
830
830
  */
831
- enum_: <ExplicitEnumVariableName extends keyof (NonNullable<DB["_"]["relations"]["schema"]> extends infer T_2 ? { [K in keyof T_2 as NonNullable<DB["_"]["relations"]["schema"]>[K] extends drizzle_orm_pg_core0.PgEnum<any> ? K : never]: NonNullable<DB["_"]["relations"]["schema"]>[K] } : never), EnumColumn extends drizzle_orm_pg_core0.PgEnum<any>, RefName_2 extends string>({
831
+ enum_: <ExplicitEnumVariableName extends keyof (NonNullable<DB["_"]["fullSchema"]> extends infer T_2 ? { [K in keyof T_2 as NonNullable<DB["_"]["fullSchema"]>[K] extends drizzle_orm_pg_core0.PgEnum<any> ? K : never]: NonNullable<DB["_"]["fullSchema"]>[K] } : never), EnumColumn extends drizzle_orm_pg_core0.PgEnum<any>, RefName_2 extends string>({
832
832
  tsName,
833
833
  enumColumn,
834
834
  refName
package/out/index.d.ts CHANGED
@@ -828,7 +828,7 @@ declare const rumble: <UserContext extends Record<string, any>, DB extends Drizz
828
828
  * The other helpers use this helper internally so in most cases you do not have to
829
829
  * call this helper directly, unless you need the reference to an enum type
830
830
  */
831
- enum_: <ExplicitEnumVariableName extends keyof (NonNullable<DB["_"]["relations"]["schema"]> extends infer T_2 ? { [K in keyof T_2 as NonNullable<DB["_"]["relations"]["schema"]>[K] extends drizzle_orm_pg_core0.PgEnum<any> ? K : never]: NonNullable<DB["_"]["relations"]["schema"]>[K] } : never), EnumColumn extends drizzle_orm_pg_core0.PgEnum<any>, RefName_2 extends string>({
831
+ enum_: <ExplicitEnumVariableName extends keyof (NonNullable<DB["_"]["fullSchema"]> extends infer T_2 ? { [K in keyof T_2 as NonNullable<DB["_"]["fullSchema"]>[K] extends drizzle_orm_pg_core0.PgEnum<any> ? K : never]: NonNullable<DB["_"]["fullSchema"]>[K] } : never), EnumColumn extends drizzle_orm_pg_core0.PgEnum<any>, RefName_2 extends string>({
832
832
  tsName,
833
833
  enumColumn,
834
834
  refName
package/out/index.js CHANGED
@@ -923,9 +923,9 @@ const createEnumImplementer = ({ db, schemaBuilder }) => {
923
923
  let enumSchemaName;
924
924
  let enumValues;
925
925
  if (tsName) {
926
- const schemaEnum = db._.schema[tsName];
926
+ const schemaEnum = db._.fullSchema[tsName];
927
927
  enumSchemaName = tsName.toString();
928
- const enumCol = Object.values(db._.schema).filter((s) => typeof s === "object").map((s) => Object.values(s.columns)).flat(2).find((s) => s.config?.enum === schemaEnum);
928
+ const enumCol = Object.values(db._.schema).filter((s) => typeof s === "object").map((s) => Object.values(s.columns)).flat(2).filter(isEnumSchema).find((e) => e.config.enum === schemaEnum);
929
929
  if (!enumCol) throw new RumbleError(`Could not find applied enum column for ${tsName.toString()}.
930
930
  Please ensure that you use the enum at least once as a column of a table!`);
931
931
  enumValues = enumCol.enumValues;