Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: Student projects/SQLite.

Student projects/SQLite: Difference between revisions

From MoodleDocs
(About SQLite support)
(Shifted to dev docs)
 
(19 intermediate revisions by one other user not shown)
Line 1: Line 1:
<p class="note">'''Note''': This page outlines ideas for the XMLDB/SQLite project. It's a ''specification under construction''! If you have any comments or suggestions, please add them to the [[Talk:Student projects/SQLite|page comments]].''</p>
{{Moved_to_dev_docs}}
 
==Summary==
This project is part of the 2008 edition of Google Summer of Code (GSoC). Mentor: Penny Leach. Student: Andrei Bautu.
 
The objective of this project is to extend Moodle's database support and features. The main working directions established in the proposal are:
* implement SQLite in Moodle database abstraction layer;
* implement a tool which will allow administrators to copy a live Moodle database and switch into 'testing mode' using a SQLite copy of the live database.
 
===SQLite support===
 
Adding support for SQLite in Moodle requires a careful analysis of compatibility between Moodle's database requirements and SQLite's features (e.g. https://docs.moodle.org/en/Development:XMLDB_problems).
 
SQLite supports almost all of the features of SQL92. However, we can't ignore the features it does not support as some of them are used by Moodle (http://www.sqlite.org/omitted.html):
* proper settings for Unicode support, long field names, numeric/associative fetches, metadata support -> solution: use pragma commands;
* incompatible SQL commands (e.g. SQLite does not support MySQL's TRUNCATE because it is not part of standard SQL) - > solutions: rewrite the SQL command (recommended) or alter the query in the database layer;
* unsupported SQL commands (SQLite does not support GRANT/REVOKE) -> solution: ignore these commands in database layer;
* unsupported SQL keywords (SQLite does not support right and full join) -> solution: rewrite the SQL command (e.g. use left join instead of right), or alter the query in the database layer (althought, in some cases it can be very difficult).
 
A serious limitation of SQLite is the limited ALTER TABLE command. In this case, the general solution for the missing clauses problem consists in replacing the query with a series of queries that will create a second table to replace the original one. This will be done by the database layer.
 
==See also==
 
*[[GSOC/2008]]
*[http://code.google.com/soc/2008/moodle/appinfo.html?csaid=5800332C0A064CB0 XMLDB/SQLite application abstract]
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=88827 How to add sqlite-support?] forum discussion
 
[[Category:Project]]

Latest revision as of 04:02, 15 September 2011

This development related page is now located in the Dev docs.

See the Student projects/SQLite page in the Dev docs.