Skip to content

Sondro/tink_sql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Tinkerbell SQL

This library embeds SQL right into the Haxe language. Think LINQ (not the syntax sugar, but the framework).

Motivation

Most developers tend to dislike SQL, at least for a significant part of their career. A symptom of that are ever-repeating attempts to hide the database layer behind ORMs, with very limited success.

Relational databases are however a very powerful concept, that was pioneered over 40 years ago.

Define a database like so:

import tink.sql.*;

typedef User = {
  id:Id<User>,
  name:String,
  email:String,
  password:String,
}

typedef Post = {
  id:Id<Post>,
  author:Id<User>,
  title:String,
  url:String,
}

typedef Tag = {
  id:Id<Tag>,
  name:String,
  desc:Null<String>,
}

typedef PostTags = {
  post:Id<Post>,
  tag:Id<Tag>,
}

class BlogDb extends tink.sql.Database {
  @:table var user:User;
  @:table var post:Post;
  @:table var tag:Tag;
  @:table var postTags:PostTags;
}

... to be continued ...

About

SQL embedded into Haxe

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haxe 100.0%