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