Closed akevalion closed 2 years ago
The default transformation is instVarName
to all lower-case inst_var_name
however there's no need to define a subclass to override the transformation.
The defaultInstVarNameTransformation
is assigned to the dialect object's instVarNameTransformation
after connecting to the database (when the dialect object is created), therefore you can set your own transformation block after connecting by sending instVarNameTransformation:
to the dialect object. There's also defaultClassNameTransformation
and classNameTransformation
to do the same for the class name transformations.
It additionally sounds like you're connecting to a pre-existing database - in this case you can also manually specify an explicit column name as per this example which maps the firstName
instance variable of class Customer
to a column named forename
((aReStore tableForClass: Customer) fieldAccessing: #firstName) name: 'forename'.
An upcoming update to ReStore will enable custom mappings like this to be done directly in a class's reStoreDefinition
Thank you for now it works accessing to the sqlDialect in the connection object
I am using restore in a project https://github.com/akevalion/Football, but I had a problem a little bit hard to explain
I am using an SQLite database from https://data.world/data-society/european-soccer-data
But recently dbNameFor: transform the name of one of my columns:
from this
home_player_X1
to this:home_player_x1
function defined here :Because of this the value of that variable is nil.
I have created a subclass that override the name transformation, but I feel this error can be avoid with a method configuration for
SSWDBClassDefinition
in reStoreDefinition