Open grisevg opened 9 years ago
I like the idea (and it would be useful to have Haxe code interact with a rails database, as you mention) but have no idea how to implement it, short of replacing the entire sys.db.RecordMacros
with our own implementation...
Two options:
Manager
that uses our own macros when we need to do things differentlyufront.db.BaseObject
, that has the basic Ufront additions (serialization, save()
etc), but skips the included fields (id
, modified
, created
). This would mean these tables wouldn't support our join relationships now though, at least until we add better support for custom IDs.I'm going to leave the issue open but not sure when I'll get to it, it's quite a complex issue to solve sadly :(
Patching the std lib is easier, indeed we can open an issue on the Haxe repo...
I also wanted such feature when I want to use haxe keywords as db field name (e.g. class
)
Okay, I agree: patching the standard library sounds the smartest (and probably easiest)
I just know Simon will want to close the issue because he wants all the sys.db.*
classes moved to a separate haxelib. I'll keep this issue open until we create a different issue :)
Hi,
I'm trying to use the orm with already existing rails database, but the orm uses
created
andmodified
fields instead of rails onescreated_at
andupdated_at
.It would be very useful to be able to make the orm use different database field names from haxe field names. Maybe something like:
or even a compile time macro
What do you think?