-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c96730
commit e49197d
Showing
16 changed files
with
214 additions
and
172 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
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
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 was deleted.
Oops, something went wrong.
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 | ||
|
||
return [ | ||
|
||
// If not provided, you can use the full path when working with files. | ||
'path' => env('ETL_PATH', base_path('etl')), | ||
|
||
// Currently supported databases: SQLite, MySQL, PostgreSQL | ||
'database' => [ | ||
|
||
'default' => config('database.default'), | ||
|
||
'connections' => config('database.connections'), | ||
], | ||
|
||
]; |
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,34 @@ | ||
<?php | ||
|
||
namespace Marquine\Etl\Traits; | ||
|
||
use Marquine\Etl\Etl; | ||
use Marquine\Etl\Database\Connectors\ConnectionFactory; | ||
|
||
|
||
trait Database | ||
{ | ||
/** | ||
* Database connection. | ||
* | ||
* @var \Marquine\Etl\Database\Connection | ||
*/ | ||
protected $db; | ||
|
||
/** | ||
* Validate the given source. | ||
* | ||
* @param string $source | ||
* @return string | ||
*/ | ||
protected function connect($connection) | ||
{ | ||
if ($connection == 'default') { | ||
$connection = Etl::config('database.default'); | ||
} | ||
|
||
$connection = Etl::config("database.connections.$connection"); | ||
|
||
$this->db = ConnectionFactory::make($connection); | ||
} | ||
} |
Oops, something went wrong.