{"id":44360112,"url":"https://github.com/mathtechstudio/local-storage-cache","last_synced_at":"2026-04-09T09:49:38.523Z","repository":{"id":245007396,"uuid":"816986693","full_name":"mathtechstudio/local-storage-cache","owner":"mathtechstudio","description":"A comprehensive Flutter package for local storage and caching with advanced features including encryption, multi-space architecture, automatic schema migration, and high-performance query capabilities. Supports Android, iOS, macOS, Windows, Linux, and Web.","archived":false,"fork":false,"pushed_at":"2026-01-31T00:57:22.000Z","size":330,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-31T08:48:40.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/local_storage_cache","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mathtechstudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["protheeuz"],"custom":["https://saweria.co/iqbalfauzien","https://www.paypal.com/paypalme/iqbalfauzien"]}},"created_at":"2024-06-18T19:32:37.000Z","updated_at":"2026-01-31T00:43:26.000Z","dependencies_parsed_at":"2024-09-10T07:54:40.293Z","dependency_job_id":"e1a436da-4c17-42cc-8580-9a7edb92cb1a","html_url":"https://github.com/mathtechstudio/local-storage-cache","commit_stats":null,"previous_names":["protheeuz/local-storage-cache","mathtechstudio/local-storage-cache"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mathtechstudio/local-storage-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathtechstudio%2Flocal-storage-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathtechstudio%2Flocal-storage-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathtechstudio%2Flocal-storage-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathtechstudio%2Flocal-storage-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathtechstudio","download_url":"https://codeload.github.com/mathtechstudio/local-storage-cache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathtechstudio%2Flocal-storage-cache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29339124,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T16:14:43.024Z","status":"ssl_error","status_checked_at":"2026-02-11T16:14:15.258Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-11T17:18:50.311Z","updated_at":"2026-02-11T17:18:50.451Z","avatar_url":"https://github.com/mathtechstudio.png","language":"Dart","funding_links":["https://github.com/sponsors/protheeuz","https://saweria.co/iqbalfauzien","https://www.paypal.com/paypalme/iqbalfauzien"],"categories":[],"sub_categories":[],"readme":"# local_storage_cache\n\n[![Pub Version](https://img.shields.io/pub/v/local_storage_cache.svg)](https://pub.dev/packages/local_storage_cache)\n[![Build Status](https://github.com/mathtechstudio/local-storage-cache/actions/workflows/code-integration.yml/badge.svg)](https://github.com/mathtechstudio/local-storage-cache/actions/workflows/code-integration.yml)\n[![Code Coverage](https://codecov.io/gh/mathtechstudio/local-storage-cache/graph/badge.svg)](https://codecov.io/gh/mathtechstudio/local-storage-cache)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n![Platforms](https://img.shields.io/badge/platforms-Android%20%7C%20iOS%20%7C%20macOS%20%7C%20Windows%20%7C%20Linux%20%7C%20Web-informational)\n\nA comprehensive Flutter package for local storage and caching with advanced features including encryption, multi-space architecture, automatic schema migration, and high-performance query capabilities. Supports Android, iOS, macOS, Windows, Linux, and Web.\n\n## Features\n\n- **Multi-Platform Support**: Works seamlessly across Android, iOS, macOS, Windows, Linux, and Web\n- **Advanced Query System**: SQL-like queries with chaining, nesting, joins, and complex conditions\n- **Multi-Space Architecture**: Isolate data for different users or contexts within a single database\n- **Strong Encryption**: AES-256-GCM and ChaCha20-Poly1305 with platform-native secure key storage\n- **Automatic Schema Migration**: Zero-downtime migrations with intelligent field rename detection\n- **High Performance**: Multi-level caching, batch operations, connection pooling, and prepared statements\n- **Backup and Restore**: Full and selective backups with compression and encryption support\n- **Data Validation**: Field-level validation with custom validators and constraints\n- **Monitoring**: Built-in metrics, event streams, and performance tracking\n- **Error Recovery**: Automatic retry with exponential backoff and corruption recovery\n\n## Installation\n\nAdd the dependency in your `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  local_storage_cache: ^2.0.1 # Check pub.dev for the latest version\n```\n\nThen run:\n\n```bash\nflutter pub get\n```\n\n## Quick Start\n\n```dart\nimport 'package:local_storage_cache/local_storage_cache.dart';\n\n// Define your schema\nfinal userSchema = TableSchema(\n  name: 'users',\n  fields: [\n    FieldSchema(name: 'username', type: DataType.text, nullable: false, unique: true),\n    FieldSchema(name: 'email', type: DataType.text, nullable: false),\n    FieldSchema(name: 'created_at', type: DataType.datetime, nullable: false),\n  ],\n  primaryKeyConfig: const PrimaryKeyConfig(\n    name: 'id',\n    type: PrimaryKeyType.autoIncrement,\n  ),\n  indexes: [IndexSchema(name: 'idx_username', fields: ['username'])],\n);\n\n// Initialize storage\nfinal storage = StorageEngine(\n  config: StorageConfig(\n    databaseName: 'my_app.db',\n    encryption: EncryptionConfig(enabled: true),\n  ),\n  schemas: [userSchema],\n);\n\nawait storage.initialize();\n\n// Insert data\nfinal userId = await storage.insert('users', {\n  'username': 'john_doe',\n  'email': 'john@example.com',\n  'created_at': DateTime.now().toIso8601String(),\n});\n\n// Query data\nfinal users = await storage.query('users')\n  .where('username', '=', 'john_doe')\n  .get();\n\n// Update data\nawait storage.update(\n  'users',\n  {'email': 'newemail@example.com'},\n  where: 'id = ?',\n  whereArgs: [userId],\n);\n\n// Delete data\nawait storage.delete('users', where: 'id = ?', whereArgs: [userId]);\n```\n\n## Platform Requirements\n\n| Platform | Minimum Version | Notes                       |\n| -------- | --------------- | --------------------------- |\n| Android  | API 21 (5.0+)   | Requires SQLite 3.8.0+      |\n| iOS      | 12.0+           | Uses SQLite.swift           |\n| macOS    | 10.14+          | Uses SQLite.swift           |\n| Windows  | 10+             | Requires Visual C++ Runtime |\n| Linux    | Ubuntu 18.04+   | Requires libsqlite3         |\n| Web      | Modern browsers | Uses IndexedDB              |\n\n## Advanced Features\n\n### Multi-Space Architecture\n\nIsolate data for different users or contexts:\n\n```dart\nawait storage.createSpace('user_123');\nawait storage.switchSpace('user_123');\n\n// All operations now work within this space\nawait storage.insert('notes', {\n  'title': 'My Note',\n  'content': 'Note content',\n});\n```\n\n### Encryption\n\n```dart\nfinal storage = StorageEngine(\n  config: StorageConfig(\n    databaseName: 'my_app.db',\n    encryption: EncryptionConfig(\n      enabled: true,\n      algorithm: EncryptionAlgorithm.aes256GCM,\n      useSecureStorage: true,\n    ),\n  ),\n  schemas: [userSchema],\n);\n```\n\n### Batch Operations\n\n```dart\nfinal users = [\n  {'username': 'user1', 'email': 'user1@example.com'},\n  {'username': 'user2', 'email': 'user2@example.com'},\n  {'username': 'user3', 'email': 'user3@example.com'},\n];\n\nawait storage.batchInsert('users', users);\n```\n\n### Transactions\n\n```dart\nawait storage.transaction((txn) async {\n  final userId = await txn.insert('users', {\n    'username': 'john_doe',\n    'email': 'john@example.com',\n  });\n  \n  await txn.insert('profiles', {\n    'user_id': userId,\n    'bio': 'Software developer',\n  });\n});\n```\n\n### Backup and Restore\n\n```dart\n// Create a backup\nawait storage.backup(BackupConfig(\n  path: '/path/to/backup.db',\n  compress: true,\n  encrypt: true,\n));\n\n// Restore from backup\nawait storage.restore(RestoreConfig(\n  path: '/path/to/backup.db',\n  decrypt: true,\n));\n```\n\n## Package Structure\n\nThis repository is organized as a monorepo using Melos:\n\n- `packages/local_storage_cache` - Main package with core functionality\n- `packages/local_storage_cache_platform_interface` - Platform interface definitions\n- `packages/local_storage_cache_android` - Android implementation\n- `packages/local_storage_cache_ios` - iOS implementation\n- `packages/local_storage_cache_macos` - macOS implementation\n- `packages/local_storage_cache_windows` - Windows implementation\n- `packages/local_storage_cache_linux` - Linux implementation\n- `packages/local_storage_cache_web` - Web implementation\n\n## Documentation\n\n- [Main Package Documentation](packages/local_storage_cache/README.md)\n- [API Reference](https://pub.dev/documentation/local_storage_cache/latest/)\n- [Examples](packages/local_storage_cache/example)\n- [Changelog](CHANGELOG.md)\n\n## Examples\n\nComplete working examples are available in the [example](packages/local_storage_cache/example) directory:\n\n- Basic Usage\n- Advanced Queries\n- Encryption\n- Multi-Space Architecture\n- Backup and Restore\n\n## Contributing\n\nContributions are welcome. To set up your development environment:\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/mathtechstudio/local-storage-cache.git\n   cd local-storage-cache\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   flutter pub get\n   ```\n\n3. Activate Melos:\n\n   ```bash\n   dart pub global activate melos\n   ```\n\n4. Bootstrap the workspace:\n\n   ```bash\n   melos bootstrap\n   ```\n\n5. Run tests:\n\n   ```bash\n   melos test\n   ```\n\n6. Run static analysis:\n\n   ```bash\n   melos analyze\n   ```\n\n7. Format code:\n\n   ```bash\n   melos format\n   ```\n\nPlease read the [contributing guidelines](CONTRIBUTING.md) before submitting pull requests.\n\n## Development Commands\n\nThis project uses Melos for managing the monorepo:\n\n```bash\n# Bootstrap all packages\nmelos bootstrap\n\n# Run tests for all packages\nmelos test\n\n# Run static analysis\nmelos analyze\n\n# Format all code\nmelos format\n\n# Clean all packages\nmelos clean\n\n# Publish packages (maintainers only)\nmelos publish\n```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- Report issues on [GitHub Issues](https://github.com/mathtechstudio/local-storage-cache/issues)\n- View the [CHANGELOG](CHANGELOG.md) for version history\n\n## Acknowledgments\n\nThis package uses SQLite for local storage and implements platform-specific secure storage mechanisms for encryption key management.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathtechstudio%2Flocal-storage-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathtechstudio%2Flocal-storage-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathtechstudio%2Flocal-storage-cache/lists"}