A New “Engine” for Easy Database Access
© 2024 Mark McWiggins
Back at the dawn of my career (late 1980’s) I worked on a project we wound up calling the “engine” (for database engine) … I helped create (and wrote all the code … an “island compiler” (I found the term later) based on parsing this QUEL-like language … imperative statements like READ myfield FROM Myfile where myfield > 2.2;
I used this island parser to create crufty-looking but highly performant code (for its day: late 1980’s) — 30 ms response time is what my boss what looking for.
It used the database backends B-TREE and CTrieve, and there was some effort to get it to work with actual SQL; I can’t remember if that ever worked.
There were many bugs, but fewer over time and overall the project was a big success for the little company where I worked.
Now it’s 2024, and boy have I learned a lot! Test-driven-development, Python variant Mojo that runs 35000(!) (not a typo) as fast as regular C-based Python.
So my project plan (I’m hoping to get a prototype up and going this weekend, at least):
Test-driven Development
Python (mojo variant)
PostgreSQL SQL
Psycopg2
Stepwise refinement
I’m not sure if the current user base will want this but I can also write an Engine-to-SQL translator if they want. I will keep you posted on progress. Watch this space:
Test #1: remote connect to the database with Python + Psycopg2.
Update: 4:26 Test #1 passed!
Test #2: insert data remotely
Update: Test #2 passed! That’s all the time I have for tonight.
Update: 07/07/2024
Test #3: update and delete data in the database .. Passed!
Test #4: get Hello, World going in Mojo
PASSED: the actual hello, world didn’t work but I got another example script to work.
UPDATE: I got the actual hello, world in mojo to work … it’s billed as a proper superset of Python, but it’s slightly different:
fn main():
print(“hello, world”)
(Formatting is just like Python but I can’t see how to get this to show in this writing interface which doesn’t seem to have a code text type. I could do it with LaTeX, but I’m too far along with this one to change now.)
Test #5-#7 : reproduce Tests 1–3 with Mojo in place of Python
I will work on this more to get the Mojo place in a few days.
Just to clarify: I am mainly looking for a “player-coach” role … this article and associated software (which will be open source on Github when I get it done) is to show my technical chops for the ‘player’ part of the player coach role. Thanks.
Mark McWiggins