-
Notifications
You must be signed in to change notification settings - Fork 0
/
maestro.php
41 lines (31 loc) · 1.23 KB
/
maestro.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require_once('./vendor/autoload.php');
// use Ilias\Maestro\Database\Delete;
// use Ilias\Maestro\Core\Maestro;
use Ilias\Maestro\Core\Manager;
// use Ilias\Maestro\Database\Insert;
// use Ilias\Maestro\Database\Connection;
// use Ilias\Maestro\Database\Select;
// use Ilias\Maestro\Types\Timestamp;
// use Ilias\Maestro\Utils\Utils;
use Maestro\Example\MaestroDb;
use Maestro\Example\Post;
use Maestro\Example\User;
$coreDatabase = new Manager();
$agrofastDB = new MaestroDb();
// new User("nickname", "email", "password", true, new Timestamp());
print implode("\n", $coreDatabase->createDatabase($agrofastDB, false)) . "\n";
// var_dump(
// User::tableCreationInfo()
// );
// var_dump(
// Post::tableCreationInfo()
// );
// $insert = new Insert(Maestro::SQL_NO_PREDICT, Connection::get());
// $user = new User("nickname'-- drop table", 'John', 'Doe', 'email@example.com', 'password', true, new Timestamp());
// $result = $insert->into($user)->values($user)->returning(['id'])->execute();
// var_dump($result);
// $delete = new Delete(Maestro::SQL_NO_PREDICT, Connection::get());
// $delete->from($user)->where(['id' => $result[0]['id']])->execute();
// $where = ["teste" => null];
// var_dump( implode(" teste ", $where), empty($where));