SQLite3 클래스
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
소개
SQLite 3 데이터베이스를 인터페이스하는 클래스입니다.
클래스 개요
class SQLite3 {
/* Methods */
public __construct(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = "")
public backup(SQLite3 $destination, string $sourceDatabase = "main", string $destinationDatabase = "main"): bool
public busyTimeout(int $milliseconds): bool
public changes(): int
public close(): bool
public createAggregate(
string $name,
callable $stepCallback,
callable $finalCallback,
int $argCount = -1
): bool
public createCollation(string $name, callable $callback): bool
public createFunction(
string $name,
callable $callback,
int $argCount = -1,
int $flags = 0
): bool
public enableExceptions(bool $enable = false): bool
public static escapeString(string $string): string
public exec(string $query): bool
public lastErrorCode(): int
public lastErrorMsg(): string
public lastInsertRowID(): int
public loadExtension(string $name): bool
public open(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = ""): void
public openBlob(
string $table,
string $column,
int $rowid,
string $database = "main",
int $flags = SQLITE3_OPEN_READONLY
): resource|false
public prepare(string $query): SQLite3Stmt|false
public query(string $query): SQLite3Result|false
public querySingle(string $query, bool $entireRow = false): mixed
public setAuthorizer(?callable $callback): bool
public static version(): array
}
목차
- SQLite3::backup — 한 데이터베이스를 다른 데이터베이스에 백업
- SQLite3::busyTimeout — 사용 중인 연결 핸들러를 설정합니다.
- SQLite3::changes — 가장 최근의 SQL 문에 의해 변경(또는 삽입 또는 삭제)된 데이터베이스 행의 수를 반환합니다.
- SQLite3::close — 데이터베이스 연결을 닫습니다
- SQLite3::__construct — SQLite3 개체를 인스턴스화하고 SQLite 3 데이터베이스를 엽니다.
- SQLite3::createAggregate — SQL 집계 함수로 사용할 PHP 함수를 등록합니다.
- SQLite3::createCollation — SQL 조합 함수로 사용할 PHP 함수를 등록합니다.
- SQLite3::createFunction — SQL 스칼라 함수로 사용할 PHP 함수를 등록합니다.
- SQLite3::enableExceptions — 예외 발생 사용
- SQLite3::escapeString — 적절하게 이스케이프된 문자열을 반환합니다.
- SQLite3::exec — 주어진 데이터베이스에 대해 결과 없는 쿼리를 실행합니다.
- SQLite3::lastErrorCode — 가장 최근에 실패한 SQLite 요청의 숫자 결과 코드를 반환합니다.
- SQLite3::lastErrorMsg — 가장 최근에 실패한 SQLite 요청을 설명하는 영어 텍스트를 반환합니다.
- SQLite3::lastInsertRowID — 데이터베이스에 가장 최근 INSERT의 행 ID를 반환합니다.
- SQLite3::loadExtension — SQLite 확장 라이브러리 로드 시도
- SQLite3::open — SQLite 데이터베이스를 엽니다.
- SQLite3::openBlob — BLOB를 읽기 위해 스트림 리소스를 엽니다.
- SQLite3::prepare — 실행을 위해 SQL 문 준비
- SQLite3::query — SQL 쿼리를 실행합니다.
- SQLite3::querySingle — 쿼리를 실행하고 단일 결과를 반환합니다.
- SQLite3::setAuthorizer — 명령문이 수행할 수 있는 작업을 제한하는 권한 부여자로 사용할 콜백을 구성합니다.
- SQLite3::version — SQLite3 라이브러리 버전을 문자열 상수 및 숫자로 반환합니다.