https://github.com/azkadev/database_universe_gas
Universe Gas Database Save any data in properties / spreadsheet easily and quickly for Google Apps Script
https://github.com/azkadev/database_universe_gas
database gas google-apps-script json library spreadsheet supabase
Last synced: 3 months ago
JSON representation
Universe Gas Database Save any data in properties / spreadsheet easily and quickly for Google Apps Script
- Host: GitHub
- URL: https://github.com/azkadev/database_universe_gas
- Owner: azkadev
- License: apache-2.0
- Created: 2025-04-02T14:48:15.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-04-03T05:24:15.000Z (3 months ago)
- Last Synced: 2025-04-03T06:27:53.664Z (3 months ago)
- Topics: database, gas, google-apps-script, json, library, spreadsheet, supabase
- Language: Dart
- Homepage:
- Size: 126 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yaml
- License: LICENSE
Awesome Lists containing this project
README
# Database Universe Gas
**Database Universe** Is library for help you save data in Platfom Google Apps Script very easy, you can use spreadsheet as documentation like supabase, and properties like storing json data locally**Copyright (c) 2024 GLOBAL CORPORATION - GENERAL DEVELOPER**
## đī¸ Docs
1. [Documentation](https://youtube.com/@GENERAL_DEV)
2. [Youtube](https://youtube.com/@GENERAL_DEV)
3. [Telegram Support Group](https://t.me/DEVELOPER_GLOBAL_PUBLIC)
4. [Contact Developer](https://github.com/General-Developer) (check social media or readme profile github)## đī¸ Features
1. [x] đąī¸ **Cross Platform** support (Device, Edge Severless functions)
2. [x] đī¸ **Standarization** Style Code
3. [x] â¨ī¸ **Cli** (Terminal for help you use this library or create project)
4. [x] đĨī¸ **Api** (If you developer bot / userbot you can use this library without interact cli just add library and use đī¸)
5. [x] đ§Šī¸ **Customizable Extension** (if you want add extension so you can more speed up on development)
6. [x] â¨ī¸ **Pretty Information** (user friendly for newbie)
## âī¸ Fun Fact- **This library 100%** use on every my create project (**App, Server, Bot, Userbot**)
## đī¸ Proggres
- **10-02-2025**
Starting **Release Stable** With core Features### đĨī¸ Install Library
## đī¸ Quick Start
Example Quickstart script minimal for insight you or make you use this library because very simple
```dart
import 'dart:convert';
import 'dart:math';
import 'package:database_universe_gas/database_universe_gas.dart';
import 'package:general_universe/extension/dynamic.dart';
import 'package:general_universe/crypto/crypto.dart';
import 'package:general_universe/json_scheme/json_scheme.dart';
import 'package:google_apps_script_library/google_apps_script_library.dart';void main(List args) {
final GoogleAppsScriptEventTriggers googleAppsScriptEventTriggers = GoogleAppsScriptEventTriggers();
MiniDatabaseUniverseGas miniDatabaseUniverseGas = MiniDatabaseUniverseGas();
miniDatabaseUniverseGas.ensureInitialized(
pathToFile: "configuration",
miniDatabaseUniverseGasOptions: MiniDatabaseUniverseGasOptions(
miniDatabaseUniverseGasType: MiniDatabaseUniverseGasType.script,
crypto: Crypto.defaultCrypto(),
isUseCrypto: true,
isIgnoreError: true,
),
);
miniDatabaseUniverseGas.initiaLized();
miniDatabaseUniverseGas.stateData.printPretty();final bool isRequestPermission = miniDatabaseUniverseGas.valueBuilder(
builder: (db) {
if (db["is_request_permission"] is bool == false) {
db["is_request_permission"] = false;
}
return db["is_request_permission"];
},
);String sheetUrl = miniDatabaseUniverseGas.valueBuilder(
builder: (db) {
if (db["sheet_url"] is String == false) {
db["sheet_url"] = "";
}
return db["sheet_url"];
},
);googleAppsScriptEventTriggers.ensureInitialized(
onTest: () {
{
if (isRequestPermission == false) {
{
DatabaseUniverseGas.requestPermissionExecute();
}
miniDatabaseUniverseGas["is_request_permission"] = true;
miniDatabaseUniverseGas.write();
}
}
{
if (sheetUrl.isEmpty) {
final SpreadSheet spreadsheet = SpreadSheetApp.create(
"new",
);miniDatabaseUniverseGas["sheet_url"] = spreadsheet.getUrl();
sheetUrl = miniDatabaseUniverseGas["sheet_url"];
miniDatabaseUniverseGas.write();
}
}
// final String sheetName = "database";final SpreadSheetsDatabaseUniverseGas databaseUniverseGas = SpreadSheetsDatabaseUniverseGas.open(
sheetIdOrUrl: sheetUrl,
schemes: [
SpreadSheetsSchemeDatabaseUniverseGas(
sheetName: "telegram_chat",
jsonScheme: JsonScheme(
{
"@type": "telegramChat",
"chat_id": 0,
"user_id": 0,
"room_chat_id": 0,
"data": json.encode({}),
},
),
),
],
);
databaseUniverseGas.ensureInitialized();
databaseUniverseGas.initialized();
final SpreadSheetsCollectionDatabaseUniverseGas telegamChatCollection = databaseUniverseGas.from("telegram_chat");
int index = 10;
{
print("telegamChatCollection.count: start");
final value = telegamChatCollection.count();
value.printPretty();
print("telegamChatCollection.count: done");
}{
print("telegamChatCollection.insert: start");
final value = telegamChatCollection.insert(
newValue: {
"@type": "telegramChat",
"chat_id": Random().nextInt(1000),
"user_id": Random().nextInt(1000),
"room_chat_id": Random().nextInt(1000),
"data": json.encode({}),
},
);
value.printPretty();
print("telegamChatCollection.insert: done");
}{
print("telegamChatCollection.getValuesRaw: start");
final value = telegamChatCollection.getValuesRaw(
startOffset: 2,
limit: 10,
endRow: 2,
);
value.printPretty();
print("telegamChatCollection.getValuesRaw: done");
}
{
print("telegamChatCollection.deleteByIndex: start");
final value = telegamChatCollection.getValues(
startOffset: 2,
limit: 10,
);
value.printPretty();
print("telegamChatCollection.deleteByIndex: done");
}{
print("telegamChatCollection.deleteByIndex: start");
final value = telegamChatCollection.deleteByIndex(
index: index,
);
value.printPretty();
print("telegamChatCollection.deleteByIndex: done");
}{
print("telegamChatCollection.getByIndex: start");
final value = telegamChatCollection.getByIndex(
index: index,
);
value.printPretty();
print("telegamChatCollection.getByIndex: done");
}
// telegamChatCollection;
{
print("telegamChatCollection.setByIndex: start");
final value = telegamChatCollection.setByIndex(
index: index,
newValue: {
"chat_id": -500002,
"user_id": 7141401,
"room_chat_id": 31930141,
"data": json.encode({
"date": DateTime.now().toString(),
})
},
);
value.printPretty();
print("telegamChatCollection.setByIndex: done");
}
return {"@type": "error", "message": "unimplemented"};
},
);
}```
## Reference
1. [General-Developer/google_apps_script_library](https://github.com/General-Developer/google_apps_script_library)
core library**Copyright (c) 2024 GLOBAL CORPORATION - GENERAL DEVELOPER**