modifs.mineures sans commentaires
This commit is contained in:
parent
6a0838d4fa
commit
2d8a19e232
|
@ -72,8 +72,8 @@ class Sqlite {
|
||||||
function open(): self {
|
function open(): self {
|
||||||
if ($this->db === null) {
|
if ($this->db === null) {
|
||||||
$this->db = new SQLite3($this->file, $this->flags, $this->encryptionKey);
|
$this->db = new SQLite3($this->file, $this->flags, $this->encryptionKey);
|
||||||
SqliteConfig::with($this->config)->configure($this);
|
_Config::with($this->config)->configure($this);
|
||||||
SqliteMigration::with($this->migration)->migrate($this);
|
_Migration::with($this->migration)->migrate($this);
|
||||||
}
|
}
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ class Sqlite {
|
||||||
|
|
||||||
function exec($sql, ?array $params=null): bool {
|
function exec($sql, ?array $params=null): bool {
|
||||||
$this->open();
|
$this->open();
|
||||||
$query = new SqliteQuery($sql, $params);
|
$query = new _Query($sql, $params);
|
||||||
$db = $this->db;
|
$db = $this->db;
|
||||||
if ($query->useStmt($db, $stmt, $sql)) {
|
if ($query->useStmt($db, $stmt, $sql)) {
|
||||||
try {
|
try {
|
||||||
|
@ -120,7 +120,7 @@ class Sqlite {
|
||||||
|
|
||||||
function get($sql, ?array $params=null, bool $entireRow=false) {
|
function get($sql, ?array $params=null, bool $entireRow=false) {
|
||||||
$this->open();
|
$this->open();
|
||||||
$query = new SqliteQuery($sql, $params);
|
$query = new _Query($sql, $params);
|
||||||
$db = $this->db;
|
$db = $this->db;
|
||||||
if ($query->useStmt($db, $stmt, $sql)) {
|
if ($query->useStmt($db, $stmt, $sql)) {
|
||||||
try {
|
try {
|
||||||
|
@ -153,7 +153,7 @@ class Sqlite {
|
||||||
|
|
||||||
function all($sql, ?array $params=null): iterable {
|
function all($sql, ?array $params=null): iterable {
|
||||||
$this->open();
|
$this->open();
|
||||||
$query = new SqliteQuery($sql, $params);
|
$query = new _Query($sql, $params);
|
||||||
$db = $this->db;
|
$db = $this->db;
|
||||||
if ($query->useStmt($db, $stmt, $sql)) {
|
if ($query->useStmt($db, $stmt, $sql)) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -3,8 +3,8 @@ namespace nur\sery\db\sqlite;
|
||||||
|
|
||||||
use nur\sery\php\func;
|
use nur\sery\php\func;
|
||||||
|
|
||||||
class SqliteConfig {
|
class _Config {
|
||||||
static function with($configs): SqliteConfig {
|
static function with($configs): _Config {
|
||||||
if ($configs instanceof self) return $configs;
|
if ($configs instanceof self) return $configs;
|
||||||
return new static($configs);
|
return new static($configs);
|
||||||
}
|
}
|
|
@ -3,8 +3,8 @@ namespace nur\sery\db\sqlite;
|
||||||
|
|
||||||
use nur\sery\php\func;
|
use nur\sery\php\func;
|
||||||
|
|
||||||
class SqliteMigration {
|
class _Migration {
|
||||||
static function with($migrations): SqliteMigration {
|
static function with($migrations): _Migration {
|
||||||
if ($migrations instanceof self) return $migrations;
|
if ($migrations instanceof self) return $migrations;
|
||||||
return new static($migrations);
|
return new static($migrations);
|
||||||
}
|
}
|
|
@ -6,7 +6,7 @@ use nur\sery\ValueException;
|
||||||
use SQLite3;
|
use SQLite3;
|
||||||
use SQLite3Stmt;
|
use SQLite3Stmt;
|
||||||
|
|
||||||
class SqliteQuery {
|
class _Query {
|
||||||
static function verifix(&$query, ?array &$params=null): void {
|
static function verifix(&$query, ?array &$params=null): void {
|
||||||
if (is_array($query)) {
|
if (is_array($query)) {
|
||||||
throw StateException::not_implemented(); #XXX
|
throw StateException::not_implemented(); #XXX
|
Loading…
Reference in New Issue