Download the PHP package elephentity/codegen-sqlite without Composer
On this page you can find all versions of the php package elephentity/codegen-sqlite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download elephentity/codegen-sqlite
More information about elephentity/codegen-sqlite
Files in elephentity/codegen-sqlite
Package codegen-sqlite
Short Description SQLite storage manifest and schema generator for Elephentity. Build-time only.
License Apache-2.0
Informations about the package codegen-sqlite
elephentity-codegen-sqlite
Build-time SQLite generator for Elephentity's PHP runtime. It emits a storage
manifest and an explicit initial schema installer for elephentity/sqlite.
No WordPress package is required.
Install
Alternatively, run cargo install --path . --locked from a checkout and use
eleph-gen-sqlite on PATH. Composer provides a shell launcher; it does not compile
Rust automatically. Production needs only the runtime and generated PHP artifacts.
Configure the target in eleph.json, alongside your PHP entity target:
In spec/project.yml:
describe advertises the sqlite driver, so the compiler discovers it without a
hardcoded driver addition. This builder speaks protocol 1 and IR 1.2. Use matching
compiler/orchestrator/PHP-builder versions; an older IR is rejected explicitly.
Generated artifacts
| File | Purpose |
|---|---|
storage-manifest.php |
Eleph\SQLite\Manifest\StorageManifest: entity tables, field mappings, indexes, edge placements and join tables |
install.php |
A closure accepting PDO SQLite and an optional additional table prefix; atomically creates the initial schema |
The orchestrator signs and writes these files. The builder returns JSON and never writes to the project directory itself.
The compiler has already applied project.storage.tablePrefix to the IR table names.
If you need an additional deployment prefix, pass the same value to
$install($database->pdo, $prefix) and $manifest->withPrefix($prefix).
The SQLite prototype's Database::prefix() returns app_; the adapter itself uses
the table names in the manifest, so do not automatically apply that prefix twice.
Schema behavior
- Identity columns use
INTEGER PRIMARY KEY AUTOINCREMENT. - Scalars map to SQLite
TEXT,INTEGERorREAL; JSON and dates are encoded by the PHP runtime. - Unique/indexed fields produce indexes. Boolean values, enum values and maximum lengths receive CHECK constraints.
- One-to-one, many-to-one, one-to-many and many-to-many edges produce matching placements and foreign keys. Join pairs are unique.
- Foreign keys use
ON DELETE RESTRICT. The runtime owns cascade/nullify policy and authorization; direct SQL cannot bypass that work through a database cascade. - Edge columns allow temporary NULL because the unit of work inserts entities before linking them. The runtime enforces required edges.
- Defaults and managed values are supplied by generated PHP/runtime writes, rather than duplicated as SQL defaults.
- Text uses SQLite's default comparison behavior. Clog's custom Unicode collation is not silently applied to other applications.
The installer rejects an existing table and rolls back all changes. It rejects an existing transaction and enables foreign keys before beginning its own transaction. It does not modify populated schemas or claim to generate upgrade migrations. Keep reviewed migrations in the application. Existing SQLite runtime prototype limitations remain; this package does not fix the core deletion-planner issue noted in elephentity#89.
Verify
PHP tests use the tagged SQLite/runtime packages, create disposable databases and run the upstream adapter conformance harness for every relationship shape. They also check constraints, identifier prefixes, NULL, literal escaping and rollback.
The standalone example combines PHP, SQLite and GraphQL PHP generation. In the sibling-repository workspace, with the core's Composer dependencies and all three builders plus the orchestrator built, run:
This generates from YAML, checks signed output for drift, runs eleph check against
actual generated entities and installs the generated SQLite schema. The GraphQL
builder's test dependencies must also be installed for that workspace test.
See SOURCE.md for the source of reused protocol and fixture code.