Software For Thought

April 30, 2020

Rebar-MySQL: Refactoring and Redefining Scope

It has been three years since the Rebar project began it's work. Since this time I have used it in PHP applications, stopped writing new PHP applications, ported the library into Python 2 and wrote several more applications. Now I have been porting Python 2 applications into Python 3, and this library is included in that effort.

The library's scope is narrowing. To be released as Python 3 code, Rebar-MySQL will be code that wraps around Oracle's MySQL-Connector/Python library, providing a convenient interface for constructing complex SQL statements without hand-writing any SQL code, and then executing those statements on a database in an orderly manner.

It's complexity is being greatly simplified. Originally envisioned as a way of making better use of PHP's clunky and difficult to use MySQL prepared statements library, many of the original interfaces have since come to posses needless appendages that were necessary when making calls to PHP's mysqli library, but are completely not necessary when using MySQL-Connector/Python. Many of these legacy components were left in the Python 2 version of the library for purposes of backwards-compatibility when I began porting PHP applications into Python 2. (Hey, we all have deadlines!)

But I no longer feel that maintaining this sort of backwards-compatibility is necessary. I have been working to streamline and simplify the interfaces. Given that Python 3 asserts no backwards-compatibility with Python 2, I feel that this is a good point to refactor the model and remove unnecessary cruft that date back to the library's early PHP days.

There is still a little more work to be done before a release is ready.

October 20, 2019

RebarDB: A Simple SQL Query Abstraction Library

Back in 2017, I pitched Rebar as what I had envisioned of being a series of libraries that could be used to form a framework around PHP. It would smooth out many of the things that makes PHP development work a challenge, adn would present a cleaner interface to many essential PHP tools whose out of the box APIs were clunky and difficult to use. At that time, PHP took up a significant percentage of my development work.

My how things can change in a few years. PHP in my world is dead. Since that time two and a half years ago, I have found that the PHP projects I was working on -- both in my personal life and my professional life -- began to dwindle down to legacy maintenance, and finally total obsolescence. I don't think I have written a single line of PHP in over a year!

So, suffice to say: Rebar as a PHP framework is dead as well. I will not be continuing to maintain the code beyond what has already been released.

But not everything about the project is dead: the SQL abstraction concepts that have been developed I feel still present some powerful potential for utility.

So let's redefine Rebar's scope a bit: perhaps Rebar is exclusively a SQL query abstraction layer, regardless of the language in which it has been implemented. Maybe it can still continue to provide a useful set of objects that can be used to define and execute SQL queries. This continues support objective number 1 of the original Rebar project: elimination of hand-writing SQL statements.

Rebar will also aim to make efficient use of prepared statement APIs that are exposed by database connector libraries. This fulfills objective number 2 from the original Rebar project.

The nature of my work has evolved over the last several years. Python has crept in to replace many of the duties once serviced by PHP. So naturally I believe that the first step in this redefining of vision is a porting to Python. Perhaps the concepts of Rebar will find a better home in a more powerful and better supported programming language.

Keep an eye here for an initial stable release and supporting documentation of Rebar-Python. It will be released here before the end of this year.