Phalcon Layer

It powers the model layer in the framework. It is found under the directory Phalcon\Db. It consists of abstraction layer which is written in C programming language.

Database Adapter

Phalcon uses PDO_ to connect to databases. It supports following Database engines:

ClassDescription
Phalcon\Db\Adapter\Pdo\MysqlIt is the most used relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases.
Phalcon\Db\Adapter\Pdo\PostgresqlPostgreSQL is a powerful, open source relational database system. It provides reliability, data integrity, and correctness.
Phalcon\Db\Adapter\Pdo\SqliteSQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine

Implementation

  <?php  

  

use Phalcon\Db\Adapter\Pdo\Factory;  

  

$options = [  

    'host'     => 'localhost',  

    'dbname'   => 'javatpoint',  

    'port'     => 3306,  

    'username' => 'siddharth',  

    'password' => 'flash',  

    'adapter'  => 'mysql',  

];  

  

$db = Factory::load($options);  

?>  

    Database Dialects

    Phalcon stores specific details of database engine in dialects.

    ClassDescription
    Phalcon\Db\Dialect\MysqlSQL specific dialect for MySQL database system
    Phalcon\Db\Dialect\PostgresqlSQL specific dialect for PostgreSQL database system
    Phalcon\Db\Dialect\SqliteSQL specific dialect for SQLite database system

    Comments

    Leave a Reply

    Your email address will not be published. Required fields are marked *