nimmermaer/statica

Export tables to static sql dump to provider extension

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:typo3-cms-extension

pkg:composer/nimmermaer/statica

dev-main 2025-11-23 12:32 UTC

This package is auto-updated.

Last update: 2025-11-23 12:34:16 UTC


README

TYPO3 13

EXT:statica is a TYPO3 development extension designed to export and import static SQL data
from ext_tables_static+adt.sql files. Its main purpose is to allow developers to version-control
static database data
(e.g., be_users, or any other table) directly inside an extension.

⚠️ Important: This extension is intended only for development environments.
It should be installed using Composer's --dev flag and removed before deployment to production.

Features

  • Export any table(s) into an extension's ext_tables_static+adt.sql file for version control\
  • Import static SQL data back into the database using a CLI command\
  • No relation resolving (MM tables, inline relations, foreign keys)
    Relations must be handled manually by the developer
  • Extends TYPO3 Core's SQLReader class to better interpret comment styles found in ADT dumps
    (especially MySQL conditional comments generated by mysqldump)
  • Future feature: Enable or disable commands depending on the environment (e.g., dev/stage/prod)

Installation

composer require vendor/statica --dev

Because the extension is meant only for development workflows, it should always be installed using
the --dev flag and excluded from production deployments.

Usage

Export static data

Export one or multiple tables into an extension's ext_tables_static+adt.sql file:

bin/typo3 statica:static-export <extensionKey> <tables>

Example:

bin/typo3 statica:static-export my_site_package be_users,tx_news_domain_model_news

This writes the exported SQL into:

EXT:my_site_package/ext_tables_static+adt.sql

Import static data

Import the static SQL from ext_tables_static+adt.sql into the database:

bin/typo3 statica:static-import <extensionKey>

Example:

bin/typo3 statica:static-import my_site_package

Limitations

  • No relationship resolution
    • MM tables must be exported separately\
    • Inline and foreign-key relations are not automatically handled
  • Only meant for development
    • Do not use this extension in production\
    • Remove the package before releasing

Roadmap

Future improvements may include:

  • Auto-hiding or enabling CLI commands based on environment (e.g., allow export only in development)
  • Additional validation for SQL dumps
  • Extended support for multi-table dependency handling

License

MIT License (or your chosen license)

Disclaimer

This extension is intended for development workflows only.
Accidental import operations in production may lead to data loss.
Use with caution and remove before deployment.