Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I was hoping to do a question-comment asking for clarification, but I don't have enough reputation yet! So I will answer as best I may.</p> <p>I am using as3-spod for my application. It's been pretty reliable and mostly given me what I want. It's not really ideal, though. What I'd really like is something more ActiveRecord-like, or something original that lets you generate queries by concatenating conditions in a fluid syntax.</p> <p>But if you're not using Flex (as I'm not, and you're not) then your options are pretty thin, as most of the other AS3 ORMs out there rely on some part of the Flex framework. Apart from as3-spod, the only possibility I could find was <a href="http://coenraets.org/blog/2008/12/using-the-sqlite-database-access-api-in-air-part-3-annotation-based-orm-framework/" rel="nofollow">Christophe Coenraets' proof-of-concept</a> but as he points out, it would need a lot of work to develop it into a fully-fledged ORM:</p> <blockquote> <p>This is still a simplistic proof of concept and is by no means a production ready ORM solution. </p> </blockquote> <p>And I haven't had time for that.</p> <p>You are right that as3-spod is quite poorly documented. I guess the main class you want to look at is SpodTable. It's from that one you do inserts, selects, etc. An update on a single object can be done from the object itself. Look out for the various signals on SpodTable (select, selectAll, etc). To get going with it, just mark up a model class with metadata, then from your SpodDatabase instance call createTable(MyModelClass).</p> <p>My main gripes with as3-spod are these (I'm listing them so you don't look for features that don't exist, which I wasted a fair bit of time doing!):</p> <ul> <li><p>It works asynchronously. Doesn't matter if your actual SQLConnection has been opened synchronously or asynchronously; you have to listen to signals. That means you can't retrieve records and then use them straight away in the same method, you have to listen to signals. What I tend to do is to do large selects when the app starts, then filter the data in memory rather than doing complex queries. Pretty annoying.</p></li> <li><p>Be careful with null values for numeric columns. I can't see a way of setting NULL or NOT NULL for columns using as3-spod; it always seems to make them NOT NULL, which will cause errors if you try to insert a row from an object with null fields.</p></li> <li><p>There's no migration system (a la Rails). I am working on rolling my own as that's an essential feature for my purposes (it's a mobile app I'm developing).</p></li> </ul> <p>Good luck! Let me know in comments if there's anything else specific you'd like me to cover and I can expand this answer.</p> <p><strong>EDIT</strong> I've just noticed the existence of <a href="https://github.com/pranavh/AS3SQLite/" rel="nofollow">AS3SQLite</a>. Haven't used it yet but, looks like there are other possibilities out there :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload