Closed pixelsyntax closed 5 years ago
I should note I have record-macros 1.0.0-alpha installed from haxelib, using haxe 3.4.7, neko 2.2.0
I've switched to the current git version of record-macros and am still experiencing this problem, but the included record-macro bundled tests complete successfully. Any hints as to where I'm going wrong greatly appreciated
The issue happens because RecordMacros.buildField
only matches field types by name
.
So by not recognizing sys.db.Types.SEnum
as SEnum
(it tries to match Types
), the internal data_val
field and its getters and setters are never created.
A workaround is to first import sys.db.Types
, and then type the field simply as:
public var val : SEnum<MyEnum>;
I am attempting to use SPOD via record-macros in neko. When I use sys.db.Types.SEnum (for example to set a value on a new object to be inserted into the database), the generated SQL query does not include that field. In the example below I initialise a SpodRec with someInt : SInt = 4 and val : SEnum = value1, but when I attempt to insert the record, the generated SQL is
INSERT INTO SpodRec (someInt) VALUES (4)
where I would expect it to beINSERT INTO SpodRec (someInt, val) VALUES (4,0)
or similar. Am I using this incorrectly?Output: