PHPackages                             piotr-cz/cockpit-sql-driver - 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. piotr-cz/cockpit-sql-driver

ActiveCockpit-module[Database &amp; ORM](/categories/database)

piotr-cz/cockpit-sql-driver
===========================

SQL Driver for Cockpit CMS

v1.0.0(5y ago)34255↓100%6[1 issues](https://github.com/piotr-cz/cockpit-sql-driver/issues)MITPHPPHP &gt;= 7.1CI failing

Since Sep 16Pushed 4y ago5 watchersCompare

[ Source](https://github.com/piotr-cz/cockpit-sql-driver)[ Packagist](https://packagist.org/packages/piotr-cz/cockpit-sql-driver)[ Docs](https://github.com/piotr-cz/cockpit-sql-driver)[ RSS](/packages/piotr-cz-cockpit-sql-driver/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (10)Used By (0)

SQL Driver for Cockpit CMS
==========================

[](#sql-driver-for-cockpit-cms)

[![Latest Version](https://camo.githubusercontent.com/8ad7d71e9a835a2303bf9d3a3bc0341f427dd7a5cf0a0dd86692c91d4b4e28d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70696f74722d637a2f636f636b7069742d73716c2d6472697665723f7374796c653d666c61742d73717561726526736f72743d73656d766572)](https://packagist.org/packages/piotr-cz/cockpit-sql-driver)[![Build status](https://camo.githubusercontent.com/2943f460658151e82de5d2b6b62a21ac75f23fd8da8fbd0f4e2652bbe8e3ab34/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f70696f74722d637a2f636f636b7069742d73716c2d6472697665723f7374796c653d666c61742d737175617265)](https://travis-ci.org/piotr-cz/cockpit-sql-driver)

This addon allows to use MySQL/ MariaDB/ PostgreSQL databases instead of default MongoDB/ SQLite.

Requirements
------------

[](#requirements)

- Cockpit CMS (next, tested up to v0.11.0 or legacy)
- MySQL 5.7.9/ MariaDB 10.2.6/ PostgreSQL 9.4
- PHP 7.1
- Enabled PHP extensions: *pdo*, *pdo\_mysql*/ *pdo\_pgsql*

### Compatibility

[](#compatibility)

To run Cockpit `0.9.2+` at least version `1.0.0-beta.2+` is required.

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

[](#installation)

*Note:*

If you installed addon before ever starting Cockpit, [some errors](#error-call-to-a-member-function-toarray-on-null) may come up once you start it.

To solve it, start Cockpit with database configuration it supports [out of the box](https://getcockpit.com/documentation/reference/configuration) to trigger Cockpit warmup and then set [configuration](#configuration) specific for this addon.

### Manual

[](#manual)

Download [latest release](https://github.com/piotr-cz/cockpit-sql-driver/releases/latest) and extract to `COCKPIT_PATH/addons/SqlDriver` directory

### Using Cockpit CLI *(development version)*

[](#using-cockpit-cli-development-version)

```
./cp install/addon --name SqlDriver --url https://github.com/piotr-cz/cockpit-sql-driver/archive/master.zip
```

### Using Composer

[](#using-composer)

1. Make sure path to cockpit addons are defined in your projects' *composer.json* file

    ```
    {
        "name": "MY_PROJECT",
        "extra": {
            "installer-paths": {
                "public/cockpit/addons/{$name}": ["type:cockpit-module"]
            }
        }
    }
    ```
2. In your project root run command

    ```
    composer require piotr-cz/cockpit-sql-driver
    ```

Configuration
-------------

[](#configuration)

Example configuration for `COCKPIT_PATH/config/config.php` file:

```
