toql_mysql

Crates.iotoql_mysql
lib.rstoql_mysql
version0.1.2
sourcesrc
created_at2019-05-15 17:19:13.251613
updated_at2019-05-20 11:52:45.387874
descriptionLibrary with mysql integration for toql
homepage
repositoryhttps://github.com/roy-ganz/toql
max_upload_size
id134532
size9,046
Artos (roy-ganz)

documentation

README

Toql

Description

Toql Transfer object query language is a query language to build SQL statements. It can retrieve filtered, ordered and indiviually selected columns from a database and put the result into your structs.

Toql turns this

id, (+age eq 16; age eq 18), address_street

into

SELECT user.id, user.age, address.street
FROM User user LEFt JOIN Address address ON (user.address_id= address.id)
WHERE user.age = 16 OR user.age = 18
ORDER BY user.age ASC

for all your Toql derived structs.

Resources

There is also a guide and the API documentation.

Installation

Add this to your Cargo.toml:

[dependencies]
toql = { version = "0.1", features = ["mysql"] }

Integration

Toql works well with Rocket: Add this to your Cargo.toml

[dependencies]
toql_rocket = { version = "0.1", features = ["mysql"] }

Right now there is only support for MySql. Add features = ["mysql"] to your Cargo.toml dependencies.

Features

Toql Transfer object query language is a query language to build SQL statements. It can retrieve filtered, ordered and indiviually selected columns from a database and put the result into your structs.

Toql

  • can query, insert, update and delete single and multiple database records.

  • handles dependencies in queries through SQL joins and merges. Cool!

  • is fast, beause the mapper is only created once and than reused.

  • has high level functions for speed and low level functions for edge cases.

Contribution

My near term goal is to support for more web frameworks and databases. However I would like to stabilize the API first. So you are welcome to play around and test it (don't use it in production yet). Comments, bug fixes and quality improvements are welcome. For features please hold on.

Other database projects

Background

I have developed the initial Toql language about 7 years ago for a web project. I have refined it since then and you can see it in action on www.schoolsheet.com, a web service I created in Java for my teaching. The Rust implementation is must faster though ;)

License

Toql is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

Commit count: 555

cargo fmt