Using the OpenLink Rails ODBC Adapter with Virtuoso
Type Mappings
ActiveRecord defines a number of abstract data types. These and the corresponding Ruby data types are listed in the table below. Which native database types the abstract types map to will depend to some extent on the underlying ODBC driver used by the OpenLink Rails ODBC Adapter. The native type mappings for the native OpenLink Virtuoso agents/Lite drivers are shown below.
| Active Record abstract type | Ruby type | Virtuoso type |
|---|---|---|
| :primary_key | - | INT NOT NULL IDENTITY PRIMARY KEY |
| :string | String | VARCHAR(4070) |
| :boolean | Object | SMALLINT |
| :datetime | Time | DATETIME |
| :time | Time | TIME |
| :timestamp | Time | DATETIME |
| :date | Date | DATE |
| :text | String | LONG VARCHAR |
| :integer | Fixnum | INTEGER |
| :float | Float | DOUBLE PRECISION |
| :binary | String | LONG VARBINARY |
| :decimal | BigDecimal | DECIMAL |