PHPackages                             tigron/skeleton-database - 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. tigron/skeleton-database

ActiveLibrary[Database &amp; ORM](/categories/database)

tigron/skeleton-database
========================

Tigron Skeleton Mysql database layer

v0.3.17(5mo ago)019.1k↓31.8%2[1 issues](https://github.com/tigron/skeleton-database/issues)11MITPHP

Since Aug 13Pushed 5mo ago4 watchersCompare

[ Source](https://github.com/tigron/skeleton-database)[ Packagist](https://packagist.org/packages/tigron/skeleton-database)[ RSS](/packages/tigron-skeleton-database/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (33)Used By (11)

skeleton-database
=================

[](#skeleton-database)

Description
-----------

[](#description)

This library is a Mysqli wrapper with an easy-to-use API. Most basic features are taken care of automatically.

Installation
------------

[](#installation)

Installation via composer:

```
composer require tigron/skeleton-database

```

Howto
-----

[](#howto)

Create a database connection:

```
$dsn1 = 'mysqli://username:password@localhost/database';
$dsn2 = 'mysqli://username:password@localhost/database2';

$db = \Skeleton\Database\Database::Get($dsn1, true); // The second parameter makes this dsn default
$db = \Skeleton\Database\Database::Get(); 			  // returns a connection to dsn1 as this is default
$db = \Skeleton\Database\Database::Get($dsn2);		  // returns a connection to dsn2, don't make it default
$db = \Skeleton\Database\Database::Get();			  // returns a connection to dsn1

```

Get a row of the resultset. The resultset should only contain 1 row

```
$result = $db->get_row('SELECT * FROM user WHERE id=?', [ 1 ]); // Returns one row

```

Get a column, each element in the array contains the value of a row. The result should only contain 1 row

```
$result = $db->get_column('SELECT id FROM user', []); // Returns 1 column

```

Get 1 field result.

```
$result = $db->get_one('SELECT username FROM user WHERE id=?', [ 1 ]); // Returns 1 field

```

Get all columns of a give table

```
$result = $db->get_columns('user');

```

Insert data into a table

```
$data = [
	'username' => 'testuser',
	'firstname' => 'test',
];

$result = $db->insert('user', $data); // Inserts a new row

```

Update a row

```
$data = [
	'username' => 'testuser',
	'firstname' => 'test',
];

$where = 'id=' . $db->quote(1);
$result = $db->update('user', $data, $where); // Updates a row

```

Run a query manually

```
$result = $db->query('DELETE FROM `user` WHERE id=?', [ $user_id ]);

```

Clear all existing database connections

```
Database::Reset();

```

For debug purpose flags can be set to see the queries

```
\Skeleton\Database\Config::$query_log = false; // (default = false)
\Skeleton\Database\Config::$query_counter = true; // (default = true)

$database = \Skeleton\Database\Database::get();
print_r($database->query_log);
print_r($database->query_counter);

```

Data quality insurance // Trim data if content is longer than table field \\Skeleton\\Database\\Config::$auto\_trim = false; // (default = false)

```
// Remove from objects properties which don't exist as table columns
\Skeleton\Database\Config::$auto_discard = false; // (default = false)

// Set to null every column which is not given as input and supports NULL values
\Skeleton\Database\Config::$auto_null = false; // (default = false)

```

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance70

Regular maintenance activity

Popularity26

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~125 days

Recently: every ~79 days

Total

31

Last Release

172d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8bff1383483dacb0c3f89d2d3856ae03d4cf3e80de26a2998248dd1175317285?d=identicon)[tigron](/maintainers/tigron)

---

Top Contributors

[![christopheg](https://avatars.githubusercontent.com/u/199087?v=4)](https://github.com/christopheg "christopheg (22 commits)")[![gerryd](https://avatars.githubusercontent.com/u/3003371?v=4)](https://github.com/gerryd "gerryd (14 commits)")[![LionelLaffineur](https://avatars.githubusercontent.com/u/21120913?v=4)](https://github.com/LionelLaffineur "LionelLaffineur (7 commits)")[![davidvandemaele](https://avatars.githubusercontent.com/u/1914033?v=4)](https://github.com/davidvandemaele "davidvandemaele (3 commits)")

### Embed Badge

![Health badge](/badges/tigron-skeleton-database/health.svg)

```
[![Health](https://phpackages.com/badges/tigron-skeleton-database/health.svg)](https://phpackages.com/packages/tigron-skeleton-database)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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