glider88/fixturization

Create fixtures from database

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/glider88/fixturization

1.0.0 2025-12-07 16:20 UTC

This package is auto-updated.

Last update: 2025-12-08 20:10:13 UTC


README

Select the start of the table crawl, after which the spider will follow the table refs and collect data. Determine which columns are needed, which filters to use, how many rows select from the table, and how to transform the data after fetching. This data can be used for fixtures or tests.

Installation:

composer require glider88/fixturization

Learn by example:

See how you can use library in examples/

Get data:

wget https://raw.githubusercontent.com/devrimgunduz/pagila/refs/heads/master/pagila-schema.sql -P .docker/postgres
wget https://raw.githubusercontent.com/devrimgunduz/pagila/refs/heads/master/pagila-data.sql -P .docker/postgres

Fix owner:

sed -i -e 's/OWNER TO postgres/OWNER TO fixturization/g' .docker/postgres/pagila-schema.sql

Start docker:

bin/re  # first time
bin/up  # next times

Generate schema from database:

bin/sh php examples/schema.php psql

Additional description of the schema that is not in the database: examples/var/schema/manual.yaml

Generate dump (support sql and yaml formats):

bin/sh php examples/crawler.php sql yaml