shark 0.1.2

Native object-relational mapping for various databases


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Shark <img align="right" alt="Logo" width="100" src="https://i.imgur.com/ef3a5Ph.png">

DUB Package Build Status

Native connector for various databases.

Supports:

  • PostreSQL

Work in progress:

  • MySQL (and MariaDB)
import shark;

class Test : Entity {

	override string tableName() {
		return "test";
	}
	
	@PrimaryKey
	@AutoIncrement
	Integer testId;
	
	@NotNull
	String a;
	
	Short b;

}

Database database = new PostgresqlDatabase("localhost");
database.connect("test", "postgres", "root");

database.dropIfExists("test");
database.init!Test();

Test test = new Test();
test.a = "test";
database.insert(test);
assert(test.testId == 1); // auto-increment of primary key

Test[] result = database.select!Test();
assert(result.length == 1);
assert(result[0].testId == 1);
assert(result[0].a == "test");
Dependencies:
xbuffer
Versions:
0.1.2 2019-Jan-08
0.1.1 2019-Jan-03
0.1.0 2018-Dec-31
~master 2019-Jan-11
Show all 4 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 35 downloads total

Score:
0.3
Short URL:
shark.dub.pm