package mantra.sql.orm
PostgreSQLAdapter
CLASS
public class
PostgreSQLAdapter implements DatabaseAdapter
PostgreSQL 16 native adapter with support for transaction isolation, JSONB serialization, and libpq protocol.
🏗️ Constructor Summary
Constructor Signature
def __init__(self, host: String, port: Int, db_name: String, user: String)
⚙️ Method Summary
| Modifier & Return Type | Method Signature | Description |
|---|---|---|
Bool |
connect() |
Establishes libpq connection. |
String |
execute(sql: String) |
Executes parameterized query. |
String |
get_driver_name() |
Returns 'PostgreSQL 16 Driver'. |
🔍 Detailed Method Specifications
pub def connect() -> Bool
Establishes libpq connection.
pub def execute(sql: String) -> String
Executes parameterized query.
pub def get_driver_name() -> String
Returns 'PostgreSQL 16 Driver'.
💡 Example Usage
postgresqladapter_example.mantra
let db = PostgreSQLAdapter("127.0.0.1", 5432, "users_db", "postgres")
db.connect()