PHPackages                             lorddashme/wordpress-db-schema-extender - 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. lorddashme/wordpress-db-schema-extender

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

lorddashme/wordpress-db-schema-extender
=======================================

A WordPress Database extender that provides a nice structure of table schema and data seeds.

1.1.0(7y ago)27211MITPHPPHP &gt;=5.6 || &gt;=7.0 || &gt;=7.1

Since Aug 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/LordDashMe/wordpress-db-schema-extender)[ Packagist](https://packagist.org/packages/lorddashme/wordpress-db-schema-extender)[ Docs](https://github.com/lorddashme/wp-db-schema-extender)[ RSS](/packages/lorddashme-wordpress-db-schema-extender/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (1)

WP DB Schema Extender
=====================

[](#wp-db-schema-extender)

A WordPress Database extender that provides a nice structure of table schema and data seeds.

[![Latest Stable Version](https://camo.githubusercontent.com/4578925424753cb939007844a9841fb8f82e1e20355f33debfd8be9a48df3d28/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4c6f7264446173684d652f776f726470726573732d64622d736368656d612d657874656e6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/LordDashMe/wordpress-db-schema-extender) [![Minimum PHP Version](https://camo.githubusercontent.com/86e7d829a466cacd5658a22073e27d49d39dac72cc18216ac4963ed5463c5bbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/) [![Coverage Status](https://camo.githubusercontent.com/29685bff1ca93f8b39fe426a635168c595bf57f79998f0a048cf3290e7e4b765/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f4c6f7264446173684d652f776f726470726573732d64622d736368656d612d657874656e6465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/LordDashMe/wordpress-db-schema-extender?branch=master)

Requirement(s)
--------------

[](#requirements)

- PHP version from 5.6.\* up to latest.

Install
-------

[](#install)

- It is advice to install the package via Composer. Use the command below to install the package:

```
composer require lorddashme/wordpress-db-schema-extender
```

Usage
-----

[](#usage)

- You can start using the package without any configuration needed.
- Below are the available functions:

FunctionDescription![]()![]()`table('tableName', closure);`Use to create table structure.`column('columnName', 'statement');`In the `table(...)` function second argument, the closure return an instance that allow you to use this function. This fucntion add the definition of your column that will be add to table.`primaryKey('columnName');`Also same with the `column(...)` function you can use this function via `table(...)` function second argument closure. This function add primary key to the table base on the given column name.`tableSeed('tableName', closure or array);`Use to seed data to the given table name.`tableName('tableName');`The return value of this function is concatenated with the wordpress table prefix setup in the config file.`rawQuery('statement');`Use to provide other sql query statement. Of course not all of the sql query is wrapped to this package that is why this function is provided to still allow you to do anything what you want.`migrate();`Use to commit all the declared statement.`dropTable('tableName');`Use to drop a single table.`dropTables(['tableName', ...]);`Use to drop a multiple tables.- Below are the sample implementation:

```
