Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikeshiyan/lite-sql-insert
Lightweight SQL insertion service.
https://github.com/mikeshiyan/lite-sql-insert
composer insert lite oop pdo php sql
Last synced: about 2 months ago
JSON representation
Lightweight SQL insertion service.
- Host: GitHub
- URL: https://github.com/mikeshiyan/lite-sql-insert
- Owner: mikeshiyan
- License: mit
- Created: 2017-11-06T18:10:39.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-19T12:48:12.000Z (over 6 years ago)
- Last Synced: 2024-07-22T05:25:50.381Z (5 months ago)
- Topics: composer, insert, lite, oop, pdo, php, sql
- Language: PHP
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lite SQL Insert
[![Build Status](https://travis-ci.org/mikeshiyan/lite-sql-insert.svg?branch=master)](https://travis-ci.org/mikeshiyan/lite-sql-insert)
Very lightweight PHP service class for SQL INSERT queries abstraction.
Best suited for use as a [Composer](https://getcomposer.org) library.
## Requirements
* PHP >= 7.1
* PDO extension## Installation
To add this library to your Composer project:
```
composer require shiyan/lite-sql-insert
```## Usage
```
$connection = new \Shiyan\LiteSqlInsert\Connection($pdo);
$insert = $connection->insert('my_table', ['name', 'value']);foreach ($my_data as $name => $value) {
$insert->values(['name' => $name, 'value' => $value]);
}$insert->commit();
```