-
Notifications
You must be signed in to change notification settings - Fork 269
dyncol_api
Georg Richter edited this page Sep 1, 2018
·
15 revisions
Dynamic columns allow one to store different sets of columns for each row in a table. It works by storing a set of columns in a blob and having a small set of functions to manipulate it.
Dynamic columns should be used when it is not possible to use regular columns.
A typical use case is when one needs to store items that may have many different attributes (like size, color, weight, etc), and the set of possible attributes is very large and/or unknown in advance. In that case, attributes can be put into dynamic columns.
Dynamic columns are supported since MariaDB Server 5.3, however with MariaDB Connector/C it's possible to read, write and manipulate dynamic columns regardless of the server version.
- mariadb_dyncol_column_count - Returns the number of columns
- mariadb_dyncol_init() - Initializes a dynamic column
- mariadb_dyncol_free() - Frees dynamic column memory
- mariadb_dyncol_create_many_named() - Creates a packed blob with named keys
- mariadb_dyncol_create_many_num() - Creates a packed blob with numeric keys
- mariadb_dyncol_create_update_named() - Updates a packed blob with named keys
- mariadb_dyncol_create_update_num() - Updates a packed blob with numeric keys
- mariadb_dyncol_exists_named() - Checks if column with named key exists
- mariadb_dyncol_exists_num() - Checks if column with numeric key exists
- mariadb_dyncol_column_count() - Gets number of columns in a dynamic packed blob
- mariadb_dyncol_list_named() - Lists columns in a dynamic packet blob
- mariadb_dyncol_list_num() - Lists columns in a dynamic packet blob
MariaDB Connector/C Reference