laravel-postgres-extended-schema maintained by emiliopedrollo
- ext-pdo *
- php ^8.0.2
- ramsey/uuid ^4.0
- illuminate/database ^12.0 || ^13.0
- php ^8.0.2
- ext-pdo *
- illuminate/database ^12.0 || ^13.0
- ramsey/uuid ^4.0
- php ^8.0.2
- ext-pdo *
- illuminate/database ^12.0
- ramsey/uuid ^4.0
- php ^8.0.2
- ext-pdo *
- illuminate/database ^12.0
- ramsey/uuid ^4.0
- php ^8.0.2
- ext-pdo *
- illuminate/database ^12.0
- ramsey/uuid ^4.0
- php ^8.0.2
- ext-pdo *
- illuminate/database ^9.0|^10.0|^11.0
- ramsey/uuid ^3.9.2|^4.0
- doctrine/dbal ^2.12|^3.0
- php ^8.0.2
- ext-pdo *
- illuminate/database ^9.0|^10.0|^11.0
- ramsey/uuid ^3.9.2|^4.0
- doctrine/dbal ^2.12|^3.0
- php ^8.0.2
- ext-pdo *
- illuminate/database ^9.0|^10.0|^11.0
- ramsey/uuid ^3.9.2|^4.0
- doctrine/dbal ^2.12|^3.0
- php ^8.0.2
- ext-pdo *
- illuminate/database ^9.0|^10.0
- ramsey/uuid ^3.9.2|^4.0
- doctrine/dbal ^2.12|^3.0
- php ^8.0.2
- ext-pdo *
- illuminate/database ^9.0|^10.0
- ramsey/uuid ^3.9.2|^4.0
- doctrine/dbal ^2.12|^3.0
- php ^8.0.2
- ext-pdo *
- illuminate/database ^9.0|^10.0
- ramsey/uuid ^3.9.2|^4.0
- doctrine/dbal ^2.12|^3.0
- php ^7.3|^8.0
- ext-pdo *
- illuminate/database ^7.0|^8.0|^9.0|^10.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5|^3.0
- php ^7.3|^8.0
- ext-pdo *
- illuminate/database ^7.0|^8.0|^9.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5|^3.0
- php ^7.3|^8.0
- ext-pdo *
- illuminate/database ^7.0|^8.0|^9.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5|^3.0
- php ^7.3|^8.0
- ext-pdo *
- illuminate/database ^7.0|^8.0|^9.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5|^3.0
- php ^7.3|^8.0
- ext-pdo *
- illuminate/database ^7.0|^8.0|^9.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5|^3.0
- php ^7.3|^8.0
- ext-pdo *
- illuminate/database ^7.0|^8.0|^9.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5|^3.0
- php ^7.3|^8.0
- ext-pdo *
- illuminate/database ^7.0|^8.0|^9.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5|^3.0
- php ^7.3|^8.0
- ext-pdo *
- illuminate/database ^7.0|^8.0|^9.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5|^3.0
- php ^7.3
- ext-pdo *
- illuminate/database ^7.0|^8.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5|^3.0
- php ^7.3
- ext-pdo *
- illuminate/database ^7.0|^8.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5|^3.0
- php ^7.3
- ext-pdo *
- illuminate/database ^7.0|^8.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5
- php ^7.3
- ext-pdo *
- illuminate/database ^6.0|^7.0|^8.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5
- php ^7.3
- ext-pdo *
- illuminate/database ^6.0|^7.0|^8.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5
- php >=7.2
- ext-pdo *
- illuminate/database ^6.0|^7.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5
- php >=7.2
- ext-pdo *
- illuminate/database ^6.0|^7.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5
- php >=7.2
- ext-pdo *
- illuminate/database ^6.0|^7.0
- ramsey/uuid ^3.0|^4.0
- doctrine/dbal ^2.5
- php >=7.2
- ext-pdo *
- illuminate/database ^6.0
- ramsey/uuid ^3.0
- doctrine/dbal ^2.5
- php >=7.2
- ext-pdo *
- illuminate/database ^6.0
- ramsey/uuid ^3.0
- doctrine/dbal ^2.5
- php >=7.2
- ext-pdo *
- illuminate/database ^6.0
- ramsey/uuid ^3.0
- doctrine/dbal ^2.5
- php >=7.2
- ext-pdo *
- illuminate/database ~5.7.0|~5.8.0|^6.0
- ramsey/uuid ^3.0
- doctrine/dbal ^2.5
- php >=7.2
- ext-pdo *
- illuminate/database ~5.7.0|~5.8.0|^6.0
- ramsey/uuid ^3.0
- doctrine/dbal ^2.5
- php >=7.2
- ext-pdo *
- illuminate/database ~5.7.0|~5.8.0|^6.0
- ramsey/uuid ^3.0
- doctrine/dbal ^2.5
- php >=7.2
- ext-pdo *
- illuminate/database ~5.7.0|~5.8.0|^6.0
- ramsey/uuid ^3.0
- doctrine/dbal ^2.5
- php >=7.2
- illuminate/database ~5.7.0|~5.8.0|^6.0
- ramsey/uuid ^3.0
- doctrine/dbal ^2.5
- php >=7.2
- illuminate/database ~5.7.0|~5.8.0|^6.0
- ramsey/uuid ^3.0
- doctrine/dbal ^2.5
- php >=5.6
- illuminate/database ^5.0
- ramsey/uuid ^3.0
- doctrine/dbal ^2.5
- php >=5.4
- illuminate/database ^5.0
- ramsey/uuid ^3.0
- doctrine/dbal ^2.5
- php >=5.4
- illuminate/database ~5.0
- ramsey/uuid ~3.0
- php >=5.4
- illuminate/database ~5.0
- ramsey/uuid ~3.0
- php >=5.4
- illuminate/database ~5.0
- ramsey/uuid ~3.0
- php >=5.4
- illuminate/database ~5.0
- ramsey/uuid ~3.0
- php >=5.4
- illuminate/database ~5.0
- ramsey/uuid ~3.0
- php >=5.4
- illuminate/database ~5.0
- ramsey/uuid ~2.8
- php >=5.4
- illuminate/database ~5.0
- ramsey/uuid ~2.8
- php >=5.4.0
- illuminate/support 5.*
- rhumsaa/uuid ~2.8
- php >=5.4.0
- illuminate/support 5.*
- rhumsaa/uuid ~2.8
- php >=5.4.0
- illuminate/support 5.*
- rhumsaa/uuid ~2.8
- php >=5.4.0
- illuminate/support 5.*
- rhumsaa/uuid ~2.8
- php >=5.4.0
- illuminate/support 5.*
- php >=5.4.0
- illuminate/support 5.*
- php >=5.4.0
- illuminate/support 5.*
- php >=5.4.0
- illuminate/support 5.*
- php >=5.4.0
- illuminate/support 5.*
- php >=5.4.0
- illuminate/support 5.*
Laravel Postgres Extended
Introduction
An extended PostgreSQL driver for Laravel 9+ with support for some aditional PostgreSQL data types: hstore, uuid, geometric types (point, path, circle, line, polygon...) and support for WITH [RECURSIVE] clause
Installation
Simple run composer require emiliopedrollo/laravel-postgres-extended-schema in your project root directory.
Then you are done.
Usage
SELECT Queries
Use withExpression() and provide a query builder instance, an SQL string or a closure:
$posts = DB::table('p')
->select('p.*', 'u.name')
->withExpression('p', DB::table('posts'))
->withExpression('u', function ($query) {
$query->from('users');
})
->join('u', 'u.id', '=', 'p.user_id')
->get();
Use withRecursiveExpression() for recursive expressions:
$query = DB::table('users')
->whereNull('parent_id')
->unionAll(
DB::table('users')
->select('users.*')
->join('tree', 'tree.id', '=', 'users.parent_id')
);
$tree = DB::table('tree')
->withRecursiveExpression('tree', $query)
->get();
You can provide the expression's columns as the third argument:
$query = 'select 1 union all select number + 1 from numbers where number < 10';
$numbers = DB::table('numbers')
->withRecursiveExpression('numbers', $query, ['number'])
->get();
INSERT/UPDATE/DELETE Queries
You can use common table expressions in INSERT, UPDATE and DELETE queries:
DB::table('profiles')
->withExpression('u', DB::table('users')->select('id', 'name'))
->insertUsing(['user_id', 'name'], DB::table('u'));
DB::table('profiles')
->withExpression('u', DB::table('users'))
->join('u', 'u.id', '=', 'profiles.user_id')
->update(['profiles.name' => DB::raw('u.name')]);
DB::table('profiles')
->withExpression('u', DB::table('users')->where('active', false))
->whereIn('user_id', DB::table('u')->select('id'))
->delete();
Eloquent
You can use common table expressions in Eloquent queries.
$query = User::whereNull('parent_id')
->unionAll(
User::select('users.*')
->join('tree', 'tree.id', '=', 'users.parent_id')
);
$tree = User::from('tree')
->withRecursiveExpression('tree', $query)
->get();
Recursive Relationships
If you want to implement recursive relationships, you can use this package: staudenmeir/laravel-adjacency-list