How to use [magic.db.mysql.columns]
This slot returns all columns for the specified [connection-string]/[database]/[table] combination. Below is example usage.
signal:magic.db.mysql.columns
connection-string:generic
database:magic
table:users_roles
The above would return all columns in your “users_roles” table, resulting in something resembling the following.
signal
""
name:role
db:varchar(45)
nullable:bool:false
primary:bool:true
automatic:bool:false
hl:string
""
name:user
db:varchar(256)
nullable:bool:false
primary:bool:true
automatic:bool:false
hl:string
The fields imply the following.
- [name] - Name of column
- [db] - Database type for column
- [nullable] - If true column accepts null values
- [primary] - If true column is a part of the primary key for the table
- [automatic] - If true column has a default value
- [hl] - Hyperlambda type mapping for the column