Crates.io | philec |
lib.rs | philec |
version | 0.1.4 |
source | src |
created_at | 2017-09-27 22:23:52.931073 |
updated_at | 2017-10-31 23:04:09.56576 |
description | The Painless High-Level Persistence Engine |
homepage | https://h2co3.github.io/phile/ |
repository | https://github.com/H2CO3/PHiLe.git |
max_upload_size | |
id | 33721 |
size | 17,122 |
PHiLe (pronounced fillet), the Painless High‑Level Persistence Engine, is a next‑generation database management tool and domain‑specific language. It allows application developers to write what is basically a textual form of a conceptual or entity relationship model, from which it automatically generates a Database Abstraction Layer.
Unlike traditional ORMs, it has a strong, expressive type system. It allows programmers to work with many kinds of values, not only objects, therefore trivially eliminating many of the bottlenecks commonly associated with ORM solutions, such as having to retrieve the transitive closure of an object, only to discard all but a few of its scalar attributes.
PHiLe also supports a wide spectrum of different languages and databases, therefore it cooperates well with many already-existing technology stacks. It includes tools for automatically migrating data of the same conceptual schema between different underlying database engines, and another DSL for refactoring the schema without loss of data or type safety.
PHiLe is on crates.io. You can install the compiler by issuing the following command:
cargo install philec
If you want to use the libphile
library programmatically, add this to your Cargo.toml
:
[dependencies]
phile = "0.1.4"
You can clone the source at the official GitHub page of the project using:
git clone git://github.com/H2CO3/PHiLe.git
Sure! Depending on how you are willing to use PHiLe, you may be looking for…
phile
library,
useful when you want to embed PHiLe into your own Rust programs.philec
,
if you want to deep dive into the invocation of the PHiLe CLI compiler.The philosophy behind the design of PHiLe is explained in detail on my blog.
The PHiLe DSL is a statically‑typed, object-oriented, functional-declarative language, which is capable of describing schemas (like a DDL) and queries/updates (like a DML). It brings the memory model that programmers are familiar with to the world of persistent storage: relational tables become classes or structs, records and documents become objects, and relationships become arrays and pointers.
As rightfully expected from a modern functional language, the PHiLe DSL supports advanced and convenient features such as higher‑order functions, pattern matching, and algebraic data types (including class, struct, tuple, enum and optional types). Enums, in particular, are a type‑safe alternative to stringly‑typed fields, while proper optional types prevent errors related to NULL
values.
PHiLe will support the following database flavors and programming languages:
Support for other popular storage engines (e.g. Postgres, MS/SQL, Redis, …) and programming languages would be nice and is planned.