From e370704ec1d2a057e3adb13dd27d428234df9d87 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Fri, 23 Apr 2010 18:50:04 +0300 Subject: [PATCH] new post: LiteMySQL: ActiveRecord's Little Brother --- ...-litemysql-activerecords-little-brother.md | 18 ------- ...-litemysql-activerecords-little-brother.md | 52 +++++++++++++++++++ 2 files changed, 52 insertions(+), 18 deletions(-) delete mode 100644 source/blog/_posts/2010-04-16-litemysql-activerecords-little-brother.md create mode 100644 source/blog/_posts/2010-04-23-litemysql-activerecords-little-brother.md diff --git a/source/blog/_posts/2010-04-16-litemysql-activerecords-little-brother.md b/source/blog/_posts/2010-04-16-litemysql-activerecords-little-brother.md deleted file mode 100644 index e430bd1..0000000 --- a/source/blog/_posts/2010-04-16-litemysql-activerecords-little-brother.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -layout: post -title: "LiteMySQL: ActiveRecord's Little Brother" -categories: [technology, database, php] ---- - -Ever needed a quick and lightweight MySQL library for PHP? Pulling out a full ORM is just overkill, but writing the PHP code needed to connect to the server, run a query, and process the results is a lot of hassle? I thought so. I've been there too. - -So what if you could do something like this: - -{% highlight php %} -find_all(array("author" => "John Twelve Hawks")); -?> -{% endhighlight %} - -The above code would require about 8-10 lines of PHP code if you went barebones. I'm not gonna show a barebones example, cause frankly I'm even now too lazy to write such code. \ No newline at end of file diff --git a/source/blog/_posts/2010-04-23-litemysql-activerecords-little-brother.md b/source/blog/_posts/2010-04-23-litemysql-activerecords-little-brother.md new file mode 100644 index 0000000..050b001 --- /dev/null +++ b/source/blog/_posts/2010-04-23-litemysql-activerecords-little-brother.md @@ -0,0 +1,52 @@ +--- +layout: post +title: "LiteMySQL: ActiveRecord's Little Brother" +categories: [technology, web, database, php] +--- + +Ever needed a quick and lightweight MySQL PHP library for some small single/multi page project? Pulling out a full ORM is just overkill, but writing the PHP code needed to connect to the server, run a query, and process the results is a lot of hassle? I thought so. I've been there too. + +So what if you could do something like this: + +{% highlight php %} +find_all(array("author" => "John Twelve Hawks")); +?> +{% endhighlight %} + +Rather than something like this: + +{% highlight php %} + +{% endhighlight %} + +About two years ago, I found myself in need of just such a small, lightweight library. There were full ORMs like [ADOdb][] and others available, but they were serious overkill for the kind of simple stuff I needed. After some googling, I noticed there didn't seem to be any in-between libraries. Either you had to go for a whole jumbo jet, or start folding your own paper airplanes, and I didn't like either option. I just wanted to grab existing paper airplanes, and start throwing them in the direction I needed them to go. + +So in true geek fashion when you want something ready-made to make your life easy, I ended up building my own such library. Spending an order of magnitude more time on the MySQL connection part of the project than I would have needed if I'd just done it the ugly way as the second code example above. + +And that's how I started building [LiteMySQL][]. Rather than building it from the ground up though, I started by lifting the essential parts from the full ORM/ActiveRecord implementation I'd written for [Zynapse][], and mainly just wrote glue-code to make it a feature-complete library. + +After close to a year of being ignored, I recently spent an afternoon fixing some long-standing bugs, migrating to [GitHub][], and writing some decent documentation for the project. + +You can read more, and download the library [here][litemysql]. + + + + + + +[zynapse]: http://github.com/jimeh/zynapse +[adodb]: http://adodb.sourceforge.net/ +[litemysql]: http://github.com/jimeh/litemysql +[github]: http://github.com/ \ No newline at end of file