-
Notifications
You must be signed in to change notification settings - Fork 1
How to create type strong tables ?
Arnaud Declercq edited this page Mar 12, 2021
·
2 revisions
The SQL adapter provide the capability to associate a BHoM type with each table. This means that
- Rows pulled from a "type-strong' table will automatically be converted to objects of that type.
- If there is only one table associated with a given type, the user can push objects of that type without having to specify the target table.
- The adapter will refuse to push objects of a type that doesn't match the type of the table.
- Create a new table in your database and call it
_tableTypes(the casing is important). - The table columns should be defined as follows:
| Column Name | Date Type | Allow Nulls |
|---|---|---|
| TableName | varchar(255) | no |
| TypeName | varchar(255) | no |
The TypeName value corresponds to the namespace followed by the type name (e.g. BH.oM.Geometry.Point). In doubt, you can generate the TypeName as with this simple script:

Note that generic types are not supported.