Download the PHP package mongoose-studio/phobos-framework-database-postgres without Composer

On this page you can find all versions of the php package mongoose-studio/phobos-framework-database-postgres. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phobos-framework-database-postgres

Phobos Framework - PostgreSQL Driver

PHP Version Phobos Framework

Phobos Framework

Driver PostgreSQL para Phobos Framework Database Layer. Aprovecha las características propias de PostgreSQL: schemas reales (search_path), INSERT ... RETURNING para leer el id autogenerado, columnas JSONB mapeadas a arrays de PHP, y claves primarias UUIDv7 generadas en la aplicación.

Características

Instalación

Dependencias

Este driver requiere:

Configuración

1. Registrar el Driver

En tu config/database.php:

2. Variables de Entorno

Opciones de Configuración

Clave Tipo Descripción
host string Servidor PostgreSQL (requerido)
database string Nombre de la base de datos (requerido)
port int Puerto (opcional, por defecto 5432)
username string Usuario
password string Contraseña
sslmode string disable/allow/prefer/require/verify-ca/verify-full
schema string Un único schema para el search_path (ej: app)
search_path string Lista de schemas separada por comas (ej: app,public)
timezone string Zona horaria de la sesión (ej: UTC, America/Santiago)
application_name string Nombre de la aplicación (visible en pg_stat_activity)
client_encoding string Encoding del cliente (ej: UTF8)
options array Atributos PDO adicionales

Características Específicas de PostgreSQL

Schemas y search_path

PostgreSQL organiza las tablas en schemas dentro de una misma base de datos. Hay dos formas de trabajar con ellos:

A) search_path a nivel de conexión — la entidad no declara schema y se resuelve por el orden del search_path:

B) Nombre calificado por entidad — la entidad declara su schema; la capa genera "schema"."tabla":

Schema-per-tenant (re-apuntado en runtime)

El $schema de la entidad es un alias lógico. Con SchemaRegistry puedes mapearlo a un schema físico distinto por request, sin tocar el código de las entidades:

Claves primarias

El driver soporta tres estrategias vía $keyStrategy en la entidad:

Un PK ya asignado siempre gana: se persiste tal cual, sin generar ni releer.

JSONB y casteo de atributos

Declara $casts para mapear columnas automáticamente entre su forma en la base de datos y su tipo nativo en PHP:

Nota sobre operadores JSONB y placeholders: los operadores ?, ?| y ?& de JSONB chocan con los placeholders ? de PDO. Para consultar dentro de JSONB usa where() crudo con operadores que no colisionen (->>, @>, #>>), por ejemplo: Account::find(["meta->>'plan' = ?" => 'pro']).

DELETE ... LIMIT

PostgreSQL no soporta DELETE ... LIMIT. Si se intenta, la capa lanza una excepción clara (LogicException) en lugar de emitir SQL inválido. Acota las filas con un WHERE.

Niveles de aislamiento

Niveles soportados: READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE.

Tests

Los tests de integración crean tablas y schemas temporales en la base phobos_test y los limpian al terminar.

Arquitectura

Compatibilidad

Licencia

Este proyecto está licenciado bajo la Licencia MIT - ver el archivo LICENSE para más detalles.

Autor

Marcel Rojas
[email protected]
Mongoose Studio

Contribuciones

Las contribuciones son bienvenidas. Por favor:

  1. Fork el proyecto
  2. Crea una rama para tu feature (git checkout -b feature/amazing-feature)
  3. Commit tus cambios (git commit -m 'Add amazing feature')
  4. Push a la rama (git push origin feature/amazing-feature)
  5. Abre un Pull Request

Phobos Framework by Mongoose Studio


All versions of phobos-framework-database-postgres with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-pdo Version *
ext-pdo_pgsql Version *
mongoose-studio/phobos-framework Version ^3.1
mongoose-studio/phobos-framework-database Version ^3.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mongoose-studio/phobos-framework-database-postgres contains the following files

Loading the files please wait ...