PHPackages                             daveismyname/sql-import - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. daveismyname/sql-import

Abandoned → [https://github.com/dcblogdev/sql-import](/?search=https%3A%2F%2Fgithub.com%2Fdcblogdev%2Fsql-import)Library[Database &amp; ORM](/categories/database)

daveismyname/sql-import
=======================

Import .sql file into a database using PDO

v2.0.1(3y ago)92.1k41MITPHPPHP &gt;=7.0.0

Since Jul 28Pushed 3y ago4 watchersCompare

[ Source](https://github.com/dcblogdev/sql-import)[ Packagist](https://packagist.org/packages/daveismyname/sql-import)[ GitHub Sponsors](https://github.com/dcblogdev)[ RSS](/packages/daveismyname-sql-import/feed)WikiDiscussions master Synced today

READMEChangelog (9)DependenciesVersions (10)Used By (1)

php Import SQL
==============

[](#php-import-sql)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c8f5d88c36a47397f8b6f295728745f1195a6082697dc55c3379e09b6bbf0bd3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6463626c6f676465762f73716c2d696d706f72742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dcblogdev/sql-import)[![Total Downloads](https://camo.githubusercontent.com/798d496b2a7689e81e7fe21991d73a9ccc333349281a36e2bda55477f4ffa2d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6463626c6f676465762f73716c2d696d706f72742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dcblogdev/sql-import)

[![Logo](https://repository-images.githubusercontent.com/142712626/d110ff80-49c1-11eb-8153-e43e3960caca)](https://repository-images.githubusercontent.com/142712626/d110ff80-49c1-11eb-8153-e43e3960caca)

PDO import sql from a .sql file

Install
-------

[](#install)

Using composer include the repository by typing the following into a terminal

```
composer require dcblogdev/sql-import

```

Usage
-----

[](#usage)

Include the composer autoloader, import the Import namespace.

Define your database file path and credentials, the option dropTables, when set to true, will delete all the tables in the database before the sql file gets imported.

The option forceDropTables is optional and not recommended. When enabled together with dropTables, the deletion of tables will be executed with disabled foreign key checks. Only use this method if you are sure that the integrity of the existing data in the database does not matter.

```
use Dcblogdev\SqlImport\Import;

$filename = 'database.sql';
$username = 'root';
$password = '';
$database = 'sampleproject';
$host = 'dev';
$dropTables = true;
$forceDropTables = false;

new Import($filename, $username, $password, $database, $host, $dropTables, $forceDropTables);
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 69% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~201 days

Recently: every ~403 days

Total

9

Last Release

1283d ago

Major Versions

v0.0.4 → v1.0.02018-07-29

1.1.0 → 2.0.02020-12-27

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39399156?v=4)[dcblog](/maintainers/dcblog)[@dcblog](https://github.com/dcblog)

---

Top Contributors

[![daveismynamecom](https://avatars.githubusercontent.com/u/60222583?v=4)](https://github.com/daveismynamecom "daveismynamecom (20 commits)")[![dcblogdev](https://avatars.githubusercontent.com/u/1018170?v=4)](https://github.com/dcblogdev "dcblogdev (6 commits)")[![mergeMarc](https://avatars.githubusercontent.com/u/19610853?v=4)](https://github.com/mergeMarc "mergeMarc (3 commits)")

---

Tags

hacktoberfestimporterphpsql

### Embed Badge

![Health badge](/badges/daveismyname-sql-import/health.svg)

```
[![Health](https://phpackages.com/badges/daveismyname-sql-import/health.svg)](https://phpackages.com/packages/daveismyname-sql-import)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M117](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
