定制 juanvladimir13/postgres-database 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

juanvladimir13/postgres-database

最新稳定版本:v0.1.7

Composer 安装命令:

composer require juanvladimir13/postgres-database

包简介

Conexion native to postgres

README 文档

README

A lightweight native PHP package for interacting with PostgreSQL databases. It provides a simple connection wrapper, an environment variable loader, and an Active Record-style base model for building data-driven applications with minimal overhead.

Features

  • Environment Configuration: A minimal Dotenv class to securely load database credentials (DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD) from .env files.
  • PostgreSQL Connection Wrapper: The Postgres class provides static methods to easily execute queries and perform insert, update, delete, and fetchAll operations using associative arrays.
  • Active Record Base Model: An abstract Model class that simplifies CRUD operations, supporting soft deletes, state management (EDITABLE), and standardized response formats.
  • Data Type Casting: Built-in support for mapping request payloads to specific data types (int, float, string, boolean, utf-8, etc.) using the DataType constants.

Directory Structure (src/)

  • Dotenv.php: Loads database connection settings and generates the PostgreSQL connection string.
  • Postgres.php: Core singleton wrapper over native PHP pg_* functions.
  • Models/Model.php: Abstract class providing high-level data access methods (like save, find, findAll, delete, restore) to be inherited by your application's entities.
  • Models/DataType.php: Defines constants for data types used in request data extraction and casting.

统计信息

  • 总下载量: 106
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固