- What is yajra/laravel-sql-loader used for?
- It is a Laravel package for executing .sql files against your configured database connections, so you can import schema dumps, seed data, or legacy SQL exports without leaving Laravel's tooling. The package overview frames it as a simple Artisan-driven SQL loader, while the technical assessment notes that the actual behaviour must be verified because sources disagree on whether it targets generic SQL dumps or Oracle SQL*Loader. Treat it as a replaceable ETL utility rather than a deep framework dependency.
- How do I install yajra/laravel-sql-loader?
- Install it with Composer using composer require yajra/laravel-sql-loader. Laravel's package auto-discovery should register the service provider, and any publishable configuration should be published before use. After installation, confirm the exact Artisan command signature and options in the package source or README, because the supplied README excerpt is empty.
- Which Laravel and PHP versions does yajra/laravel-sql-loader support?
- The technical assessment lists PHP 8.2, 8.3, and 8.4 with Laravel 10, 11, and 12 as the support matrix that needs verification, referencing v1.10.0 as the latest release. It does not confirm that the package is actively exercised against all of those framework majors. Check composer.json constraints and CI coverage before committing to a version.
- How do I run a .sql file in Laravel with an Artisan command?
- The package provides an Artisan command that passes .sql files through Laravel's DB layer and runs them against a configured connection. The exact command name and arguments are not included in the supplied README excerpt, so verify them in the repository source. For repeatable deployments, wrap the command in your own script or CI step and check the database state afterward.
- Does yajra/laravel-sql-loader work with MySQL, PostgreSQL, or SQLite?
- Do not assume that. The package overview describes generic .sql dump execution against configured Laravel connections, but the technical assessment says the package is a thin wrapper around Oracle SQL*Loader and explicitly advises against adopting it for MySQL, PostgreSQL, or SQLite. Resolve that metadata conflict by reading composer.json and the source tree before use.
- Is yajra/laravel-sql-loader an Oracle SQL*Loader wrapper?
- The technical assessment and release notes point to Oracle SQL*Loader: it describes generated control files, a sqlldr client dependency, and a v1.10.0 CHARACTERSET feature. The package overview instead describes generic SQL dump import. This is a material ambiguity, so verify whether the code shells out to sqlldr or uses OCI8 direct-path APIs before planning adoption.
- How do I configure database connections for SQL loading?
- The package is designed to run against Laravel's configured database connections, so start by defining the target connection in config/database.php and testing it with Laravel's DB facade. If the Oracle interpretation is correct, you will also need Oracle Instant Client or a full client with sqlldr, TNS or Easy Connect connectivity, a staging table with appropriate grants, and a filesystem path readable by the application host. In locked-down enterprises, DBA engagement is usually the critical path.
- Is yajra/laravel-sql-loader safe for production deployments?
- Treat it as a batch ingestion utility that needs guardrails. The assessment warns about silent data rejection into .bad and .discard files, no transactional rollback, and partial loads leaving staging half-populated. For production, load into a staging table, parse logs and bad files, assert rows-read equals rows-committed, then perform an atomic swap or merge.
- Can I use yajra/laravel-sql-loader for seeding and migrations?
- It is described as useful for seeding, migrations, and data import workflows because it keeps SQL loading inside Laravel configuration and tooling. That does not make it a replacement for Laravel migrations or seeders, which remain the safer choice for schema changes and small reference data. Use the SQL loader for bulk or legacy dumps where a PHP-based seeder would be impractical.
- What are alternatives to yajra/laravel-sql-loader?
- Alternatives include Laravel migrations and seeders, DB::unprepared for small scripts, native database clients such as mysql, psql, or sqlldr, and a small custom Artisan command tailored to your environment. The package's own assessment notes that the wrapper surface is small enough that build-versus-buy barely favours buy, which also means lock-in is low. Choose based on your database engine, DBA constraints, and whether you need error handling beyond a bare exit code.