<commit_before>OneDB [![Build Status](https://travis-ci.org/cvgellhorn/OneDB.svg?branch=master)](https://travis-ci.org/cvgellhorn/OneDB)
===========

A lightweight/single file PHP database framework

#Get started
```php
// Include OneDB
require_once 'OneDB.php';

// Create OneDB instance and have fun
$database = OneDB::load(array(
    'database'  => '[database_name]',
    'user'      => '[database_username]',
    'password'  => '[database_password]'
));

// After initializing, you can always get the current instance with
$database = OneDB::load();


// Or create a new connection by name (for multiple connections)
$database = OneDB::getConnection('[connection_name]', array(
    'database'  => '[database_name]',
    'user'      => '[database_username]',
    'password'  => '[database_password]'
));

// Reload connection again later
$databaseWrite = OneDB::getConnection('[connection_name]');
```

##Configuration
You can also set the database host, port and charset.
```php
$database = OneDB::load(array(
	'host'      => 'sql.mydomain.com',
    'port'      => '3307',
    'charset'   => 'utf16',
    'database'  => 'application',
    'user'      => 'root',
    'password'  => '<PASSWORD>#'
));
```

Default values
```php
'host'    => 'localhost'
'port'    => '[default_mysql_port]'
'charset' => 'utf8'
```

##Basic Usage
###Insert
Insert new records in table, always returns lastInsertId.

```php
$lastInsertId = $database->insert('user', array(
	'name'  => '<NAME>',
    'email' => '<EMAIL>',
    'tel'   => 12345678
));
```<commit_msg>Update documentation<commit_after>OneDB [![Build Status](https://travis-ci.org/cvgellhorn/OneDB.svg?branch=master)](https://travis-ci.org/cvgellhorn/OneDB)
===========

A lightweight/single file PHP database framework

#Get started
```php
// Include OneDB
require_once 'OneDB.php';

// Create OneDB instance and have fun
$database = OneDB::load(array(
    'database'  => '[database_name]',
    'user'      => '[database_username]',
    'password'  => '[database_password]'
));

// After initializing, you can always get the current instance with
$database = OneDB::load();


// Or create a new connection by name (for multiple connections)
$database = OneDB::getConnection('[connection_name]', array(
    'database'  => '[database_name]',
    'user'      => '[database_username]',
    'password'  => '[database_password]'
));

// Reload connection again later
$databaseWrite = OneDB::getConnection('[connection_name]');
```

##Configuration
You can also set the database host, port and charset.
```php
$database = OneDB::load(array(
	'host'      => 'sql.mydomain.com',
    'port'      => '3307',
    'charset'   => 'utf16',
    'database'  => 'application',
    'user'      => 'root',
    'password'  => '<PASSWORD>#'
));
```

Default settings
```php
'host'    => 'localhost'
'port'    => '[default_mysql_port]'
'charset' => 'utf8'
```

##Basic Usage
###Insert
Insert new records in table, returns lastInsertId.

```php
$lastInsertId = $database->insert('user', array(
	'name'  => '<NAME>',
    'email' => '<EMAIL>',
    'tel'   => 12345678
));
```
{'fraction_non_alphanumeric': 0.19198448610213317, 'fraction_numerical': 0.009696186166774402, 'mean_word_length': 4.201680672268908, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 47, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2155865', 'n_tokens_mistral': 1049, 'n_tokens_neox': 1000, 'n_words': 246}