{"id":21691524,"url":"https://github.com/scientific-dev/enhanced.db","last_synced_at":"2025-04-12T09:44:21.853Z","repository":{"id":136131683,"uuid":"291947054","full_name":"scientific-dev/enhanced.db","owner":"scientific-dev","description":"Simple enhanced and easy to use database made with better-sqlite3!","archived":false,"fork":false,"pushed_at":"2023-06-01T23:20:34.000Z","size":83,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T04:41:32.590Z","etag":null,"topics":["better-sqlite3","database","enhanced-db"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scientific-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-09-01T08:54:19.000Z","updated_at":"2024-10-15T08:36:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"25865b77-b4b8-4d22-a15a-0958896cb20e","html_url":"https://github.com/scientific-dev/enhanced.db","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientific-dev%2Fenhanced.db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientific-dev%2Fenhanced.db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientific-dev%2Fenhanced.db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientific-dev%2Fenhanced.db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scientific-dev","download_url":"https://codeload.github.com/scientific-dev/enhanced.db/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550396,"owners_count":21122929,"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":["better-sqlite3","database","enhanced-db"],"created_at":"2024-11-25T17:38:56.073Z","updated_at":"2025-04-12T09:44:21.844Z","avatar_url":"https://github.com/scientific-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enhanced.DB \r\n\r\nYou can help us by joining our [Discord Server](https://discord.gg/FrduEZd)! \r\nThis package workd good with Typescript too...\r\n\r\n**Docs:** https://enhanceddb.science.repl.co/\r\n\r\n```js\r\nconst db = require('enhanced.db')\r\n\r\n// Set Options\r\nconst options = {\r\n    clearOnStart: false,\r\n    filename: 'kek.sqlite'\r\n}\r\n// Setting clearOnStart true will clear the whole enhanced.sqlite. That would be false by default so if you dont need of that option no need of using options parameter!\r\n// You can setup ur own custom file directory or location! But must be perfect for Sqlite Environment! It would be default to enhanced.sqlite!\r\n\r\n// Will apply options to the default database table\r\ndb.options(options)\r\n```\r\n\r\n## Now here comes some easy database methods!\r\n\r\n```js\r\ndb.set('foo', 'bar') // Will set value\r\ndb.get('foo') // Will return bar\r\ndb.has('foo') // Will return true\r\ndb.type('foo') // Will return string\r\ndb.is('foo', 'bar') // Will return true\r\n\r\ndb.all() // Will return all data\r\ndb.startsWith('f') // Will send you the array of the data which key's starts with f\r\n\r\ndb.set('foo', 1)\r\ndb.add('foo', 2) // Value would be 3 \r\ndb.subtract('foo', 2) // Value would be 2\r\n\r\ndb.delete('f') // Will delete key 'f'\r\ndb.deleteAll() // Will clear whole database! This will work only for default database table! If you are using custom table make sure that you use db.deleteTable()\r\n\r\ndb.set('foo', ['foo'])\r\ndb.push('foo', 'bar') // Will push value to the array!\r\ndb.includes('foo', 'bar') // Will return true\r\n```\r\n\r\n## Import Quick.DB data!\r\nFor those who wants to use this package but your Quick.DB has some important data! This is for you:\r\n\r\n```js\r\n// Import quick.db\r\nconst quick = require('quick.db')\r\n\r\n// Create db in enhanced.db\r\nconst db = require('enhanced.db')\r\n\r\ndb.importQuick(quick.all())\r\n\r\n// Will console.log you *Finished Exporting*\r\n```\r\n\r\n## Creating Tables\r\nCreate a custom table name which will be apart from the default database table\r\n\r\n```js\r\nconst db = require('enhanced.db')\r\nconst table = new db.Table('myTable', options)\r\n// 'myTable' is your table name\r\n// Options is same as you saw in the first 'clearOnStart' and 'filename'\r\n\r\ntable.set('foo', 'bar') // Will set value\r\ntable.get('foo') // Will return bar\r\ntable.has('foo') // Will return true\r\ntable.type('foo') // Will return string\r\ntable.is('foo', 'bar') // Will return true\r\n\r\ntable.all() // Will return all data\r\ntable.startsWith('f') // Will send you the array of the data which key's starts with f\r\n\r\ntable.set('foo', 1)\r\ntable.add('foo', 2) // Value would be 3\r\ntable.subtract('foo', 2) // Value would be 2\r\n\r\ntable.delete('f') // Will delete key 'f'\r\ntable.deleteTable() // Will clear whole database! This will work only for custom table!\r\n\r\ntable.set('foo', ['foo'])\r\ntable.push('foo', 'bar') // Will push value to the array!\r\ntable.includes('foo', 'bar') // Will return true\r\n```\r\n\r\n## Some Utility\r\n```js\r\nconst db = require('enhanced.db')\r\n\r\ndb.version // Returns current version of the package\r\n```\r\n\r\n## Read EDB Sqlite files\r\n\r\nUsing this class you can read edb sqlite files and use import to import data!\r\n\r\n```js\r\n// Import Read Constructor\r\nconst { Read } = require(\"enhanced.db\")\r\n\r\n// Set options if needed\r\nconst options = {\r\n    table: 'myCustomTable'\r\n}\r\n// Setting table will read that table of that file else it will read the default database one!\r\n\r\nconst data = new Read(filename, options)\r\n// FIlename would be the name of the file to read\r\n\r\nconsole.log(data.get())\r\n// Will you return the the data selected as your options selected!\r\n\r\n```\r\n\r\n## From Science Spot AKA Scientific Guy\r\n- [Support: Discord Server](https://discord.gg/FrduEZd)\r\n- [Issues: Github Repo](https://github.com/Scientific-Guy/enhanced.db)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscientific-dev%2Fenhanced.db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscientific-dev%2Fenhanced.db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscientific-dev%2Fenhanced.db/lists"}