PHPackages                             kingsoft/persist-db - 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. kingsoft/persist-db

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

kingsoft/persist-db
===================

Implementation of Kingsoft/IPersist for databases using Kingsoft/Database as a backend.

2.13.6(6mo ago)0326[11 issues](https://github.com/theking2/kingsoft-persist-db/issues)MITPHPPHP &gt;=8.3

Since Mar 31Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/theking2/kingsoft-persist-db)[ Packagist](https://packagist.org/packages/kingsoft/persist-db)[ RSS](/packages/kingsoft-persist-db/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (3)Versions (78)Used By (0)

DB implementation of Persist
============================

[](#db-implementation-of-persist)

This implementation of the abstract [`Persist/Base`](https://github.com/theking2/kingsoft-persist) uses a [`Db`](https://github.com/theking2/kingsoft-db) connection to make tables in the database available as persistent PHP objects. This generates a class for every table or view in the database extracting PK, possibly with auto increment from tables. With Mariadb it is not possible to extract PK from a view so manual setting the getPrimaryKey() is needed.

Discover
========

[](#discover)

To create the PHP proxies to the tables and views create a `discover.php` in the root like:

```
