surrealdb_js
Flutter SurrealDB SDK for JavaScript package
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.4%) to scientific vocabulary
Repository
Flutter SurrealDB SDK for JavaScript package
Basic Info
- Host: GitHub
- Owner: limcheekin
- License: mit
- Language: Dart
- Default Branch: main
- Size: 514 KB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 6
Metadata Files
README.md
surrealdb_js
The Flutter SurrealDB SDK for JavaScript package is a powerful integration for Flutter, built upon the foundation of surrealdb.js, the official SurrealDB SDK for JavaScript.
Installation 💻
❗ In order to start using surrealdb_js you must have the Flutter SDK installed on your machine.
Install via flutter pub add:
sh
flutter pub add surrealdb_js
Alternatively, add surrealdb_js to your pubspec.yaml:
yaml
dependencies:
surrealdb_js:
Install it:
sh
flutter pub get
Lastly, add the following code before the </head> tag in the web/index.html file:
html
<script type="module">
import { Surreal, StringRecordId } from "/assets/packages/surrealdb_js/assets/js/index.js";
// expose the type to the global scope
globalThis.SurrealJS = Surreal;
globalThis.StringRecordId = StringRecordId;
</script>
✨ Features
- [x]
connect() - [x]
close() - [x]
use() - [x]
create() - [x]
update() - [x]
merge() - [x]
delete() - [x]
select() - [x]
query() - [x]
query_raw() - [x]
transaction() - [x]
let() - [x]
unset() - [x]
signup() - [x]
signin() - [x]
invalidate() - [x]
authenticate() - [x]
info() - [x]
patch() - [x]
version()
🏃 Examples
Basic
```dart final db = Surreal();
await db.connect('http://127.0.0.1:8000/rpc'); await db.use(namespace: 'surreal', database: 'surreal'); await db.signin({'username': 'root', 'password': 'root'});
final created = db.create('person', { 'title': 'CTO', 'name': { 'first': 'Tom', 'last': 'Jerry', }, 'marketing': true, }, );
// created['id'] = person:b9eht8bie8abf0vbcfxh final id = created['id'].toString();
final merged = await db.merge( id, { 'marketing': false, }, );
final tom = await db.select(id);
final deleted = await db.delete(id); ```
For more code examples, kindly refer to the integration test and the example project.
Transaction Support
dart
final result = await db.transaction(
showSql: true,
(txn) async {
txn.query('DEFINE TABLE test SCHEMAFULL;');
txn.query('DEFINE FIELD name ON test TYPE string;');
txn.query(
r'CREATE test SET name = $name;',
bindings: {'name': 'John'},
);
if (somethingWrong) {
txn.cancel();
}
},
);
For more code examples, kindly refer to the integration test of transaction.
🧑💼 Contributing
Contributions are welcome! Please check out the unimplemented features above, issues on the repository, and feel free to open a pull request. For more information, please see the contribution guide.
📔 License
This project is licensed under the terms of the MIT license.
🗒️ Citation
If you utilize this package, please consider citing it with:
@misc{surrealdb_js,
author = {Lim Chee Kin},
title = {surrealdb_js: Flutter SurrealDB SDK for JavaScript package},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/limcheekin/surrealdb_js}},
}
Owner
- Name: Lim Chee Kin
- Login: limcheekin
- Kind: user
- Website: https://www.linkedin.com/in/limcheekin/
- Repositories: 145
- Profile: https://github.com/limcheekin
I love to develop software systems, always seek for ways to deliver it better and faster.
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Lim"
given-names: "Chee Kin"
title: "surrealdb_js"
date-released: 2024-06-06
url: "https://github.com/limcheekin/surrealdb_js"
GitHub Events
Total
- Release event: 2
- Watch event: 1
- Delete event: 2
- Issue comment event: 1
- Push event: 3
- Pull request event: 2
- Create event: 3
Last Year
- Release event: 2
- Watch event: 1
- Delete event: 2
- Issue comment event: 1
- Push event: 3
- Pull request event: 2
- Create event: 3
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: 11 days
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.5
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 2
Past Year
- Issues: 0
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: 11 days
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.5
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
Pull Request Authors
- dependabot[bot] (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 6
pub.dev: surrealdb_js
Flutter SurrealDB SDK for JavaScript
- Documentation: https://pub.dev/documentation/surrealdb_js/
- License: mit
-
Latest release: 1.1.0+9
published over 1 year ago