Simple Xojo ORM

Something I’ve tinkered with for a while
Only tested on macOS so far against sqlite & mysql

An easy ORM that doesnt require much set up
Code is all open source & hopefully understandable by mere mortals
it does make heavy use of introspection

Sample console app included

7 Likes

Looks interesting and simple. I didn’t spend all that much time with it but I didn’t see anything for ordering your First/Last/Find.

Well, technically there’s a reverseorderby in EasyORM.SQLIteORMDatabase.Last but it’s a blank string and not a property or parameter so it looks like it’s not set up yet?

LAST is to find the LAST item from a table
The opposite of FIRST

Neither has an “order by” - yet :slight_smile:

Its evolved ever so slowly as I wanted to try & keep 99.9% of the complexity inside the ORMDatabases and NOT in the various table classes

As much as possible

I’m not so concerned about First/Last but with Find the order by could be important for folks.

Yeah finds already support criteria (an unconstrained string) so adding over by should be dead easy since it would just be another unconstrained string

Updated with examples for Console Desktop & iOS

Same EasyORM code and base table used in each

The samples have the same basic code in the open event with some code disabled based on

  • targetIOS doesnt support the classic DATE so that code is disabled
  • targetIOS doesnt support the classic DATE so that property is removed in iOS builds by setting the compatibility flag to NOT include iOS (exactly what compat flags are for)

Web & Android updates in the works

Then on to making it easy to connect a connector to controls on various layout

Tweaks & fixes are welcome if you care to make them

5 Likes

Please call it nORM. Please, please please.

3 Likes

So far the design goal is simplicity
Copy Paste or use another means to add the code to whatever kind of project
It works
That means having to make some changes like updating it to useA PI 2 because iOS & Android dont have the classic API

Still need to make Web & Android examples
Then to make the various “layout controllers” that can bind controls & the various database tables together in a way that DOESNT require subclasses of controls to work
I have plans :slight_smile:

1 Like

I concur and think that would be awesome! Maybe…

  • Nifty ORM
  • Novel ORM
  • Neat ORM
  • Nimble ORM
  • No brainer ORM
  • Something else?

But of course there’s…

  • Norm’s ORM

:wink:

1 Like

Repos already exist but I can change the name of anything IN the repo :stuck_out_tongue:

I’ll consider it

3 Likes

Palardy ORM or, hear me out, just PORM. I’ll see myself out. :slight_smile:

6 Likes

I tested it. Speelling controller makes PORN from it. Not good. Not good. And I tried to tell my daughter about. The PORM Repository. She said (in clear german) “Diesen Schweinkram will ich von meinem Vater nicht hören” … “I don’t want to hear this porky stuff from my father”… :slight_smile:

:rofl:

OK thats just funny

I love this one (his two meanings).

working on things as time permits

fixing the examples
making sure things work without lots of fiddling in desktop, console & iOS

and a “data controller” so you can put one on a layout and attach controls to the db really simply
for desktop its very close to 0 code
not sure about the others - yet

trying to stay away from having to subclass every control like …

If you plan to make the controller visible with some buttons, a nice option would be to optionally hide the controller so the dev could make their own buttons which would call methods in the controller.

Right now the data control is fully invisible - its a Control - so no GUI to it
You drop one on the layout and it has a few events & methods for set up (since I cant do that in the IDE) and away you go
For desktop binding GUI controls created in the layout to the controller is handled automatically
You set a few existing properties on the layout controls and you’re done
Not sure how I’ll handle dynamically created controls - yet

iOS, Web & Android will have different needs & capabilities but the intent is to make them as similarly simple

3 Likes