/sql-file-loader

SQL file loader - Load queries from big SQL files

Primary LanguagePHPMIT LicenseMIT

SQL File Loader

CircleCI

Installation

composer require mrceperka/sql-file-loader

Important notes

  • Statements in SQL file have to end with ;
  • Loader does NOT check the SQL syntax

Usage

<?php
use \MrCeperka\SqlFileLoader\SqlFileLoader;

$resource = __DIR__ . '/data.sql';
// or with stdin
// $resource = fopen('php://stdin', 'r');

$loader = new SqlFileLoader($resource);
$queries = $loader->getQueries();