This project is not covered by Drupal’s security advisory policy.

Description

SADB is a StandAlone DataBase connection helper, allow modules to connect to the databases other than mentioned in the settings.php.

Usage 1

Connect to a user entered database.

Usage 2

Create and use a sqlite database for each user, each node ...

Example 1 : Minimum for SQLite DB connection.

use Drupal\sadb\Database\DatabaseSA;
    $settings = array(
      'database' => 'public://.ht.test.sqlite',
      'driver' => 'sqlite',
    );
    $con = (new DatabaseSA($settings))->getConnection();

Example 2 : Minimum for MySQL DB connection.

use Drupal\sadb\Database\DatabaseSA;
    $settings = array(
      'database' => 'my_other_db',
      'username' => 'root',
      'driver' => 'mysql',
    );
    $con = (new DatabaseSA($settings))->getConnection();

Example 3 : Another MySQL DB connection.

use Drupal\sadb\Database\DatabaseSA;
    $settings = array(
      'database' => 'my_other_db',
      'username' => 'root',
      'password' => 'thepassword',
      'prefix' => 'mytabs_',
      'host' => '127.0.0.1',
      'port' => '33066',
      'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
      'driver' => 'mysql',
    );
    $con = (new DatabaseSA($settings))->getConnection();

Project information

  • caution Seeking new maintainer
    The current maintainers are looking for new people to take ownership.
  • Created by nuwans on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases