diff --git a/npmextra.json b/npmextra.json index 3197e23..eeb313c 100644 --- a/npmextra.json +++ b/npmextra.json @@ -5,7 +5,7 @@ "githost": "code.foss.global", "gitscope": "push.rocks", "gitrepo": "smartclickhouse", - "description": "A TypeScript-based ODM (Object-Document Mapper) for ClickHouse databases, with support for creating and managing tables and handling time-series data.", + "description": "A TypeScript-based ODM for ClickHouse databases that supports creating, managing, and querying tables with a focus on handling time-series data.", "npmPackagename": "@push.rocks/smartclickhouse", "license": "MIT", "projectDomain": "push.rocks", @@ -22,7 +22,13 @@ "data storage", "time-series data", "schema management", - "data insertion" + "data insertion", + "real-time data", + "data querying", + "bulk data insertion", + "error handling", + "data deletion", + "observables" ] } }, diff --git a/package.json b/package.json index 12772af..b17d2be 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@push.rocks/smartclickhouse", "version": "2.0.16", "private": false, - "description": "A TypeScript-based ODM (Object-Document Mapper) for ClickHouse databases, with support for creating and managing tables and handling time-series data.", + "description": "A TypeScript-based ODM for ClickHouse databases that supports creating, managing, and querying tables with a focus on handling time-series data.", "main": "dist_ts/index.js", "typings": "dist_ts/index.d.ts", "type": "module", @@ -61,11 +61,17 @@ "data storage", "time-series data", "schema management", - "data insertion" + "data insertion", + "real-time data", + "data querying", + "bulk data insertion", + "error handling", + "data deletion", + "observables" ], "homepage": "https://code.foss.global/push.rocks/smartclickhouse", "repository": { "type": "git", "url": "https://code.foss.global/push.rocks/smartclickhouse.git" } -} +} \ No newline at end of file diff --git a/readme.md b/readme.md index 8666150..cbf093b 100644 --- a/readme.md +++ b/readme.md @@ -1,7 +1,6 @@ -```markdown # @push.rocks/smartclickhouse -A TypeScript-based ODM (Object-Document Mapper) for ClickHouse databases, with support for creating and managing tables and their data. +A TypeScript-based ODM (Object-Document Mapper) for ClickHouse databases, with support for creating and managing tables and handling time-series data. ## Install @@ -21,7 +20,7 @@ This will add the package to your project's dependencies. ## Usage -`@push.rocks/smartclickhouse` is an ODM (Object Document Mapper) module specifically designed for interacting with ClickHouse databases efficiently and effectively. Leveraging TypeScript, it offers strong typing and intelligent code completion, making database operations more intuitive and less error-prone. +`@push.rocks/smartclickhouse` is an advanced ODM (Object Document Mapper) module designed for seamless interaction with ClickHouse databases leveraging the capabilities of TypeScript for strong typing and enhanced developer experience. Below is a comprehensive guide to using the package in various scenarios. ### Setting Up and Starting the Connection @@ -36,7 +35,7 @@ const dbInstance = new SmartClickHouseDb({ database: 'yourDatabase', // Database name you want to connect to username: 'default', // Optional: Username for authentication password: 'password', // Optional: Password for authentication - unref: true // Optional: Allows service to exit while awaiting database startup + unref: true // Optional: Allows service to exit while awaiting database startup }); // Start the instance to establish the connection @@ -73,7 +72,7 @@ The `addData` method is designed to be flexible, allowing insertion of various d ### Advanced Usage and Custom Data Handling -`smartclickhouse` supports custom data types and complex data structures. For instance, to add support for nested objects or custom data processing before insertion, you might need to extend existing classes or contribute to the module development for broader use cases. +`smartclickhouse` supports custom data types and complex data structures. For instance, to add support for nested objects or custom data processing before insertion, you might need to extend existing classes or customize the `addData` method to fit your needs. #### Custom Data Processing @@ -193,7 +192,7 @@ console.log('Table exists after deletion:', result.length === 0); To observe new entries in real-time, you can stream new data entries using the RxJS Observable: ```typescript -const stream = table.streamNewEntries(); +const stream = table.watchNewEntries(); const subscription = stream.subscribe((entry) => { console.log('New entry:', entry); @@ -237,8 +236,6 @@ To contribute: The above scenarios cover the essential functionality and the more advanced use cases of `@push.rocks/smartclickhouse`, providing a comprehensive guide to utilizing the module into your projects. Happy coding! -``` - ## License and Legal Information This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. diff --git a/test/test.nonci.ts b/test/test.nonci.ts index 2ddac99..7276b05 100644 --- a/test/test.nonci.ts +++ b/test/test.nonci.ts @@ -83,7 +83,7 @@ tap.test('should delete the table', async () => { }); tap.test('should stream new entries', async (toolsArg) => { - const stream = table.streamNewEntries(); + const stream = table.watchNewEntries(); const subscription = stream.subscribe((entry) => { console.log('New entry:', entry); }); diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 409c5bd..1a55dd2 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartclickhouse', - version: '2.0.16', - description: 'A TypeScript-based ODM (Object-Document Mapper) for ClickHouse databases, with support for creating and managing tables and handling time-series data.' + version: '2.0.17', + description: 'A TypeScript-based ODM for ClickHouse databases that supports creating, managing, and querying tables with a focus on handling time-series data.' } diff --git a/ts/smartclickhouse.classes.timedatatable.ts b/ts/smartclickhouse.classes.timedatatable.ts index 3bbbb57..a15073e 100644 --- a/ts/smartclickhouse.classes.timedatatable.ts +++ b/ts/smartclickhouse.classes.timedatatable.ts @@ -266,7 +266,7 @@ export class TimeDataTable { /** * streams all new entries using an observable */ - public streamNewEntries(): plugins.smartrx.rxjs.Observable { + public watchNewEntries(): plugins.smartrx.rxjs.Observable { return new plugins.smartrx.rxjs.Observable((observer) => { const pollInterval = 1000; // Poll every 1 second let lastTimestamp: number;