Ticket #244: Need documentation for fSchema::setKeysOverride()

Reporter: thelonecabbage Type: task Opened: 1 year ago Status: closed
Assigned to: wbond Priority: minor Modified: 5 months ago Resolution: fixed

fSchema::setKeysOverride() is a required function for MyISAM tables in MySQL. MyISAM tables are not only the most common (and generally fastest) tables in MySQL, many hosting providers do not host innoDB tables because of their high memory load.

no realistic examples are provided. (or at least I wasn't able to make sense of the documentation provided).

Needed are methods of retrieving the fSchema. Where in the object structure does the code appear. (does it go in fActiveRecordconfigure?) Are foreign keys required bi-directionally? Will flourish maintain relational integrity in DBs without native foreign keys?

Attachments

History

Reply 07/08/09 23:49:14 changed by wbond

  • status changed from new to assigned.

Just a bit of warning about running MyISAM tables. Transactional queries are reported to have succeeded, but no transactions are actually run. Flourish uses database transactions to ensure that when an fActiveRecord object is stored with any related records, that all database entries are either written, or all database entries are not written. When using MyISAM, this transaction functionality does not work, meaning it is possible to store half of the data and have the other half error out.

While adding keys override will allow for some of the Flourish related methods and for simpler retrieval of records through fRecordSet, Flourish makes no attempt to recreate the relational integrity functionality of a real ACID compliant database.

I'm not opposed to, at some point, adding code to cascade deletes, updates and so forth, however I'd probably want to build it in a way that it was manually enabled since only MyISAM and SQLite databases don't enforce foreign keys by default.

With SQLite, you can use fDatabase::translatedQuery() to create the tables and all the necessary triggers, but then again you don't even need fSchema::setKeysOverride() since SQLite does allow defining foreign keys. In addition, SQLite has the benefit of supporting transactions.

All that said, I will be improving some of the documentation about this issue.

Reply 10/22/09 14:35:43 changed by wbond

  • priority changed from major to minor.

Reply 03/15/10 22:21:27 changed by wbond

  • status changed from assigned to closed.
  • resolution set to fixed.

I finally got around to writing up an example on the fSchema page - can you let me know if you think this example is useful from an end-developer perspective?

Edit the Ticket



please register or log in to allow for editing your comment

Action