conexao
<?php require_once 'vendor/autoload.php'; $caminhoBanco = DIR . '/banco.sqlite'; $pdo = new PDO('sqlite:'. $caminhoBanco);
$pdo->exec( "CREATE TABLE students (id INTEGER PRIMARY KEY, name TEXT, data TEXT);");
INSERIR ALUNO
<?php use \Alura\Domain\Model\Student; require_once 'vendor/autoload.php';
$databasePath = DIR . '/banco.sqlite'; $pdo = new PDO('sqlite:' . $databasePath);
$student = new Student(null, 'Vinicius Dias', new \DateTimeImmutable('1997-10-15'));
$sqlInsert = "INSERT INTO students ( name , data ) VALUES ('{$student->name()}', '{$student->birthDate()->format( 'Y-m-d')}');";
var_dump($pdo->exec($sqlInsert));