artiframe table:

The artiframe table: command manages your project's schema.sql file using ArtiFrame's built-in SQL schema library (sql.stub). Instead of writing tables from scratch, you can inject ready-made and tested schemas into your project with a single command.

Subcommands

CommandDescription
artiframe table:listLists all available ready-made schemas in the library.
artiframe table:[table-name]Appends the specified schema to the schema.sql file.
artiframe table:[table-name] checkPreviews the schema in the terminal before adding it to the file.

Available Schemas

The following schemas are included in the library for the current version of ArtiFrame:

Schema NameDescription
usersCore user table. Binary(16) UUID, email, password, role, status, timestamps.
user_sessionsSession token management. IP, user-agent, TTL, and CASCADE foreign key to users.
user_preferencesUser preferences: language, theme, notification settings.

List all schemas

$ artiframe table:list

  users               : Core user table
  user_sessions       : Session token management
  user_preferences    : User preference settings

Preview schema (without appending to file)

$ artiframe table:users check

--- SQL FOR `users` ---
CREATE TABLE `users` (
  `id` binary(16) NOT NULL,
  `email` varchar(255) NOT NULL,
  ...
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
---------------------------

Append schema to schema.sql

$ artiframe table:users
✅ users table added to schema.sql file.

$ artiframe table:user_sessions
✅ user_sessions table added to schema.sql file.

The schema.sql File

schema.sql is kept in your project's root directory and serves as the single source of truth for your entire database schema. If the file does not exist, it is automatically created the first time a table: command is executed. By committing it to version control (git), you ensure that all developers on the team are using the identical schema.

Tip: To apply the schema to the database, you can open DB Studio via artiframe db:onproject and do an SQL Import, or simply run the mysql -u root -p db_name < schema.sql command directly.