ankhdb
The official Dart & Flutter SDK for AnkhDB - A real-time, multi-tenant Backend-as-a-Service.
Installation
Add ankhdb to your pubspec.yaml:
dependencies:
ankhdb: ^1.0.1
Or run:
dart pub add ankhdb
Usage
Initialize the Client
You'll need your Project API Key from the AnkhDB Dashboard.
import 'package:ankhdb/ankhdb.dart';
final db = AnkhDB('YOUR_API_KEY', 'http://localhost:5000');
Authentication
Manage your app's end-users seamlessly.
// Register
var response = await db.register('user@example.com', 'securepassword');
// Login
await db.login('user@example.com', 'securepassword');
// Logout
await db.logout();
Database Operations
AnkhDB uses a flexible NoSQL-on-SQL structure with collections.
// Insert data
var post = await db.from('posts').insert({
'title': 'Hello AnkhDB',
'content': 'Managing data from Flutter is easy.'
});
// Fetch data
var posts = await db.from('posts').select();
// Get by ID
var myPost = await db.from('posts').get('doc-id');
Additional Information
For more information, visit the AnkhDB Dashboard.
License
MIT