kerrialn / static-data-importer-bundle
generates entity objects from json, xml, csv files and persists to the database
Installs: 14
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 1
Type:symfony-bundle
Requires
- php: ^8.1
- doctrine/doctrine-bundle: ^2.7
- doctrine/orm: ^2.13
- symfony/console: 6.1.*
- symfony/finder: 6.1.*
- symfony/flex: ^2
- symfony/property-access: 6.1.*
- symfony/proxy-manager-bridge: 6.1.*
- symfony/runtime: ^6.1
- symfony/serializer: 6.1.*
- symfony/yaml: 6.1.*
- symplify/smart-file-system: ^10
README
A Symfony CLI Bundle for importing json, csv and/or xml directly into a database via an entity object.
Install:
composer require kerrialn/static-data-importer-bundle
Configure: add json, xml or csv files to ./data
(name this anything you want) root directory in your project
- File naming convention
{order number}_{entity name}.{format}
Eg...10_Blog.json
,20_category.csv
or30_User.xml
(entity name is case-insensitive) - Change the import order, with the order number in the file name.
- Add
_SKIP
(case-sensitive) to the filename to skip the file.
Run:
bin/console import data/
Please note: id fields will be ignored and will generate id as per your entity annotation/attribute definition.