{"id":28089438,"url":"https://github.com/inicontent/inibase","last_synced_at":"2025-05-13T12:58:03.534Z","repository":{"id":194148651,"uuid":"690189911","full_name":"inicontent/inibase","owner":"inicontent","description":"A file-based \u0026 memory-efficient, serverless, ACID compliant, relational database management system","archived":false,"fork":false,"pushed_at":"2025-04-28T16:45:48.000Z","size":1176,"stargazers_count":25,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-28T17:45:58.104Z","etag":null,"topics":["acid","database","db","dbms","files","firebase","javascript","json","mongodb","mongoose","node","nodejs","nosql","pocketbase","sql","supabase","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.org/package/inibase","language":"TypeScript","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/inicontent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-11T17:52:52.000Z","updated_at":"2025-04-28T16:45:51.000Z","dependencies_parsed_at":"2023-10-15T13:46:01.339Z","dependency_job_id":"7ed5729f-c95d-4b06-b9d3-438da69922f8","html_url":"https://github.com/inicontent/inibase","commit_stats":null,"previous_names":["inicontent/inibase"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inicontent%2Finibase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inicontent%2Finibase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inicontent%2Finibase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inicontent%2Finibase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inicontent","download_url":"https://codeload.github.com/inicontent/inibase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253948379,"owners_count":21988953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["acid","database","db","dbms","files","firebase","javascript","json","mongodb","mongoose","node","nodejs","nosql","pocketbase","sql","supabase","typescript"],"created_at":"2025-05-13T12:58:02.848Z","updated_at":"2025-05-13T12:58:03.520Z","avatar_url":"https://github.com/inicontent.png","language":"TypeScript","funding_links":["https://paypal.me/KarimAmahtil"],"categories":[],"sub_categories":[],"readme":"# Inibase :pencil:\n\n\u003e A file-based \u0026 memory-efficient, serverless, ACID compliant, relational database management system :fire:\n\n[![Inibase banner](./.github/assets/banner.jpg)](https://github.com/inicontent/inibase)\n\n[![npmjs](https://img.shields.io/npm/dm/inibase.svg?style=flat)](https://www.npmjs.org/package/inibase) [![License](https://img.shields.io/github/license/inicontent/inibase.svg?style=flat\u0026colorA=18181B\u0026colorB=28CF8D)](./LICENSE) [![Activity](https://img.shields.io/github/commit-activity/m/inicontent/inibase)](https://github.com/inicontent/inibase/pulse) [![GitHub stars](https://img.shields.io/github/stars/inicontent/inibase?style=social)](https://github.com/inicontent/inibase)\n\n## Features\n\n- **Lightweight** 🪶\n- **Minimalist** :white_circle: (but powerful)\n- **100% TypeScript** :large_blue_diamond:\n- **Super-Fast** :zap: (built-in caching system)\n- **ATOMIC** :lock: File lock for writing\n- **Built-in** form validation (+unique values :new: ) :sunglasses:\n- **Suitable for large data** :page_with_curl: (tested with 4M records)\n- **Support Compression** :eight_spoked_asterisk: (using built-in nodejs zlib)\n- **Support Table Joins** :link:\n- **Low memory-usage** :chart_with_downwards_trend: (3-5mb)\n- **Safe** :lock: (no sql or javascript injections)\n- **Easy to use** :bread:\n- **...** and much more :rocket:\n\n## Usage\n\n```js\nimport Inibase from \"inibase\";\n// const db = new Inibase(\"databaseName\", \".\", \"es\");\nconst db = new Inibase(\"databaseName\");\n\n// Get all items from \"user\" table\nconst users = await db.get(\"user\");\n\n// Read page 2 content\nconst users = await db.get(\"user\", undefined, { page: 2, per_page: 15 });\n\n// Get only required columns to improve speed\nconst users = await db.get(\"user\", undefined, {\n  columns: [\"username\", \"address.street\", \"hobbies.name\"],\n});\n\n// Get items from \"user\" table where \"favoriteFoods\" does not includes \"Pizza\" or \"Burger\"\nconst users = await db.get(\"user\", { favoriteFoods: \"![]Pizza,Burger\" });\n```\n\n\u003e [!NOTE]\n\u003e Enjoy using Inibase? Consider sponsoring us via [PayPal](https://paypal.me/KarimAmahtil) \u003cbr\u003e\n\u003e Your support helps us maintain and improve our services. \u003cbr\u003e\n\u003e Thank you! 🫰\n\n## Install\n\n```js\n\u003cnpm|pnpm|yarn|bun\u003e install inibase\n```\n\n\u003e [!WARNING]\n\u003e If you're using **Windows**, the following Unix commands are required: `zcat`, `sed`, `gzip`, and `echo`.\n\u003e  \n\u003e To use the missing commands, you need to install additional tools:\n\u003e - **[GnuWin32](http://gnuwin32.sourceforge.net/)**: Provides individual GNU utilities for Windows.  \n\u003e - **[Cygwin](https://www.cygwin.com/)**: Offers a full Unix-like environment for Windows.  \n\u003e  \n\u003e Alternatively, consider using the **Windows Subsystem for Linux (WSL)** to run a Linux environment on Windows. Learn more [here](https://learn.microsoft.com/en-us/windows/wsl/).\n\n## How it works?\n\n`Inibase` organizes data into databases, tables, and columns, each stored in separate files.\n\n- **POST**: New data is appended to column files efficiently.\n- **GET**: Data retrieval is optimized by reading files line-by-line.\n- **PUT**: Updates are streamlined, with only the relevant file being modified.\n- **DELETE**: Removes lines from column files for swift deletion.\n\nThis structure ensures efficient storage, retrieval, and updates, making our system scalable and high-performing for diverse datasets and applications.\n\n## Inibase CLI\n\n```shell\nnpx inibase -p \u003cdatabaseFolderPath\u003e\n# by default it will diplay a list of available commands (or type 'help')\n```\n\n## Examples\n\n\u003cdetails\u003e\n\u003csummary\u003eTables\u003c/summary\u003e\n\u003cblockquote\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eConfig\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```ts\ninterface {\n  compression: boolean;\n  cache: boolean;\n  prepend: boolean;\n  decodeID: boolean;\n}\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eSchema\u003c/summary\u003e\n\u003cblockquote\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eTypes\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```ts\ninterface Field {\n  id: number; // stored as a Number but displayed as a hashed ID\n  key: string;\n  required?: boolean;\n  unique?: boolean | string; // boolean for simple uniqueness, string for grouped uniqueness\n  regex?: RegExp; // Regular expression for custom validation\n  type:\n    | \"string\"\n    | \"number\"\n    | \"boolean\"\n    | \"date\"\n    | \"email\"\n    | \"url\"\n    | \"password\"\n    | \"html\"\n    | \"ip\"\n    | \"json\"\n    | \"id\";\n}\n\ninterface TableField {\n  id: number;\n  key: string;\n  required?: boolean;\n  unique?: boolean | string; // Supports uniqueness constraints\n  type: \"table\";\n  table: string;\n}\n\ninterface ArrayField {\n  id: number;\n  key: string;\n  required?: boolean;\n  unique?: boolean | string; // Supports uniqueness constraints\n  type: \"array\";\n  children: string | string[]; // Can be a single type or an array of types\n}\n\ninterface ObjectOrArrayOfObjectsField {\n  id: number;\n  key: string;\n  required?: boolean;\n  unique?: boolean | string; // Supports uniqueness constraints\n  regex?: RegExp; // For validation of object-level keys\n  type: \"object\" | \"array\";\n  children: Schema; // Nested schema for objects or arrays\n}\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eUnique\u003c/summary\u003e\n\u003cblockquote\u003e\n\nThe `unique` property ensures that the values of a specific column or a group of columns are unique within a table. This property can be either a boolean or a string.\n- **Boolean**: Setting `unique: true` ensures that the values in the column are unique across all rows.\n- **String**: By setting a string value, you can group columns to enforce a combined uniqueness constraint. This is useful when you need to ensure that a combination of values across multiple fields is unique.\n\n\u003cdetails\u003e\n\u003csummary\u003eExamples\u003c/summary\u003e\n\u003cblockquote\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eUnique Column\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\n{\n  key: \"email\",\n  type: \"string\",\n  required: true,\n  unique: true, // Ensures all email values are unique\n}\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGroup of Unique Columns\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\n[\n  {\n    key: \"firstName\",\n    type: \"string\",\n    required: true,\n    unique: \"nameGroup\", // Part of \"nameGroup\" uniqueness\n  },\n  {\n    key: \"lastName\",\n    type: \"string\",\n    required: true,\n    unique: \"nameGroup\", // Part of \"nameGroup\" uniqueness\n  },\n]\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eCreate Table\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\nconst userTableConfig = {\n  compression: true,\n  cache: true,\n  prepend: false,\n  decodeID: false\n}\n\nconst userTableSchema = [\n  {\n    key: \"username\",\n    type: \"string\",\n    required: true,\n  },\n  {\n    key: \"email\",\n    type: \"string\",\n    required: true,\n  },\n  {\n    key: \"age\",\n    type: \"number\",\n    required: true,\n  },\n  {\n    key: \"isActive\",\n    type: \"boolean\",\n    // required: false\n  },\n  {\n    key: \"hobbies\",\n    type: \"array\",\n    children: [\n      {\n        key: \"name\",\n        type: \"string\",\n        // required: false\n      },\n      {\n        key: \"level\",\n        type: \"string\",\n        // required: false\n      },\n    ],\n  },\n  {\n    key: \"favoriteFoods\",\n    type: \"array\",\n    children: \"string\",\n    // required: false\n  },\n  {\n    key: \"address\",\n    type: \"object\",\n    children: [\n      {\n        key: \"street\",\n        type: \"string\",\n        // required: false\n      },\n      {\n        key: \"city\",\n        type: \"string\",\n        // required: false\n      },\n      {\n        key: \"country\",\n        type: \"string\",\n        // required: false\n      },\n    ],\n  },\n];\n\nawait db.createTable(\"user\", userTableSchema, userTableConfig);\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eUpdate Table\u003c/summary\u003e\n\u003cblockquote\u003e\n  \n\u003cdetails\u003e\n\u003csummary\u003eChange Name\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\n// this will change table name also in joined tables\nawait db.updateTable(\"user\", undefined, {name: \"userV2\"});\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eUpdate field\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nimport { setField } from \"inibase/utils\";\n\nconst db = new Inibase(\"/databaseName\");\n\nconst userTableSchema = (await db.getTable(\"user\")).schema;\nsetField(\"username\", userTableSchema, {key: \"fullName\"});\nawait db.updateTable(\"user\", newUserTableSchema);\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRemove field\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nimport { unsetField } from \"inibase/utils\";\n\nconst db = new Inibase(\"/databaseName\");\n\nconst userTableSchema = (await db.getTable(\"user\")).schema;\nunsetField(\"fullName\", userTableSchema);\nawait db.updateTable(\"user\", newUserTableSchema);\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eJoin Tables\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\nconst productTableSchema = [\n  {\n    key: \"title\",\n    type: \"string\",\n    required: true,\n  },\n  {\n    key: \"price\",\n    type: \"number\",\n  },\n  {\n    key: \"createdBy\",\n    type: \"table\",\n    table: \"user\",\n    required: true,\n  },\n];\n\nawait db.createTable(\"product\", productTableSchema);\n\nconst productTableData = [\n  {\n    title: \"Product 1\",\n    price: 16,\n    createdBy: \"1d88385d4b1581f8fb059334dec30f4c\",\n  },\n  {\n    title: \"Product 2\",\n    price: 10,\n    createdBy: \"5011c230aa44481bf7e8dcfe0710474f\",\n  },\n];\n\nconst product = await db.post(\"product\", productTableData);\n// [\n//   {\n//     \"id\": \"1d88385d4b1581f8fb059334dec30f4c\",\n//     \"title\": \"Product 1\",\n//     \"price\": 16,\n//     \"createdBy\": {\n//       \"id\": \"1d88385d4b1581f8fb059334dec30f4c\",\n//       \"username\": \"user1\",\n//       \"email\": \"user1@example.com\",\n//       ...\n//     }\n//   },\n//   {\n//     \"id\": \"5011c230aa44481bf7e8dcfe0710474f\",\n//     \"title\": \"Product 2\",\n//     \"price\": 10,\n//     \"createdBy\": {\n//       \"id\": \"5011c230aa44481bf7e8dcfe0710474f\",\n//       \"username\": \"user2\",\n//       ...\n//     }\n//   }\n// ]\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails open\u003e\n\u003csummary\u003eMethods\u003c/summary\u003e\n\u003cblockquote\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePOST\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\nconst userTableData = [\n  {\n    username: \"user1\",\n    email: \"user1@example.com\",\n    age: 25,\n    isActive: true,\n    hobbies: [\n      { name: \"Reading\", level: \"Intermediate\" },\n      { name: \"Cooking\", level: \"Beginner\" },\n    ],\n    favoriteFoods: [\"Pizza\", \"Sushi\", \"Chocolate\"],\n    address: {\n      street: \"123 Main St\",\n      city: \"Exampleville\",\n      country: \"Sampleland\",\n    },\n  },\n  {\n    username: \"user2\",\n    email: \"user2@example.com\",\n    age: 30,\n    isActive: false,\n    hobbies: [\n      { name: \"Gardening\", level: \"Advanced\" },\n      { name: \"Photography\", level: \"Intermediate\" },\n    ],\n    favoriteFoods: [\"Burgers\", null, \"Salad\"],\n    address: {\n      street: \"456 Elm Rd\",\n      city: \"Testington\",\n      country: \"Demo Country\",\n    },\n  },\n];\n\nconst users = await db.post(\"user\", userTableData);\n// [\n//   {\n//     \"id\": \"1d88385d4b1581f8fb059334dec30f4c\",\n//     \"username\": \"user1\",\n//     \"email\": \"user1@example.com\",\n//     \"age\": 25,\n//     \"isActive\": true,\n//     \"hobbies\": {\n//       \"name\": [\n//         \"Reading\",\n//         \"Cooking\"\n//       ],\n//       \"level\": [\n//         \"Intermediate\",\n//         \"Beginner\"\n//       ]\n//     },\n//     \"favoriteFoods\": [\n//       \"Pizza\",\n//       \"Sushi\",\n//       \"Chocolate\"\n//     ],\n//     \"address\": {\n//       \"street\": \"123 Main St\",\n//       \"city\": \"Exampleville\",\n//       \"country\": \"Sampleland\"\n//     }\n//   },\n//   {\n//     \"id\": \"5011c230aa44481bf7e8dcfe0710474f\",\n//     \"username\": \"user2\",\n//     ...\n//   },\n//   ...\n// ]\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET\u003c/summary\u003e\n\u003cblockquote\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET by ID\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\nconst user = await db.get(\"user\", \"1d88385d4b1581f8fb059334dec30f4c\");\n// {\n//     \"id\": \"1d88385d4b1581f8fb059334dec30f4c\",\n//     \"username\": \"user1\",\n//     \"email\": \"user1@example.com\",\n//     \"age\": 25,\n//     \"isActive\": true,\n//     \"hobbies\": {\n//         \"name\": [\n//             \"Reading\",\n//             \"Cooking\"\n//         ],\n//         \"level\": [\n//             \"Intermediate\",\n//             \"Beginner\"\n//         ]\n//     },\n//     \"favoriteFoods\": [\n//         \"Pizza\",\n//         \"Sushi\",\n//         \"Chocolate\"\n//     ],\n//     \"address\": {\n//         \"street\": \"123 Main St\",\n//         \"city\": \"Exampleville\",\n//         \"country\": \"Sampleland\"\n//     }\n// }\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET by criteria\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\nconst users = await db.get(\"user\", { favoriteFoods: \"[]Pizza\" });\n// [\n//   {\n//     \"id\": \"1d88385d4b1581f8fb059334dec30f4c\",\n//     \"username\": \"user1\",\n//     \"email\": \"user1@example.com\",\n//     \"age\": 25,\n//     \"isActive\": true,\n//     \"hobbies\": {\n//       \"name\": [\n//         \"Reading\",\n//         \"Cooking\"\n//       ],\n//       \"level\": [\n//         \"Intermediate\",\n//         \"Beginner\"\n//       ]\n//     },\n//     \"favoriteFoods\": [\n//       \"Pizza\",\n//       \"Sushi\",\n//       \"Chocolate\"\n//     ],\n//     \"address\": {\n//       \"street\": \"123 Main St\",\n//       \"city\": \"Exampleville\",\n//       \"country\": \"Sampleland\"\n//     }\n//   },\n//   ...\n// ]\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET with columns\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\n// Get all \"user\" columns except \"username\" \u0026 \"address.street\"\nconst users = await db.get(\"user\", undefined, {\n  columns: [\"!username\", \"!address.street\"],\n});\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePUT\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\n// set \"isActive\" to \"false\" for all items in table \"user\"\nawait db.put(\"user\", { isActive: false });\n\n// set \"isActive\" to \"true\" for specific \"user\" by id\nawait db.put(\"user\", { isActive: false }, \"1d88385d4b1581f8fb059334dec30f4c\");\n\n// set \"isActive\" to \"true\" in table \"user\" by criteria (where \"isActive\" is equal to \"true\")\nawait db.put(\"user\", { isActive: false }, { isActive: true });\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDELETE\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\n// delete all items in \"user\" table\nawait db.delete(\"user\");\n\n// delete a specific \"user\" by id\nawait db.put(\"user\", \"1d88385d4b1581f8fb059334dec30f4c\");\n\n// delete \"user\" by criteria (where \"isActive\" is equal to \"false\")\nawait db.put(\"user\", { isActive: false });\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eSUM\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\n// get the sum of column \"age\" in \"user\" table\nawait db.sum(\"user\", \"age\");\n\n// get the sum of column \"age\" by criteria (where \"isActive\" is equal to \"false\") in \"user\" table\nawait db.sum(\"user\", [\"age\", ...], { isActive: false });\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eMAX\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\n// get the biggest number of column \"age\" in \"user\" table\nawait db.max(\"user\", \"age\");\n\n// get the biggest number of column \"age\" by criteria (where \"isActive\" is equal to \"false\") in \"user\" table\nawait db.max(\"user\", [\"age\", ...], { isActive: false });\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eMIN\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\n// get the smallest number of column \"age\" in \"user\" table\nawait db.min(\"user\", \"age\");\n\n// get the smallest number of column \"age\" by criteria (where \"isActive\" is equal to \"false\") in \"user\" table\nawait db.min(\"user\", [\"age\", ...], { isActive: false });\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eSORT\u003c/summary\u003e\n\u003cblockquote\u003e\n\n```js\nimport Inibase from \"inibase\";\nconst db = new Inibase(\"/databaseName\");\n\n// order users by the age column\nawait db.get(\"user\", undefined, { sort: \"age\" });\n\n// order users by the age and username columns\nawait db.get(\"user\", undefined, { sort: [\"age\", \"username\"] });\nawait db.get(\"user\", undefined, { sort: {age: -1, username: \"asc\"} });\n```\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n\u003c/blockquote\u003e\n\u003c/details\u003e\n\n## Benchmark\n\n### Bulk\n\n|        | 10                | 100               | 1000              |\n|--------|-------------------|-------------------|-------------------|\n| POST   | 11 ms (0.66 mb)   | 5 ms (1.02 mb)    | 24 ms (1.44 mb)   |\n| GET    | 29 ms (2.86 mb)   | 24 ms (2.81 mb)   | 36 ms (0.89 mb)   |\n| PUT    | 21 ms (2.68 mb)   | 16 ms (2.90 mb)   | 12 ms (0.63 mb)   |\n| DELETE | 14 ms (0.82 mb)   | 13 ms (0.84 mb)   | 2 ms (0.17 mb)    |\n\n\n### Single\n\n|        | 10                  | 100                | 1000               |\n|--------|---------------------|--------------------|--------------------|\n| POST   | 45 ms (1.07 mb)     | 12 ms (0.52 mb)    | 11 ms (0.37 mb)    |\n| GET    | 200 ms (2.15 mb)    | 192 ms (2.72 mb)   | 190 ms (2.31 mb)   |\n| PUT    | 49 ms (3.22 mb)     | 17 ms (2.98 mb)    | 17 ms (3.06 mb)    |\n| DELETE | 118 ms (0.59 mb)    | 113 ms (0.51 mb)   | 103 ms (3.14 mb)   |\n\n\u003e Default testing uses a table with username, email, and password fields, ensuring password encryption is included in the process\u003cbr\u003e\n\u003e To run benchmarks, install _typescript_ \u0026 _[tsx](https://github.com/privatenumber/tsx)_ globally and run `benchmark` by default bulk, for single use `benchmark --single|-s`\n\n## Roadmap\n\n- [x] Actions:\n  - [x] GET:\n    - [x] Pagination\n    - [x] Criteria\n    - [x] Columns\n    - [x] Sort\n  - [x] POST\n  - [x] PUT\n  - [x] DELETE\n  - [x] SUM\n  - [x] MAX\n  - [x] MIN\n- [x] Schema supported types:\n  - [x] String\n  - [x] Number\n  - [x] Boolean\n  - [x] Date\n  - [x] Email\n  - [x] Url\n  - [x] Table\n  - [x] Object\n  - [x] Array\n  - [x] Password\n  - [x] IP\n  - [x] HTML\n  - [x] Id\n  - [x] JSON\n- [ ] TO-DO:\n  - [x] Use new Map() instead of Object\n  - [ ] Ability to search in JSON fields\n  - [x] Re-check used exec functions\n  - [ ] Use smart caching (based on N° of queries)\n  - [ ] Commenting the code\n  - [ ] Add Backup feature (generate a tar.gz)\n  - [x] Add Custom field validation property to schema (using RegEx?)\n- [ ] Features:\n  - [ ] Encryption\n  - [x] Data Compression\n  - [x] Caching System\n  - [ ] Suggest [new feature +](https://github.com/inicontent/inibase/discussions/new?category=ideas)\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finicontent%2Finibase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finicontent%2Finibase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finicontent%2Finibase/lists"}