// import User from './dbs/example-users'
// import Post from './dbs/example-posts'

// /**
//  * CREATE
//  */
// const singleuserdata = { username: 'kiran' }
// const multiplepostsdata = [
//   { title: 'Lorem ipsum dolor sit amet', ownerid: 1 },
//   { title: 'consectetur adipiscing elit', ownerid: 1 },
// ]

// const signleusercreated = User.create(singleuserdata)
// const multiplepostscreated = Post.create(multiplepostsdata)

// console.log({ signleusercreated, multiplepostscreated })
// /**
//  * OUTPUT
//  */
// // {
// //   signleusercreated: { ok: true, affectedIDs: 1 },
// //   multiplepostscreated: [
// //     { ok: true, affectedIDs: 1 },
// //     { ok: true, affectedIDs: 2 }
// //   ]
// // }

/**
 * READ
 */
// const users = User.read()
// console.log({ users })
/**
 * OUTPUT
 */
// { users: [ { username: 'kiran', id: 1 } ] }

/**
 * UPDATE
 */
// const newpostdata = { title: 'consectetur adipiscing elit', ownerid: 2 }
// const updated = Post.where((post: any) => post.id == 2).update(newpostdata)
// console.log({ updated })
/**
 * OUTPUT
 */
// { updated: { ok: true, affectedIDs: [ 2 ] } }

/**
 * DELETE
 */
// const deleted = Post.where((post: any) => post.id == 2).delete()
// console.log({ deleted })
/**
 * OUTPUT
 */
// { deleted: { ok: true, affectedIDs: [ 2 ] } }

/**
 * JOIN
 */
// const useranditisposts = User.where((user: any) => user.id == 1).join('posts', 'ownerid')
// import fs from 'fs'
// fs.writeFileSync('./output.txt', JSON.stringify(useranditisposts, null, 2))
/**
 * OUTPUT
 */
// [
//   {
//     "username": "kiran",
//     "id": 1,
//     "posts": [
//       {
//         "title": "Lorem ipsum dolor sit amet",
//         "ownerid": 1,
//         "id": 1
//       }
//     ]
//   }
// ]