You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB

#!/usr/bin/env -S deno run -c ./tsconfig.json --unstable --allow-read --allow-env --allow-net
/* Main executable for the Daton app. */
import { make, Scaffolding, Application } from './bundle/daton.ts'
import units from './units.ts'
/*
* Let's get up and running. The scaffolding provides the bare minimum
* amount of support required to get Daton up and running. The app handles
* the rest.
*/
const scaffolding = make(Scaffolding)
await scaffolding.up()
/*
* Now, import the units and start the application. The units define each
* modular piece of functionality that is managed by the Daton app.
*/
const app = make(Application, units)
await app.run()
import UserModel from './models/User.model.ts'
import ObjectResultOperator from "../orm/src/builder/type/result/ObjectResultOperator.ts";
// const users = await UserModel.find_one({ username: 'garrettmills' })
const sel = UserModel.select('*').with('login_attempts').where('username', '=', 'garrettmills')
console.log(sel)
console.log(sel.clone())
const gm = await sel.results().first()
console.log(gm)
const la = (await gm.login_attempts()).first()
console.log(la)
console.log(await la.user())
// console.log(await las.fetchRelated())