View Issue Details

IDProjectCategoryView StatusLast Update
0004035Multi Theft Auto : San AndreasGeneralpublic2011-12-01 00:32
ReportereAiAssigned Toccw 
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Product Version 
Target Version1.2Fixed in Version1.2 
Summary0004035: Integrate MySQL into MTA server, and unify interface with SQlite
Description

Providing a simple (and working!) interface for SQLite that can be switched to MySQL by the server admin would be very useful.

Accounts and other settings could be moved over to this database too. Possible the entire config (except for database settings, obviously) could be moved to this database, and use the web interface to configure the server. This would be a significant change, but would make things easier to users (by using a GUI to configure the server).

Proposed design:
Base cDatabase class with derived cMySQLDatabase and cSQLiteDatabase classes that implement the specific behaviour for each database type.

The interface should be identical between each and scripts shouldn't need to care which engine is being used. Special care may need to be taken with differences between SQL language differences and engine capabilities.

The admin should be able to specify multiple databases in their config file. The first of these should always be used unless either:
a) It is unavailable - server down, for example. An error should be shown.
b) A script requests to use a different database type, and a database of that type is available.

Scripts should be able to request to use a specific database type. If it is available it will be used, but should otherwise fall back to using whatever is available, unless absolutely unsuitable for the purpose.

Provide at least a raw function for making any SQL query. Could provide helper functions (as exists currently) if they provide any clear benefits. Maybe integrate JSON support for easy serialising and deserialising of LUA tables.

Perhaps provide a way to copy data from one database to another. This may be complex and tools may already exist that do this well enough.

Estimated time to implement: 10 - 15 hours

TagsNo tags attached.

Activities

ryden

2009-03-07 01:48

manager   ~~0008482

MySQL also provides a library to embed the self server into your application, like SQLite, though the good part of MySQL is that you can access it externally.
About providing a common interface, bear in mind that MySQL has lots of features that SQLite hasn't, so what would be the best option? Cutting MySQL features or letting coders to use incompatible raw queries?

Talidan

2010-02-02 01:58

administrator   ~~0011027

An eAi bug report.

Issue History

Date Modified Username Field Change