Ferreteria/v2/usage/db
< Ferreteria | v2 | usage
Jump to navigation
Jump to search
About
Databases in Ferreteria are managed through several sets of classes that work together. I am in the process of rewriting this module from scratch; information about the existing code is in /v1.
Rules
- Each Connection should be requested from the static DBO Factory class by passing it a connection spec.
- The Factory looks up which Connection class is needed for the type specified in the connection spec.
- The Factory creates the appropriate Connection object, passes it the rest of the spec to initialize it, and returns it to the caller.
Files
Core classes:
- Template:Ferreteria/code
- Template:Ferreteria/code: abstract database engine
- Template:Ferreteria/code: implementation for mysqli library
- tables:
- Template:Ferreteria/code: classes for basic table functionality
- Template:Ferreteria/code: tables with one or more unique key fields
- records:
- Template:Ferreteria/code: classes for basic recordset functionality (may or may not be attached to a table)
- Template:Ferreteria/code: records that self-identify with one or more unique key fields (can be updated in table)
Helpers:
- Template:Ferreteria/code: trait which adds support for admin interface functionality
This is only a partial list, but includes some of the most heavily-used files.
Classes
primary
- fcDBOFactory Template:Ferreteria/code: static class for creating connections
- fcDataEngine Template:Ferreteria/code: handler for a particular type of database
- fcDataConn Template:Ferreteria/code: connection to a database