-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from utopia-dart/fix-tests
Fix tests
- Loading branch information
Showing
38 changed files
with
125 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
name: utopia_database_melos | ||
|
||
packages: | ||
- utopia_database/ | ||
- utopia_database_adapter_mariadb/ | ||
- packages/** |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## 0.3.0 | ||
|
||
- Moved MariaDB adapter tests to its own package `utopia_database_adapter_mariadb` | ||
- Thus removed cyclic dependency between `utopia_database` and `utopia_database_adapter_mariadb` | ||
|
||
## 0.2.0 | ||
|
||
- Move MariaDB adapter to its own package `utopia_database_adapter_mariadb` | ||
|
||
|
||
## 0.1.1 | ||
|
||
- update documentation comments | ||
|
||
## 0.1.0 | ||
|
||
- Initial version |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Utopia Database | ||
|
||
Utopia Database is light and fast database library for Dart. It is designed to be simple and easy to use. It currently supports only MariaDB database but you can contribute to [add adapters to other databases](doc/add_database_adapter.md). | ||
|
||
## Setup | ||
|
||
Together with this package, you need to also add a database adapter package to your project. Check out [MariaDB adapter package](https://pub.dev/packages/utopia_database_adapter_mariadb). | ||
|
||
|
||
## Example | ||
|
||
```dart | ||
import 'package:utopia_database/utopia_database.dart'; | ||
import 'package:utopia_database_adapter_mariadb/utopia_database_adapter_mariadb.dart'; | ||
void main() async { | ||
final mariadb = await MariaDB.init( | ||
host: 'localhost', port: 3306, user: 'user', password: 'password'); | ||
final database = Database(mariadb); | ||
print('connection initialized'); | ||
database.setDefaultDatabase('applications'); | ||
database.setNamespace('_myproject'); | ||
final exists = await database.exists(collection: Database.metadata); | ||
if (!exists) { | ||
await database.create(); | ||
print('metadata created'); | ||
} | ||
final userExists = await database.exists(collection: 'users'); | ||
if (!userExists) { | ||
await database.createCollection('users', [ | ||
Attribute( | ||
id: 'name', | ||
type: Database.varString, | ||
isRequired: true, | ||
size: 255, | ||
), | ||
Attribute( | ||
id: 'email', | ||
type: Database.varString, | ||
isRequired: true, | ||
size: 255, | ||
), | ||
Attribute( | ||
id: 'description', | ||
type: Database.varString, | ||
isRequired: true, | ||
size: 2550, | ||
), | ||
], []); | ||
print('users collection created'); | ||
} | ||
} | ||
``` | ||
|
||
## Contribute new adapter | ||
|
||
To add new adapter for different database, follow the steps in [add database adapter](docs/add_database_adapter.md). |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: utopia_database_example | ||
|
||
environment: | ||
sdk: '>=3.0.0 <4.0.0' | ||
|
||
|
||
dependencies: | ||
utopia_database: ^0.2.0 | ||
utopia_database_adapter_mariadb: ^0.2.0 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions
5
utopia_database/lib/utopia_database.dart → .../utopia_database/lib/utopia_database.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
utopia_database/pubspec.yaml → packages/utopia_database/pubspec.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
4 changes: 4 additions & 0 deletions
4
utopia_database_adapter_mariadb/CHANGELOG.md → ...pia_database_adapter_mariadb/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.3.0 | ||
|
||
- Added integration test for databsae adapter | ||
|
||
## 0.2.0 | ||
|
||
- Update dependencies | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: utopia_database_adapter_mariadb | ||
description: MariaDB adapter for Utopia database library, that connects to MariaDB to provide database functionalities. | ||
version: 0.3.0 | ||
repository: https://github.com/utopia-dart/utopia_database/tree/main/packages/utopia_database_adapter_mariadb | ||
|
||
environment: | ||
sdk: '>=2.19.6 <4.0.0' | ||
|
||
dependencies: | ||
mysql1: ^0.20.0 | ||
utopia_database: '>=0.2.0 <1.0.0' | ||
|
||
dev_dependencies: | ||
lints: ^3.0.0 | ||
test: ^1.24.0 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
name: utopia_database_melos | ||
publish_to: none | ||
|
||
environment: | ||
sdk: '>=3.0.0 <4.0.0' | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.