createDatabase method

Future<void> createDatabase(
  1. String databaseName,
  2. [List<CreateDatabaseUser> users]
)

Implementation

Future<void> createDatabase(
  String databaseName, [
  List<CreateDatabaseUser> users,
]) {
  final userList = users?.map((u) => u.toJson())?.toList();
  return _connection.request(
    method: 'POST',
    path: '/_api/database',
    body: {'name': databaseName, 'users': userList},
  );
}