Enhanced PostgresSQL Driver for Laravel
Published on by Paul Redmond
Laravel PostgreSQL Enhanced is a package by Tobias Petry that offers many missing PostgreSQL-specific features to Laravel:
I finished a large chunk on improving the enhanced @PostgreSQL driver for @laravelphp. The new version has a lot of new indexing functionality to make your database queries really fast and use all the power of PostgreSQL 🔥
— Tobias Petry (@tobias_petry) September 21, 2021
👇 All new features explained one-by-one pic.twitter.com/jHNoEfdhlV
While in some applications, you want to support multiple database drivers using Eloquent, this package can offer additional features if you're going to opt-in to making your application PostgreSQL-specific.
This package offers various index features, such as partial index support, include columns, index storage parameters. For example, the partial index support feature could be helpful when you have a table with a unique value (i.e., email) and you want to index to ignore rows with soft deletes:
Schema::table('users', function(Blueprint $table) { $table ->uniqueIndex('email') ->partial("deleted_at IS NULL");});
Besides these features, the package includes multiple column types that are available in PostgreSQL:
- Bit Strings
- Case-insensitive text (i.e., emails)
- Hstore
- IP Networks
- International Product Numbers
- Label Tree
- Ranges
- XML
I'd recommend checking out the readme for details on all the features this package provides. You can learn more about this package, get full installation instructions, and view the source code on GitHub.