{"repo":"andrewitsover/midnight","free":true,"listed":false,"github":"https://github.com/andrewitsover/midnight","clone":"git clone https://github.com/andrewitsover/midnight.git","description":"An ORM for SQLite","language":"JavaScript","stars":553,"topics":["nodejs","orm","sqlite"],"license":"MIT","category":"databases-storage","readme_excerpt":"🌒 Midnight The time after the 11th hour. Midnight is a NodeJS ORM for SQLite with full TypeScript support without needing to generate any code. Even complex SQL queries can be written inside of JavaScript. Tables are written like this: There are two levels of API. The first is a table-level syntax for basic queries. The second type of syntax is much like SQL and builds on many of the new features that JavaScript has added to its language in recent times. This syntax allows you to perform queries that usually aren't possible in ORMs. Getting started Prerequists Make sure you have installed Node.js version 26.1.0 or higher. Creating a project Create a directory for your project and initialise it with npm: In the package.json, change the following lines: Paste the code below into the file. This example will create a table in a database named and then insert and read some rows. For support in a JavaScript project, add a file in the root folder of the project with the following options: To run it, you can use from the project root directory. It is a good idea to set any SQLite database that you have created to . You can do this yourself after the database has been created. See here for more details. The API Every table has , , , , , , , , , , , and methods available to it. Insert inserts a row into the database. For batch inserts you can use , which takes an array of objects. and return all of the inserted objects. Update takes an object with an optional property, and a property.","default_branch":null,"files":null,"tree":[],"storefront":"/r/andrewitsover","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/andrewitsover/midnight/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}