Skip to content

Commit 2dff0fe

Browse files
committed
added README file to the classes/database directory (#160)
1 parent 8d0acd0 commit 2dff0fe

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

classes/Database/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# If You Decide to Add Your Own Data Storage Implementation
2+
3+
You should follow these steps:
4+
5+
1. Make changes to the ensureConnector() method of the DatabaseController.php file
6+
7+
2. Create a directory with your database type. Note that the first letter of the directory name must be capitalized.
8+
9+
3. Inside the new directory, implement the Connector and UpgraderMapper classes as they are implemented in Mariadb. With the Connector class you should implement all abstract methods, and with the UpgrageMapper class you should implement all methods specified in the corresponding interface.
10+
11+
4. All methods to execute queries to your database must be done by implementing interfaces (\*MapperInterface.php) or by extending classes from the Common directory. The new implementations should be placed in the new directory. Note that the names of your classes must not contain the Common prefix.
12+
13+
## Some remarks:
14+
15+
- Do not put database-specific code into classes in the Common directory.
16+
17+
- Do not use table names in queries directly. Instead, use the tablePrefix method from the Connector class.
18+
19+
- If you need to make minor edits to a particular Mapper, consider extending the corresponding class from the Common directory instead of implementing the interface.

0 commit comments

Comments
 (0)