Concept

Toql is a ORM that aim to boost your developer comfort and speed when working with databases.

To use it you must derive Toql for all structs that represent a table in your database:

  • The fields of those structs represent either columns, SQL expressions or relationships to other tables.
  • The fields also determine the field name or in case of a relationship the path name in the Toql query

A struct may map only some columns of a table and also multiple structs may refer to the same table. Structs are merly 'views' to a table.

A derived struct can then be inserted, updated, deleted and loaded from your database. To do that you must call the Toql API functions with a query string or just a list of fields or paths.

Here the typical flow in a web environment:

  1. A web client sends a Toql query to the REST Server.
  2. The server uses Toql to parse the query and create SQL statements.
  3. Toql sends the SQL to the database
  4. then deserializes the resulting rows into Rust structs.
  5. The server sends these structs to the client.

Quickstart

There is full featured REST server based on Rocket, Toql and MySQL. It can be used as a playground or starting point for own projects.