-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add data soruces for no-primary-key testing
- Loading branch information
Paul M. Jones
committed
Sep 7, 2020
1 parent
a6b13be
commit 543bd32
Showing
16 changed files
with
256 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/vendor | ||
/composer.lock | ||
/atlas-testing.sq3 | ||
/atlas-testing.php | ||
/atlas-config.php | ||
/atlas-sqlite.sq3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Atlas\Testing\DataSource\Nopkey; | ||
|
||
use Atlas\Mapper\Mapper; | ||
use Atlas\Table\Row; | ||
|
||
/** | ||
* @method NopkeyTable getTable() | ||
* @method NopkeyRelationships getRelationships() | ||
* @method NopkeyRecord|null fetchRecord($primaryVal, array $with = []) | ||
* @method NopkeyRecord|null fetchRecordBy(array $whereEquals, array $with = []) | ||
* @method NopkeyRecord[] fetchRecords(array $primaryVals, array $with = []) | ||
* @method NopkeyRecord[] fetchRecordsBy(array $whereEquals, array $with = []) | ||
* @method NopkeyRecordSet fetchRecordSet(array $primaryVals, array $with = []) | ||
* @method NopkeyRecordSet fetchRecordSetBy(array $whereEquals, array $with = []) | ||
* @method NopkeySelect select(array $whereEquals = []) | ||
* @method NopkeyRecord newRecord(array $fields = []) | ||
* @method NopkeyRecord[] newRecords(array $fieldSets) | ||
* @method NopkeyRecordSet newRecordSet(array $records = []) | ||
* @method NopkeyRecord turnRowIntoRecord(Row $row, array $with = []) | ||
* @method NopkeyRecord[] turnRowsIntoRecords(array $rows, array $with = []) | ||
*/ | ||
class Nopkey extends Mapper | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Atlas\Testing\DataSource\Nopkey; | ||
|
||
use Atlas\Mapper\Mapper; | ||
use Atlas\Mapper\MapperEvents; | ||
use Atlas\Mapper\Record; | ||
use Atlas\Query\Delete; | ||
use Atlas\Query\Insert; | ||
use Atlas\Query\Update; | ||
use PDOStatement; | ||
|
||
class NopkeyEvents extends MapperEvents | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
/** | ||
* This file was generated by Atlas. Changes will be overwritten. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Atlas\Testing\DataSource\Nopkey; | ||
|
||
/** | ||
* @property mixed $name VARCHAR(255) | ||
* @property mixed $email VARCHAR(255) | ||
*/ | ||
trait NopkeyFields | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Atlas\Testing\DataSource\Nopkey; | ||
|
||
use Atlas\Mapper\Record; | ||
|
||
/** | ||
* @method NopkeyRow getRow() | ||
*/ | ||
class NopkeyRecord extends Record | ||
{ | ||
use NopkeyFields; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Atlas\Testing\DataSource\Nopkey; | ||
|
||
use Atlas\Mapper\RecordSet; | ||
|
||
/** | ||
* @method NopkeyRecord offsetGet($offset) | ||
* @method NopkeyRecord appendNew(array $fields = []) | ||
* @method NopkeyRecord|null getOneBy(array $whereEquals) | ||
* @method NopkeyRecordSet getAllBy(array $whereEquals) | ||
* @method NopkeyRecord|null detachOneBy(array $whereEquals) | ||
* @method NopkeyRecordSet detachAllBy(array $whereEquals) | ||
* @method NopkeyRecordSet detachAll() | ||
* @method NopkeyRecordSet detachDeleted() | ||
*/ | ||
class NopkeyRecordSet extends RecordSet | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Atlas\Testing\DataSource\Nopkey; | ||
|
||
use Atlas\Mapper\MapperRelationships; | ||
|
||
class NopkeyRelationships extends MapperRelationships | ||
{ | ||
protected function define() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
/** | ||
* This file was generated by Atlas. Changes will be overwritten. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Atlas\Testing\DataSource\Nopkey; | ||
|
||
use Atlas\Table\Row; | ||
|
||
/** | ||
* @property mixed $name VARCHAR(255) | ||
* @property mixed $email VARCHAR(255) | ||
*/ | ||
class NopkeyRow extends Row | ||
{ | ||
protected $cols = [ | ||
'name' => null, | ||
'email' => null, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Atlas\Testing\DataSource\Nopkey; | ||
|
||
use Atlas\Mapper\MapperSelect; | ||
|
||
/** | ||
* @method NopkeyRecord|null fetchRecord() | ||
* @method NopkeyRecord[] fetchRecords() | ||
* @method NopkeyRecordSet fetchRecordSet() | ||
*/ | ||
class NopkeySelect extends MapperSelect | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
/** | ||
* This file was generated by Atlas. Changes will be overwritten. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Atlas\Testing\DataSource\Nopkey; | ||
|
||
use Atlas\Table\Table; | ||
|
||
/** | ||
* @method NopkeyRow|null fetchRow($primaryVal) | ||
* @method NopkeyRow[] fetchRows(array $primaryVals) | ||
* @method NopkeyTableSelect select(array $whereEquals = []) | ||
* @method NopkeyRow newRow(array $cols = []) | ||
* @method NopkeyRow newSelectedRow(array $cols) | ||
*/ | ||
class NopkeyTable extends Table | ||
{ | ||
const DRIVER = 'sqlite'; | ||
|
||
const NAME = 'nopkeys'; | ||
|
||
const COLUMNS = [ | ||
'name' => [ | ||
'name' => 'name', | ||
'type' => 'VARCHAR', | ||
'size' => 255, | ||
'scale' => null, | ||
'notnull' => false, | ||
'default' => null, | ||
'autoinc' => false, | ||
'primary' => false, | ||
'options' => null, | ||
], | ||
'email' => [ | ||
'name' => 'email', | ||
'type' => 'VARCHAR', | ||
'size' => 255, | ||
'scale' => null, | ||
'notnull' => false, | ||
'default' => null, | ||
'autoinc' => false, | ||
'primary' => false, | ||
'options' => null, | ||
], | ||
]; | ||
|
||
const COLUMN_NAMES = [ | ||
'name', | ||
'email', | ||
]; | ||
|
||
const COLUMN_DEFAULTS = [ | ||
'name' => null, | ||
'email' => null, | ||
]; | ||
|
||
const PRIMARY_KEY = [ | ||
]; | ||
|
||
const AUTOINC_COLUMN = null; | ||
|
||
const AUTOINC_SEQUENCE = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Atlas\Testing\DataSource\Nopkey; | ||
|
||
use Atlas\Query\Delete; | ||
use Atlas\Query\Insert; | ||
use Atlas\Query\Select; | ||
use Atlas\Query\Update; | ||
use Atlas\Table\Row; | ||
use Atlas\Table\Table; | ||
use Atlas\Table\TableEvents; | ||
use PDOStatement; | ||
|
||
class NopkeyTableEvents extends TableEvents | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Atlas\Testing\DataSource\Nopkey; | ||
|
||
use Atlas\Table\TableSelect; | ||
|
||
/** | ||
* @method NopkeyRow|null fetchRow() | ||
* @method NopkeyRow[] fetchRows() | ||
*/ | ||
class NopkeyTableSelect extends TableSelect | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters