A Portable, cross-platform, light weight, opinionated ORM designed to work across multiple Databases
Stable Build (master) | Pre-Release Build (vnext) |
---|---|
(coming soon) |
Provider | Package Name | Stable | Pre-Release |
---|---|---|---|
crossql.core | |||
SQLite | crossql.sqlite | ||
MS Sql Server | crossql.mssqlserver |
note: we take pull requests if you'd like to support more ;)
Platform | Sqlite | SQL Server (>= 2012) | PostgreSQL | MySQL |
---|---|---|---|---|
Windows | ||||
Android | ||||
iOS |
Create
var jill = new StudentModel
{
Id = StudentJillId,
FirstName = "Jill",
LastName = "",
Email = JillEmail,
Courses = new List<CourseModel> { englishCourse },
};
await _dbProvider.Create( jill );
Read
IList<StudentModel> allStudents = await _dbProvider.Query<StudentModel>().ToListAsync();
StudentModel jill = await _dbProvider.Query<StudentModel>().Where(s => s.Email == "JillEmail").FirstOrDefaultAsync();
Update
jill.Email = "JillNewEmail";
await _dbProvider.Update<StudentModel>(jill);
Delete
note: this is still a work in progress
// first flavor
await _dbProvider.Query<StudentModel>().Where( s => s.Email == "JillNewEmail" ).Delete();
// second flavor
await _dbProvider.Delete<StudentModel>(s => s.Email == "JillNewEmail");
We absolutely welcome contributions/suggestions/bug reports from you (the people using this package). If you have any ideas on how to improve it, please post an issue with steps to reproduce, or better yet, submit a Pull Request.
crossql is forked from futurestate.appcore.data. Commit history is in tact.