Jump to content

Module: LessQL for ProcessWire


alxndre
 Share

Recommended Posts

This is a simple loader for LessQL, an ORM alternative for PHP. It is based on NotORM, and provides a quick way to access and find things in a database, including traversals and back-traversals.

As discussed in some earlier topics, there are times when you'd like to store some data away from ProcessWire's pages/fields/templates structure for whatever reasons. However ORMs are sometimes cumbersome and requires a lot more effort to deploy. LessQL offers a quick way to just up and go like you're using an ORM but without the added complexity and configuration files.

Module: https://github.com/alguintu/LessQL

This modules simply loads the LessQL library into ProcessWire and exposes a $lessQL variable (configurable in settings) that gives access to your database. It uses the same database specified in $config by default, but can be set to use a separate database, along with its credentials.

Usage given a table person :

$people = $lessQL->person()->select("id, firstname, lastname")->where("firstname LIKE ?", "%alex%")->orderBy("firstname")->limit(10);

It uses lazy loading and doesn't execute the query until it needs to. Checkout www.lessql.net for more info on LessQL.

Module wrapper is pretty much lifted from @teppo's RedBeanPHP module, but with a few modifications. :)

 

lssql.thumb.PNG.c051a8b39feb048d6cff5f849961704e.PNG

  • Like 17
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...