unpub_sqlite 0.1.1 copy "unpub_sqlite: ^0.1.1" to clipboard
unpub_sqlite: ^0.1.1 copied to clipboard

Implementation of a unpub's `MetaStore` for a SQLite databases

example/unpub_sqlite_example.dart

import 'package:sqlite3/sqlite3.dart';
import 'package:unpub/unpub.dart' as unpub;
import 'package:unpub_sqlite/src/sqlite_meta_store.dart';

void main(List<String> args) async {
  print('Using sqlite3 ${sqlite3.version}');

  // Create a new in-memory database. To use a database backed by a file, you
  // can replace this with sqlite3.open(yourFilePath).
  final db = sqlite3.open('test.db');

  final metaStore = SqliteMetaStore(sqliteDatabase: db);
  metaStore.initialize();

  final app = unpub.App(
    metaStore: metaStore,
    packageStore: unpub.FileStore('./unpub-packages'),
    overrideUploaderEmail: 'software@dronetag.com',
  );

  final server = await app.serve('0.0.0.0', 4000);
  print('Serving server at http://${server.address.host}:${server.port}');
}
0
likes
140
points
8
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Implementation of a unpub's `MetaStore` for a SQLite databases

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

sqlite3, unpub

More

Packages that depend on unpub_sqlite