Download the PHP package callismart/dbprism without Composer
On this page you can find all versions of the php package callismart/dbprism. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download callismart/dbprism
More information about callismart/dbprism
Files in callismart/dbprism
Package dbprism
Short Description DBPrism: Intent-based database abstraction layer with unified adapters, schema inspection, and migrations. Supports MySQL, PostgreSQL, SQLite, PDO, and WordPress.
License MIT
Homepage https://github.com/callismart/dbprism
Informations about the package dbprism
DBPrism
Refract your queries across any database.
Intent-based database abstraction layer with unified adapters, schema inspection, and migrations. Write once. Query everywhere.
Table of Contents
- What is DBPrism?
- Installation
- Quick Start
- Supported Databases
- Query Building API
- SELECT Queries
- INSERT Queries
- UPDATE Queries
- DELETE Queries
- Schema Operations
- Schema Inspection
- Migrations
- API Reference
What is DBPrism?
DBPrism is a sophisticated, framework-agnostic database abstraction layer that unifies database operations across MySQL, PostgreSQL, and SQLite.
Like a prism refracting light into its component colors, DBPrism takes your query intents and refracts them into engine-specific SQLβtransparently, elegantly, and efficiently.
Core Features
- π Unified Adapters β Single API for 5+ database engines
- π― Intent-Based Query Building β Declarative query construction with automatic SQL rendering
- π Schema Inspection β Deep schema introspection across all engines
- π Migrations β Fluent migration API with helpers for schema transformations
- β‘ Multi-Engine Rendering β One query intent β Multiple engine-specific SQL outputs
- πͺ Type Normalization β Consistent column types across databases
- π§© Framework-Agnostic β Works standalone or integrated with any framework
Installation
Requirements:
- PHP 8.1+
- One or more: MySQLi, PDO, PostgreSQL, SQLite extensions
Quick Start
1. Initialize the Database
2. Execute Simple Queries
3. Build Complex Queries with Intents
Supported Databases
MySQL / MariaDB
PostgreSQL
SQLite
PDO (Universal)
WordPress
Query Building API
SELECT Queries
Select queries are built using the SelectionIntent class, accessed via SQLBuilder::select().
Basic SELECT
SELECT with WHERE Conditions
WHERE Operators & Conditions
JOINs
GROUP BY, ORDER BY, LIMIT/OFFSET
INSERT Queries
Insert queries are built using the PersistenceIntent class, accessed via SQLBuilder::insert().
Single Row Insert
Multi-Row Insert (Bulk)
Insert with SET Alias
UPDATE Queries
Update queries are built using the PersistenceIntent class, accessed via SQLBuilder::update().
Basic UPDATE
UPDATE with Multiple WHERE Conditions
DELETE Queries
Delete queries are built using the DeleteIntent class, accessed via SQLBuilder::delete().
Basic DELETE
DELETE with Multiple Conditions
Schema Operations
CREATE TABLE
Create tables using the CreateTableIntent class with fluent Column and Constraint builders.
Basic CREATE TABLE
CREATE TABLE with Foreign Keys
Column Types
Column Modifiers
ALTER TABLE
Modify existing tables using the AlterTableIntent class.
[SECTION NEEDS CLARIFICATION] β I need more context on:
- Complete API for
add_column(),modify_column(),drop_column(),drop_constraint(),drop_index()methods onAlterTableIntent - How these are called exactly
TRUNCATE TABLE
DROP TABLE
Migrations with Fluent Helpers
TableHelper
The TableHelper provides fluent interface for table-level operations.
ColumnHelper
The ColumnHelper provides fluent interface for column-level operations.
ConstraintHelper
The ConstraintHelper provides fluent interface for constraint operations.
[SECTION NEEDS CLARIFICATION] β I need more context on:
- Complete method signatures and usage for:
add_primary_key(),add_unique(),add_foreign_key()drop_primary_key(),drop_unique(),drop_foreign_key()add_constraint(),drop(),drop_constraint()
- SQLite-specific constraint handling details
- How to properly call these methods with parameters
Schema Inspection
Inspect database schema using the Inspector class.
Table Operations
Column Operations
Index Operations
Primary Key Operations
Foreign Key Operations
Constraint Operations
System Information
Transactions
Execute multiple queries atomically with automatic rollback on failure.
Best Practices
-
Always Use Parameterized Queries
-
Use Transactions for Related Operations
-
Leverage the Inspector for Schema-Aware Logic
- Handle Database Errors Gracefully
Testing
Run the test suite:
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License β see the LICENSE file for details.
Author
Callistus Nwachukwu
- Email: [email protected]
- Website: https://callismart.com.ng
Support
For issues, questions, or feature requests:
- π Report a bug
- π‘ Request a feature
- π Read the documentation
Made with β€οΈ by Callismart