GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - attogram/database: SQLite database access for PHP 7. Small, one class, and highly opinionated.

BranchesTags
Open more actions menu

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
src
src
 
 
.codeclimate.yml
.codeclimate.yml
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
TODO.md
TODO.md
 
 
composer.json
composer.json
 
 
composer.lock
composer.lock
 
 

Repository files navigation

Attogram Database

SQLite database access for PHP 7. Small, one class, and highly opinionated.

Maintainability Build Status Latest Stable Version

Install

composer require attogram/database

Examples

one table:

declare(strict_types = 1);

use Attogram\Database\Database;

require '../vendor/autoload.php';

$database = new Database();
$database->setDatabaseFile('./test.one.sqlite');
$database->setCreateTables("CREATE TABLE 'one' ('foo' TEXT)");

try {
    $database->raw("INSERT INTO one ('foo') VALUES (CURRENT_TIMESTAMP)");
    $arrayResults = $database->query("SELECT * FROM 'one'");
    print_r($arrayResults);
} catch (Throwable $error) {
    print 'ERROR: ' . $error->getMessage();
}

two tables:

declare(strict_types = 1);

use Attogram\Database\Database;

require '../vendor/autoload.php';

$database = new Database();
$database->setDatabaseFile('./test.two.sqlite');

$tables = [
    "CREATE TABLE 'one' ('foo' TEXT)",
    "CREATE TABLE 'two' ('bar' TEXT)",
];
$database->setCreateTables($tables);

try {
    $database->raw("INSERT INTO one ('foo') VALUES (CURRENT_TIMESTAMP)");
    $database->raw("INSERT INTO two ('bar') VALUES (CURRENT_TIMESTAMP)");
    $arrayResults = $database->query("SELECT * FROM 'one'");
    print_r($arrayResults);
    $arrayResults = $database->query("SELECT * FROM 'two'");
    print_r($arrayResults);
} catch (Throwable $error) {
    print 'ERROR: ' . $error->getMessage();
}

About

SQLite database access for PHP 7. Small, one class, and highly opinionated.

attogram.github.io/database/

Topics

php-database-classphp-database-connectionphp7sqlite

Resources

Readme
License
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.