Issue Details (XML | Word | Printable)

Key: MDL-15071
Type: Task Task
Status: Open Open
Priority: Minor Minor
Assignee: Petr Skoda
Reporter: Andrei Bautu
Votes: 0
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

SQLite support

Created: 31/May/08 07:36 PM   Updated: 31/Jul/08 05:05 PM
Return to search
Component/s: Database SQL/XMLDB
Affects Version/s: 2.0
Fix Version/s: None

File Attachments: 1. Text File 200806221743-sqlite_acceslib.patch (1 kB)
2. Text File 200806221743-sqlite_dml_ddl.patch (52 kB)
3. Text File 200806221743-sqlite_install.patch (5 kB)
4. Text File 200806301845-lib.patch (5 kB)
5. Text File 200807081047-xmldb.patch (2 kB)
6. Text File 200807081058-moodle.patch (31 kB)
7. Text File 200807090136-sql_generator.php.patch (2 kB)
8. Text File 20080713_db_move_patch_merged3.patch (26 kB)
9. Text File 200807311303-MDL-15071.patch (16 kB)

Issue Links:
Relates
 

URL: http://docs.moodle.org/en/Student_projects/SQLite
Participants: Andrei Bautu, Eloy Lafuente (stronk7) and Petr Skoda
Security Level: None
Affected Branches: MOODLE_20_STABLE


 Description  « Hide
This project is part of the 2008 edition of Google Summer of Code (GSoC). Mentor: Penny Leach. Student: Andrei Bautu.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 20/Jun/08 03:12 PM
please do not use tab characters

Andrei Bautu added a comment - 22/Jun/08 11:21 PM
SQL update rewrite

Andrei Bautu added a comment - 22/Jun/08 11:22 PM
SQLite language strings and install options

Andrei Bautu added a comment - 22/Jun/08 11:25 PM
  • rewrite of connect in moodle_database (and use it in subclasses) - (some part of it was submitted in http://tracker.moodle.org/secure/attachment/14293/200806202038-dml.patch so it deprecates that patch)
  • generic implementation of pdo_moodle_database and pdo_moodle_recordset
  • implementation of sqlite_sql_generator
  • implementation of sqlite3_pdo_moodle_database

Petr Skoda added a comment - 23/Jun/08 05:40 AM
patches in cvs:
  • the connect cahnges were not committed - going to rewrite this part
  • install/lang/ can not be edited directly
  • I had some problems with the ddl_dml patch, the relative paths there totally confused my eclipse

thanks for the patches!

Now I am going to:
1/ rewrite the connect() and export_dbconfig() methods
2/ remove addsingleslashes() from installer


Petr Skoda added a comment - 23/Jun/08 06:54 AM
my changes are in cvs, please cvs update

Eloy Lafuente (stronk7) added a comment - 23/Jun/08 07:54 AM
Have seen one commit related to this bug:

+ } else {
+ // sqlite and others
+ $updatesql = "UPDATE {context}
+ SET path = (SELECT path FROM {context_temp} WHERE id = {context}.id),
+ depth = (SELECT depth FROM {context_temp} WHERE id = {context}.id)
+ WHERE id IN (SELECT id FROM mdl_context_temp)";

I'd suggest using EXISTS instead of IN. Not sure if sqllite supports it, though.

FYC, ciao, Eloy


Andrei Bautu added a comment - 23/Jun/08 01:18 PM
@Eloy SQLite supports IN, but is there a particular reason for using EXISTS instead of IN?
In this case, the subquery would reference the record in the {context} table like this (SELECT id FROM {context_temp} WHERE id = {context}.id). For many RDBMS this means to rerun the subquery for each record. Using IN involves running the subquery only once and then check the result for each record.

Andrei Bautu added a comment - 08/Jul/08 04:04 PM
Fixes a regular expression in xmldb_object which breaks sentences with empty strings.

Andrei Bautu added a comment - 08/Jul/08 04:13 PM
  • list all supported drivers (from install.php) is returned by static method moodle_database::get_supported_drivers
  • static method moodle_database::get_driver() loads the class and returns a specific driver
  • static method moodle_database::get_all_drivers() loads the classes and returns objects for each supported driver
  • method moodle_database::export_dbconfig now exports cached settings (which can be set with store_settings or connect)
  • method database_manager::get_generator returns the generator
  • method database_manager::install_from_xmldb_structure installs a database from a xmldb_structure
  • method database_manager::install_from_xmldb_file load the file and calls install_from_xmldb_structure
  • fixes of the SQLite layer
  • new Database mover tool which can switch, transfer, import and export Moodle databases and update config.php file

Petr Skoda added a comment - 08/Jul/08 04:46 PM
thanks!! going to start merging this at the end of this week, we have to release 1.9.2 and friends now.

Andrei Bautu added a comment - 09/Jul/08 06:41 AM
rewrite of getAllReservedWords and added support for SQLite's reserved words

Petr Skoda added a comment - 13/Jul/08 07:07 PM
sending db move patch updated to apply to current HEAD (not tested)

Petr Skoda added a comment - 13/Jul/08 07:21 PM
oops, forgot to include some parts, moment please

Petr Skoda added a comment - 13/Jul/08 09:07 PM
going to commit parts that are not related to db migration today and post smaller patch dre - see MDL-15635 for more info

Petr Skoda added a comment - 14/Jul/08 04:29 AM
1/ It seems that we do not need the changes in settings export - not committed
2/ the static methods proposed for moodle_database do not have optimal names imho - get_supported_drivers() returns all core drivers, event those experiment (== not supported), get_all_drivers() does not return "all" drivers, only the core drivers; =& is not needed in PHP5; php docs should be enclosed by /** */ - not committed for now
3/ the database mover changes not committed - see MDL-15635

thanks for the patches!


Andrei Bautu added a comment - 14/Jul/08 05:58 AM
1/ It would be usefull for the db mover if I could get information from a driver (through export) about it's current settings.
2/ I'll fix these comments and =&.
Is get_driver_names better? Or another suggestion, please.
I took the list of drivers from install.php and these are all existing drivers at the moment. What do you mean by "all"?

Andrei Bautu added a comment - 31/Jul/08 05:05 PM
Full ALTER TABLE support + bug fixes