Table
Last updated
Last updated
In SchemaJS, the Table
global represents the structure of a database table, defining its columns and the queries that can be performed on it. It provides an interface for easily constructing, manipulating, and querying database tables, making it highly flexible for various use cases.
Adds a to the table. Columns define the structure of each entry in the table, such as the data type and constraints.
Defines a custom query for the table. This query can be executed later, allowing dynamic and specific data retrieval operations.
The .on()
method in the Table
global allows you to register hooks (event listeners) that execute custom logic when specific actions, such as inserts, occur on the table. It provides a way to extend or modify the behavior of table operations, like inserting new rows, by running custom code before or after the operation completes.