'options' => [
PDO::ATTR_PERSISTENT => true,
],
+ 'tables' => [],
+ 'types' => [
+ 'exec' => [
+ 'PRAGMA busy_timeout = 1000',
+ 'PRAGMA synchronous=NORMAL',
+ 'PRAGMA journal_mode=MEMORY',
+ ],
+ ],
];
-$CONF['all']['tables'] = [];
-$CONF['all']['types']['exec'] = [];
foreach ($CONF as $id => $db) {
if (0
or empty($db['type'] )
+++ /dev/null
-<?php
-return;
-###############################################################################
-#
-# - NB 03.09.16
-# Create a big sqlite memory database with attach
-#
-###############################################################################
-require_once dirname(__FILE__).'/../../lib/php/config.php';
-require_once dirname(__FILE__).'/../dbs.php';
-
-$CONF['all'] = array(
- 'host' => ':memory:',
- 'type' => 'sqlite',
- #'order' => '0',
- 'options' => [
- PDO::ATTR_PERSISTENT => true,
- ],
- 'types' => [
- 'exec' => [
- 'PRAGMA synchronous=NORMAL',
- 'PRAGMA journal_mode=MEMORY',
- ]
- ],
-);
-$attach = [];
-foreach ([
- '/opt/www/sem_ui/var/db/semantico.db',
- '/dev/shm/crypt.db',
-] as $file) {
- if (file_exists($file)) $attach[] = $file;
-}
-
-foreach (nb::ls_dir($DIR_SQLITE,'\.db$') as $file) {
- $attach[] = "$DIR_SQLITE/$file";
-}
-
-# nb last to win the merge
-usort($attach,function($a,$b){
- if ( strpos($a,'/nb.db') !== false ) return 1;
- if ( strpos($b,'/nb.db') !== false ) return -1;
- return strcmp($a,$b);
- return 0;
-});
-if (!$attach) return;
-
-$CONF['all']['_import'] = [];
-if (nb::p('debug')=='all') debug($attach);
-
-foreach ($attach as $file) {
- if (!is_readable($file)) continue;
-
- $name = basename($file,'.db');
- $CONF['all']['types']['exec'][] = "ATTACH DATABASE '$file' as $name";
- #$CONF['all']['_import'][] = $name;
-}
-$CONF['all']['_import'][] = 'rent';
-#bye($CONF['all']['default_table']);
-
-#$CONF['all']['default_table'] = 'rent';
-#debug($CONF['all']);
-?>