-
Notifications
You must be signed in to change notification settings - Fork 266
dyncol_api
Georg Richter edited this page Sep 2, 2018
·
15 revisions
Dynamic columns allow 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 - Gets the number of columns in a dynamic column
- mariadb_dyncol_init - Initializes a dynamic column
- mariadb_dyncol_free - Frees dynamic column memory
- mariadb_dyncol_create_many_named - Creates a dynamic column with named keys
- mariadb_dyncol_create_many_num - Creates a dynamic column with numeric keys
- mariadb_dyncol_update_named - Updates a dynamic column with named keys
- mariadb_dyncol_update_num - Updates a dynamic column with numeric keys
- mariadb_dyncol_exists_named - Checks if a column with named key exists
- mariadb_dyncol_exists_num - Checks if column with numeric key exists
- mariadb_dyncol_list_named - Lists columns in a dynamic column
- mariadb_dyncol_list_num - Lists columns in a dynamic column
MariaDB Connector/C Reference