4dmiralbean
4dmiralbean
DTDrizzle Team
Created by 4dmiralbean on 8/21/2023 in #help
Shared Table Behavior
Ooh I found getTableColumns which might work!
11 replies
DTDrizzle Team
Created by 4dmiralbean on 8/21/2023 in #help
Shared Table Behavior
It's almost like I need a schema.getFieldByName(name: string) or something
11 replies
DTDrizzle Team
Created by 4dmiralbean on 8/21/2023 in #help
Shared Table Behavior
but I'm having issues trying to do things like clauses.push(gte(this.model[f.field], new Date(f.operand)));
11 replies
DTDrizzle Team
Created by 4dmiralbean on 8/21/2023 in #help
Shared Table Behavior
The logic for handling all of these should be in the parent class so all the fetches from child models are filter-aware
11 replies
DTDrizzle Team
Created by 4dmiralbean on 8/21/2023 in #help
Shared Table Behavior
For example: i want the end user of an API to be able to submit various filters with their request. For example, created_at is gte some timestamp.
11 replies
DTDrizzle Team
Created by 4dmiralbean on 8/21/2023 in #help
Shared Table Behavior
The main problem I keep bumping into is if I want to use dynamic field names in places.
11 replies
DTDrizzle Team
Created by 4dmiralbean on 8/21/2023 in #help
Shared Table Behavior
For named fields I can do that okay, because I can create an interface that tells the system what the field names are, etc.
11 replies
DTDrizzle Team
Created by 4dmiralbean on 8/21/2023 in #help
Shared Table Behavior
@Andrew Sherman Appreciate that. Right now I want a "parent" or "core" parent model class that handles most all of the core logic. If there's a shared field like "created_at", then all the logic for it should be handled there.
11 replies
DTDrizzle Team
Created by 4dmiralbean on 8/21/2023 in #help
Shared Table Behavior
For example, if I create some sort of generic class that does the ID creation or centralized creation logic.... I'm unsure how to type things.
11 replies