Class | Og::Backend |
In: |
lib/og/backend.rb
|
Parent: | Object |
Abstract backend. A backend communicates with the RDBMS. This is the base class for the various backend implementations.
conn | [RW] | The actual connection to the database |
Encode the name of the klass as an sql safe string. The Module separators are replaced with _ and NOT stripped out so that we can convert back to the original notation if needed. The leading module if available is removed.
Precompile the code to read objects of the given class from the backend. In order to allow for changing field/attribute orders we have to use a field mapping hash.
Returns the props that will be included in the insert query. For some backends the oid should be stripped.
Create the fields that correpsond to the klass properties. The generated fields array is used in create_table. If the property has an :sql metadata this overrides the default mapping. If the property has an :extra_sql metadata the extra sql is appended after the default mapping.