PHPackages                             onesimus-systems/seed-catalog - 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. onesimus-systems/seed-catalog

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

onesimus-systems/seed-catalog
=============================

Simple ORM.

1.1.0(10y ago)01571MITPHP

Since Feb 22Pushed 10y agoCompare

[ Source](https://github.com/onesimus-systems/seed-catalog)[ Packagist](https://packagist.org/packages/onesimus-systems/seed-catalog)[ Docs](https://github.com/onesimus-systems/seed-catalog)[ RSS](/packages/onesimus-systems-seed-catalog/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (7)Used By (1)

Seed Catalog
------------

[](#seed-catalog)

[![Build Status](https://camo.githubusercontent.com/c847b120d50875724a7c582efabca9075f7558fa95d608d426ee16ff23019913/68747470733a2f2f7472617669732d63692e6f72672f6f6e6573696d75732d73797374656d732f736565642d636174616c6f672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/onesimus-systems/seed-catalog)

Seed Catalog is a simple database interface in PHP. It aims to make the most common interactions with the database easier. I've been using it for quite some time. I felt like it's about time I share it.

Seed Catalog is a fork of the [Base](https://github.com/erusev/base) project by erusev.

### Features

[](#features)

- Simple
- Intuitive
- Independent
- Secure
- Based on [PDO](http://php.net/manual/en/book.pdo.php)
- Tested in 5.3, 5.4, 5.5, 5.6 and [HHVM](http://hhvm.com/)

### Installation

[](#installation)

Include `SC.php`, `Collection.php`, and 'SCException.php' or install [the composer package](https://packagist.org/packages/onesimus-systems/seed-catalog).

### Examples

[](#examples)

Connect to a database:

```
# initialize the connection
# connect() will return false if connecting to the database fails.
# connect($dbtype, $host, $database, $username, $password)

$SC = new SC\SC();
$SC->connect('mysql', 'localhost', 'example', 'username', 'password');

# you can also give it a PDO object to use directly

$SC = new SC\SC($pdo);
```

Work with records:

```
# read user 1
$SC->readItem('user', 1);
# update the username of user 1
$SC->updateItem('user', 1, ['username' => 'john.doe']);
# create a user
$SC->createItem('user', ['username' => 'jane.doe', 'email' => 'jane@example.com']);
# delete user 1
$SC->deleteItem('user', 1);
```

Work with collections:

```
# read all users
$SC->find('user')->read();
# read the users that are marked as verified in a desc order
$SC->find('user')->whereEqual('is_verified', 1)->orderDesc('id')->read();
# read the user with the most reputation
$SC->find('user')->limit(1)->orderDesc('reputation')->readRecord();
# mark users 1 and 3 as verified
$SC->find('user')->whereIn('id', [1, 3])->update(['is_verified' => 1]);
# count the users that don't have a location
$SC->find('user')->whereNull('location')->count();
# plain sql conditions are also supported
$SC->find('user')->where('is_verified = ?', [1])->read();
```

Handle relationships:

```
# read the users that have a featured post
$SC->find('user')->has('post')->whereEqual('post.is_featured', 1)->read();
# read the posts of user 1
$SC->find('post')->belongsTo('user')->whereEqual('user.id', 1)->read();
# read the posts that are tagged "php"
$SC->find('post')->hasAndBelongsTo('tag')->whereEqual('tag.name', 'php')->read();
# unconventional FK names are also supported
$SC->find('user')->has('post', 'author_id')->whereEqual('user.id', 1)->read();
```

Execute queries:

```
# read all users
$SC->read('SELECT * FROM user');
# read user 1
$SC->readRecord('SELECT * FROM user WHERE id = ?', [1]);
# read the username of user 1
$SC->readField('SELECT username FROM user WHERE id = ?', [1]);
# read all usernames
$SC->readFields('SELECT username FROM user');
# update all users
$SC->update('UPDATE INTO user SET is_verified = ?', [1]);
```

### Notes

[](#notes)

- Relationship methods require that table names are singular - ex: `user` instead of `users`.
- Only tested with MySQL. It may work with Postgres and SQLite, but I haven't tested it yet.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 85.4% of commits — single point of failure

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

Total

5

Last Release

3895d ago

Major Versions

0.2.0 → 1.0.02015-06-18

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/61299877?v=4)[dragonrider23](/maintainers/dragonrider23)[@DragonRider23](https://github.com/DragonRider23)

---

Top Contributors

[![erusev](https://avatars.githubusercontent.com/u/184170?v=4)](https://github.com/erusev "erusev (111 commits)")[![lfkeitel](https://avatars.githubusercontent.com/u/6619743?v=4)](https://github.com/lfkeitel "lfkeitel (18 commits)")[![hkdobrev](https://avatars.githubusercontent.com/u/506129?v=4)](https://github.com/hkdobrev "hkdobrev (1 commits)")

---

Tags

databaseormpdo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/onesimus-systems-seed-catalog/health.svg)

```
[![Health](https://phpackages.com/badges/onesimus-systems-seed-catalog/health.svg)](https://phpackages.com/packages/onesimus-systems-seed-catalog)
```

###  Alternatives

[bephp/activerecord

micro activerecord library in PHP(only 400 lines with comments), support chain calls and relations(HAS\_ONE, HAS\_MANY, BELONGS\_TO).

1202.1k2](/packages/bephp-activerecord)[flightphp/active-record

Micro Active Record library in PHP, support chain calls, events, and relations.

163.6k11](/packages/flightphp-active-record)

PHPackages © 2026

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