Skip to content

Commit

Permalink
Merge pull request #1 from kristuff/dev
Browse files Browse the repository at this point in the history
Initial commit
  • Loading branch information
kristuff authored Jun 30, 2017
2 parents 2e27139 + 3a72b14 commit 5a0aeec
Show file tree
Hide file tree
Showing 48 changed files with 6,648 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tests/ export-ignore
vendor/ export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
composer.* export-ignore
phpunit.xml export-ignore
README.* export-ignore
1 change: 0 additions & 1 deletion .gitignore/.gitignore

This file was deleted.

20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
language: php

php:
- '5.6'
- '7.0'
- '7.1'

before_install:
- composer install
- cd tests

before_script:
# - psql -c "DROP DATABASE IF EXISTS patabaseTest;" -U postgres
# - mysql -e "DROP DATABASE IF EXISTS patabaseTest;" -uroot

script:
- ../vendor/bin/phpunit --debug --configuration phpunit.xml --coverage-text --coverage-clover=coverage.xml

after_success:
- bash <(curl -s https://codecov.io/bash)
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017 Kristuff

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
100 changes: 100 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
![logo](https://patabase.kristuff.fr/inc/img/logo/logo-square-48x48.png)
Kristuff Patabase
=================

A database/server SQL query builder for PHP.

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/398308d1225049f58ae583065608c460)](https://www.codacy.com/app/kristuff_/patabase?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=kristuff/patabase&amp;utm_campaign=Badge_Grade)
[![Code Climate](https://codeclimate.com/github/kristuff/patabase/badges/gpa.svg)](https://codeclimate.com/github/kristuff/patabase)
[![Build Status](https://travis-ci.org/kristuff/patabase.svg?branch=master)](https://travis-ci.org/kristuff/patabase)
[![codecov](https://codecov.io/gh/kristuff/patabase/branch/master/graph/badge.svg)](https://codecov.io/gh/kristuff/patabase)


Website
-------

[patabase.kristuff.fr](https://patabase.kristuff.fr)


Features
--------
- Easy to use, easy to hack, fast and very lightweight
- Supported drivers: Sqlite, Mysql, Postgresql
- Requires only PDO
- Full [online documentation](https://patabase.kristuff.fr/doc)

SQL Features
------------

Database queries:
```
- SELECT FROM:
DISTINCT, all / column(s), columns(s)/alias, function(COUNT, SUM), sub select,
JOIN (INNER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN (*), FULL OUTER JOIN (*))
WHERE (=, !=, <, <=, >, >=, IN, NOT IN, NULL, NOT NULL),
GROUP BY,
HAVING (COUNT, SUM),
ORDER BY (ASC, DESC, RAND (*)),
LIMIT,
OFFSET
- INSERT INTO
- DELETE FROM
WHERE (=, !=, <, <=, >, >=, IN, NOT IN, NULL, NOT NULL),
- UPDATE
WHERE (=, !=, <, <=, >, >=, IN, NOT IN, NULL, NOT NULL),
- CREATE TABLE (DEFAULT, PRIMARY KEYS, FOREIGN KEYS, NULL/NOT NULL)
- RENAME TABLE
- TABLE EXISTS
- SHOW TABLES
- DROP TABLE
- ENABLE FOREIGN KEY (*)
- DISABLE FOREIGN KEY (*)
- ADD FOREIGN KEY (*)
- DROP FOREIGN KEY (*)
```

Server queries (*):
```
- CREATE DATABASE
- CREATE USER
- USER EXISTS
- DATABASE EXISTS
- SHOW USERS
- SWOW DATABASES
- GRANT USER
- DROP DATABASE
- DROP USER
```
(*) some feature may be unavailable on some driver.

Requirements
------------

- PHP >= 5.6
- PDO extension: Sqlite, Mysql or Postgresql


License
-------

The MIT License (MIT)

Copyright (c) 2017 Kristuff

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
22 changes: 22 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "kristuff/patabase",
"description": "SQL query builder",
"homepage": "https://patabase.kristuff.fr",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "kristuff",
"homepage": "https://github.com/kristuff"
}
],
"require": {
"php": ">=5.6.0"
},
"autoload": {
"psr-4": {"Kristuff\\Patabase\\": "lib/"}
},
"require-dev": {
"phpunit/phpunit": "5.7.*"
}
}
Loading

0 comments on commit 5a0aeec

Please sign in to comment.