[{"_path":"/guide/models","_draft":false,"_partial":false,"_empty":false,"title":"Models","description":"Models are SQL tables in your project which enable communication with the database, each model is connected to its respective controller. They are more than just a schema in avanda, they are used to create, read, update, delete and find data in your database.","excerpt":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"models"},"children":[{"type":"text","value":"Models"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Models are SQL tables in your project which enable communication with the database, each model is connected to its respective controller. They are more than just a schema in avanda, they are used to create, read, update, delete and find data in your database."}]},{"type":"element","tag":"h2","props":{"id":"create-a-model"},"children":[{"type":"text","value":"Create a Model"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Creating a model in avanda is the same as creating a table in SQL, keep in mind that each controller must have a model they are connected to."}]},{"type":"element","tag":"code","props":{"code":"$ yarn avanda create model -n <modelName> \n","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"$ yarn avanda create model -n <modelName> \n"}]}]}]},{"type":"element","tag":"h2","props":{"id":"model-usage"},"children":[{"type":"text","value":"Model Usage"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"A schema for the model must be created and installed to the database before usage check "},{"type":"element","tag":"a","props":{"href":"/components/avanda-orm/getting-started"},"children":[{"type":"text","value":"avanda ORM"}]},{"type":"text","value":" for guides on how to write schemas"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"After writing or editing the schema, the model must be installed to the database to get started with the created model. Run the following command on your OS terminal to install the model to the database"}]},{"type":"element","tag":"code","props":{"code":"$ yarn avanda app install -t <modelName> \n","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"$ yarn avanda app install -t <modelName> \n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Using models in your project is different depending on where they are used"}]},{"type":"element","tag":"blockquote","props":{},"children":[{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Note: Every instance of a model is a promise and must use the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"await"}]},{"type":"text","value":" syntax"}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Here are some guide on using models in your projects:"}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"element","tag":"h3","props":{"id":"usage-in-respective-controller"},"children":[{"type":"text","value":"Usage in Respective Controller"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Every controller has a model attached to it and the model is available for use in the connected controller. So it is used with the keyword "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"this"}]}]},{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const { blogContent, tags, author, postTitle } = req.data;\n    const post = await this.model.create({\n      user_id: author.id,\n      author: author.username,\n      title: postTitle,\n      content: blogContent,\n      tags: tags,\n    });\n    if(!post){\n      return res.error(\"blogPost not created\") // if error occurs\n    }\n    return res.success(\"blogPost created successfully\", post); // returns post created\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const { blogContent, tags, author, postTitle } = req.data;\n    const post = await this.model.create({\n      user_id: author.id,\n      author: author.username,\n      title: postTitle,\n      content: blogContent,\n      tags: tags,\n    });\n    if(!post){\n      return res.error(\"blogPost not created\") // if error occurs\n    }\n    return res.success(\"blogPost created successfully\", post); // returns post created\n  }\n\n}\n"}]}]}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"element","tag":"h3","props":{"id":"global-usage"},"children":[{"type":"text","value":"Global usage"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"A new instance of the model needs to called when using a model globally or in a controller that is not connected to the model"}]},{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport Blog from \"../models/Blog\"\nimport UserModel from \"../models/User\"\n\nexport default class User extends Controller {\n    model?:  UserModel\n    @Post()\n    async getAllPostWithUser(res: Response,req: Request){\n        const { user_id_client } = req.data;\n        let allData = await new Blog().where({user_id: user_id_client }).all()\n        if(!post){\n            return res.error(\"Blogs not found\") // if error occurs\n        }\n        return res.success(\"User Blogpost found\", allData); // returns blogpost gotten from the databse\n    }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport Blog from \"../models/Blog\"\nimport UserModel from \"../models/User\"\n\nexport default class User extends Controller {\n    model?:  UserModel\n    @Post()\n    async getAllPostWithUser(res: Response,req: Request){\n        const { user_id_client } = req.data;\n        let allData = await new Blog().where({user_id: user_id_client }).all()\n        if(!post){\n            return res.error(\"Blogs not found\") // if error occurs\n        }\n        return res.success(\"User Blogpost found\", allData); // returns blogpost gotten from the databse\n    }\n\n}\n"}]}]}]},{"type":"element","tag":"h2","props":{"id":"model-options"},"children":[{"type":"text","value":"Model Options"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Model options are methods paired with an instance of a model to query or perform certain actions to the table in the database"}]},{"type":"element","tag":"h3","props":{"id":"operations-options"},"children":[{"type":"text","value":"Operations Options"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"These are model methods used to perform certain operations on a model"}]},{"type":"element","tag":"h4","props":{"id":"create"},"children":[{"type":"text","value":".create()"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"creates a new row of data in the table in the database, accepts an object where the key is the "},{"type":"element","tag":"a","props":{"href":"/components/avanda-orm-getting-started#Column"},"children":[{"type":"text","value":"column_name"}]},{"type":"text","value":" and the value is the value to create"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const { blogContent, tags, author, postTitle } = req.data;\n    const post = await this.model.create({\n      user_id: author.id,\n      author: author.username,\n      title: postTitle,\n      content: blogContent,\n      tags: tags,\n    });\n    if(!post){\n      return res.error(\"blogPost not created\") // if error occurs\n    }\n    return res.success(\"blogPost created successfully\", post); // returns post created\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const { blogContent, tags, author, postTitle } = req.data;\n    const post = await this.model.create({\n      user_id: author.id,\n      author: author.username,\n      title: postTitle,\n      content: blogContent,\n      tags: tags,\n    });\n    if(!post){\n      return res.error(\"blogPost not created\") // if error occurs\n    }\n    return res.success(\"blogPost created successfully\", post); // returns post created\n  }\n\n}\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n"}]}]}]}]}]},{"type":"element","tag":"h4","props":{"id":"update"},"children":[{"type":"text","value":".update()"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"updates an existing row of data in the table in the database, accepts an object where the key is the "},{"type":"element","tag":"a","props":{"href":"/components/avanda-orm-getting-started#Column"},"children":[{"type":"text","value":"column_name"}]},{"type":"text","value":" and the value is the value to update"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const { user_id } = req.data;\n    await new User().where({id: user_id }).update({\n      email_verification_token : null // updates the user's email_verification_token to null\n    })\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const { user_id } = req.data;\n    await new User().where({id: user_id }).update({\n      email_verification_token : null // updates the user's email_verification_token to null\n    })\n  }\n\n}\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Column,Model} from \"@avanda/orm\";\n\nexport default class User extends Model{\n    id?: number;\n\n    @Column.text({\n        index:{\n          type: \"UNIQUE\",\n          name: \"unique_email\"\n        },\n        masSize: 255\n    })\n    email?: string\n\n    @Column.text()\n    password?: string\n\n    @Column.text({\n        nullable: true\n    })\n    email_verification_token?: string\n\n    @Column.text()\n    full_name?: string\n}\n","filename":"models/User.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Column,Model} from \"@avanda/orm\";\n\nexport default class User extends Model{\n    id?: number;\n\n    @Column.text({\n        index:{\n          type: \"UNIQUE\",\n          name: \"unique_email\"\n        },\n        masSize: 255\n    })\n    email?: string\n\n    @Column.text()\n    password?: string\n\n    @Column.text({\n        nullable: true\n    })\n    email_verification_token?: string\n\n    @Column.text()\n    full_name?: string\n}\n"}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"delete"},"children":[{"type":"text","value":"delete()"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"deletes an existing row of data in the table in the database"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().where({column_name: value }).delete() \n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"await new Model().where({column_name: value }).delete() \n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async controllerFunction(res: Response, req: Request) {\n    const { user_id } = req.data;\n    await new User().where({id: user_id }).delete() // delete the user with the user_id passed\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async controllerFunction(res: Response, req: Request) {\n    const { user_id } = req.data;\n    await new User().where({id: user_id }).delete() // delete the user with the user_id passed\n  }\n\n}\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n"}]}]}]}]}]},{"type":"element","tag":"h2","props":{"id":"query-options"},"children":[{"type":"text","value":"Query Options"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"These are the list of methods to query a model. Other Model options can be tagged along with the query options to factor down the query records"}]},{"type":"element","tag":"h3","props":{"id":"find"},"children":[{"type":"text","value":"find"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"return an object of the first record with the specified "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"id"}]}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().find(id)\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"await new Model().find(id)\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const blogWithId await new User().find(some_id) // finds the row in the user model with the id of some_id\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const blogWithId await new User().find(some_id) // finds the row in the user model with the id of some_id\n  }\n\n}\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n"}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"findby"},"children":[{"type":"text","value":"findBy"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds and return an object of the first record that fulfill a specified column_name and value. It is an alternative to "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".where({col: val}).first()"}]}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().findBy(column_name, value)\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"await new Model().findBy(column_name, value)\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const firstBlogWithUserIdSpecified =  await this.model.findBy(user_id, some_id) // finds the firts blog where the user_id is equal to the some_id specified\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const firstBlogWithUserIdSpecified =  await this.model.findBy(user_id, some_id) // finds the firts blog where the user_id is equal to the some_id specified\n  }\n\n}\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n"}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"findall"},"children":[{"type":"text","value":"findAll"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds and returns an array of records with the specified "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"id"}]}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().findAll(id)\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"await new Model().findAll(id)\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const allUserWithId =  await this.model.findAll(some_id)// finds all the user where the id is equal to the some_id specified\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const allUserWithId =  await this.model.findAll(some_id)// finds all the user where the id is equal to the some_id specified\n  }\n\n}\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Column,Model} from \"@avanda/orm\";\n\nexport default class User extends Model{\n    id?: number;\n\n    @Column.text({\n        index:{\n          type: \"UNIQUE\",\n          name: \"unique_email\"\n        },\n        masSize: 255\n    })\n    email?: string\n\n    @Column.text()\n    password?: string\n\n    @Column.text({\n        nullable: true\n    })\n    email_verification_token?: string\n\n    @Column.text()\n    full_name?: string\n}\n","filename":"models/User.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Column,Model} from \"@avanda/orm\";\n\nexport default class User extends Model{\n    id?: number;\n\n    @Column.text({\n        index:{\n          type: \"UNIQUE\",\n          name: \"unique_email\"\n        },\n        masSize: 255\n    })\n    email?: string\n\n    @Column.text()\n    password?: string\n\n    @Column.text({\n        nullable: true\n    })\n    email_verification_token?: string\n\n    @Column.text()\n    full_name?: string\n}\n"}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"findallby"},"children":[{"type":"text","value":"findAllBy"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds and returns all the records that fulfill a specified column_name and value. It is an alternative to "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".where({col: val}).all()"}]}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().findAllBy(column_name, value)\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"await new Model().findAllBy(column_name, value)\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const allBlogWithUserIdSpecified =  await this.model.findAllBy(user_id, some_id) // finds all the blog where the user_id is equal to the some_id specified\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const allBlogWithUserIdSpecified =  await this.model.findAllBy(user_id, some_id) // finds all the blog where the user_id is equal to the some_id specified\n  }\n\n}\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n"}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"where"},"children":[{"type":"text","value":"where"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds only those records that fulfill a specified column_name and value. Mostly used with "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".first"}]},{"type":"text","value":" to get the first record and "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".all"}]},{"type":"text","value":" to get all the records"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().where({column_name: value})\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"await new Model().where({column_name: value})\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const allBlogWithUserIdSpecified =  await this.model.where({user_id: some_id}).all() // finds all the blog where the user_id is equal to the some_id specified\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const allBlogWithUserIdSpecified =  await this.model.where({user_id: some_id}).all() // finds all the blog where the user_id is equal to the some_id specified\n  }\n\n}\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n"}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"wherecolin"},"children":[{"type":"text","value":"whereColIn"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds only those records where the specified column_name has a value that exists inside the specified values array"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().whereColIn(column_name, [value1, value2,...])\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"await new Model().whereColIn(column_name, [value1, value2,...])\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n      let some_ids = [1,3,5]\n    const allBlogWithUserIdArraySpecified =  await this.model.whereColIn(user_id, some_ids).all() // finds all the blog where the user_id is equal to any of the element in the some_id array\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n      let some_ids = [1,3,5]\n    const allBlogWithUserIdArraySpecified =  await this.model.whereColIn(user_id, some_ids).all() // finds all the blog where the user_id is equal to any of the element in the some_id array\n  }\n\n}\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n"}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"wherecolnotin"},"children":[{"type":"text","value":"whereColNotIn"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds only those records where the specified column_name does not have a value that exists inside the specified values array"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().whereColNotIn(column_name, [value1, value2,...])\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"await new Model().whereColNotIn(column_name, [value1, value2,...])\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n      let some_ids = [1,3,5]\n    const allBlogWithUserIdArraySpecified =  await this.model.whereColNotIn(user_id, some_ids).all() // finds all the blog where the user_id is not equal to any of the element in the some_id array\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n      let some_ids = [1,3,5]\n    const allBlogWithUserIdArraySpecified =  await this.model.whereColNotIn(user_id, some_ids).all() // finds all the blog where the user_id is not equal to any of the element in the some_id array\n  }\n\n}\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n"}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"wherecolisnull"},"children":[{"type":"text","value":"whereColIsNull"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds only those records where the specified column_name value is null"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().whereColIsNull(column_name)\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"await new Model().whereColIsNull(column_name)\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const allBlogWithTagsNull =  await this.model.whereColIsNull(tags).all() // finds all the blog where the tags column value is null \n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const allBlogWithTagsNull =  await this.model.whereColIsNull(tags).all() // finds all the blog where the tags column value is null \n  }\n\n}\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n"}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"wherecolisnotnull"},"children":[{"type":"text","value":"whereColIsNotNull"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds only those records where the specified column_name value is  not null"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().whereColIsNotNull(column_name)\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"await new Model().whereColIsNotNull(column_name)\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const allBlogWithTagsNull =  await this.model.whereColIsNotNull(tags).all() // finds all the blog where the tags column value is null \n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const allBlogWithTagsNull =  await this.model.whereColIsNotNull(tags).all() // finds all the blog where the tags column value is null \n  }\n\n}\n"}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n"}]}]}]}]}]}]},"body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"models"},"children":[{"type":"text","value":"Models"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Models are SQL tables in your project which enable communication with the database, each model is connected to its respective controller. They are more than just a schema in avanda, they are used to create, read, update, delete and find data in your database."}]},{"type":"element","tag":"h2","props":{"id":"create-a-model"},"children":[{"type":"text","value":"Create a Model"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Creating a model in avanda is the same as creating a table in SQL, keep in mind that each controller must have a model they are connected to."}]},{"type":"element","tag":"code","props":{"code":"$ yarn avanda create model -n <modelName> \n","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"$ yarn avanda create model -n "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"<"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"modelName"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":">"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]}]}]}]}]},{"type":"element","tag":"h2","props":{"id":"model-usage"},"children":[{"type":"text","value":"Model Usage"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"A schema for the model must be created and installed to the database before usage check "},{"type":"element","tag":"a","props":{"href":"/components/avanda-orm/getting-started"},"children":[{"type":"text","value":"avanda ORM"}]},{"type":"text","value":" for guides on how to write schemas"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"After writing or editing the schema, the model must be installed to the database to get started with the created model. Run the following command on your OS terminal to install the model to the database"}]},{"type":"element","tag":"code","props":{"code":"$ yarn avanda app install -t <modelName> \n","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"$ yarn avanda app install -t "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"<"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"modelName"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":">"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Using models in your project is different depending on where they are used"}]},{"type":"element","tag":"blockquote","props":{},"children":[{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Note: Every instance of a model is a promise and must use the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"await"}]},{"type":"text","value":" syntax"}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Here are some guide on using models in your projects:"}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"element","tag":"h3","props":{"id":"usage-in-respective-controller"},"children":[{"type":"text","value":"Usage in Respective Controller"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Every controller has a model attached to it and the model is available for use in the connected controller. So it is used with the keyword "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"this"}]}]},{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const { blogContent, tags, author, postTitle } = req.data;\n    const post = await this.model.create({\n      user_id: author.id,\n      author: author.username,\n      title: postTitle,\n      content: blogContent,\n      tags: tags,\n    });\n    if(!post){\n      return res.error(\"blogPost not created\") // if error occurs\n    }\n    return res.success(\"blogPost created successfully\", post); // returns post created\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"createPost"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" { blogContent, tags, author, postTitle } "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" req.data;"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" post "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"this"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":".model."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"create"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" author.id,"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      author"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" author.username,"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      title"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" postTitle,"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      content"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" blogContent,"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      tags"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" tags,"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    });"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"if"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"!"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"post){"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"return"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" res."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"error"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"blogPost not created"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// if error occurs"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"return"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" res."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"success"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"blogPost created successfully"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", post); "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// returns post created"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"element","tag":"h3","props":{"id":"global-usage"},"children":[{"type":"text","value":"Global usage"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"A new instance of the model needs to called when using a model globally or in a controller that is not connected to the model"}]},{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport Blog from \"../models/Blog\"\nimport UserModel from \"../models/User\"\n\nexport default class User extends Controller {\n    model?:  UserModel\n    @Post()\n    async getAllPostWithUser(res: Response,req: Request){\n        const { user_id_client } = req.data;\n        let allData = await new Blog().where({user_id: user_id_client }).all()\n        if(!post){\n            return res.error(\"Blogs not found\") // if error occurs\n        }\n        return res.success(\"User Blogpost found\", allData); // returns blogpost gotten from the databse\n    }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" Blog "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" UserModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"UserModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"getAllPostWithUser"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":","}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"){"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" { user_id_client } "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" req.data;"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"let"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" allData "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"where"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" user_id_client })."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"all"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"if"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"!"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"post){"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"            "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"return"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" res."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"error"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"Blogs not found"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// if error occurs"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"return"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" res."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"success"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"User Blogpost found"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", allData); "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// returns blogpost gotten from the databse"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]},{"type":"element","tag":"h2","props":{"id":"model-options"},"children":[{"type":"text","value":"Model Options"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Model options are methods paired with an instance of a model to query or perform certain actions to the table in the database"}]},{"type":"element","tag":"h3","props":{"id":"operations-options"},"children":[{"type":"text","value":"Operations Options"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"These are model methods used to perform certain operations on a model"}]},{"type":"element","tag":"h4","props":{"id":"create"},"children":[{"type":"text","value":".create()"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"creates a new row of data in the table in the database, accepts an object where the key is the "},{"type":"element","tag":"a","props":{"href":"/components/avanda-orm-getting-started#Column"},"children":[{"type":"text","value":"column_name"}]},{"type":"text","value":" and the value is the value to create"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const { blogContent, tags, author, postTitle } = req.data;\n    const post = await this.model.create({\n      user_id: author.id,\n      author: author.username,\n      title: postTitle,\n      content: blogContent,\n      tags: tags,\n    });\n    if(!post){\n      return res.error(\"blogPost not created\") // if error occurs\n    }\n    return res.success(\"blogPost created successfully\", post); // returns post created\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"createPost"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" { blogContent, tags, author, postTitle } "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" req.data;"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" post "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"this"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":".model."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"create"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" author.id,"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      author"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" author.username,"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      title"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" postTitle,"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      content"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" blogContent,"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      tags"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" tags,"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    });"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"if"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"!"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"post){"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"return"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" res."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"error"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"blogPost not created"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// if error occurs"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"return"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" res."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"success"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"blogPost created successfully"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", post); "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// returns post created"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" User "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Column,Model} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/orm"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"int"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        references"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    author"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    title"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    content"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"json"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    tags"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"[];"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    category"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]}]},{"type":"element","tag":"h4","props":{"id":"update"},"children":[{"type":"text","value":".update()"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"updates an existing row of data in the table in the database, accepts an object where the key is the "},{"type":"element","tag":"a","props":{"href":"/components/avanda-orm-getting-started#Column"},"children":[{"type":"text","value":"column_name"}]},{"type":"text","value":" and the value is the value to update"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const { user_id } = req.data;\n    await new User().where({id: user_id }).update({\n      email_verification_token : null // updates the user's email_verification_token to null\n    })\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"createPost"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" { user_id } "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" req.data;"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"where"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" user_id })."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"update"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      email_verification_token "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"null"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// updates the user's email_verification_token to null"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Column,Model} from \"@avanda/orm\";\n\nexport default class User extends Model{\n    id?: number;\n\n    @Column.text({\n        index:{\n          type: \"UNIQUE\",\n          name: \"unique_email\"\n        },\n        masSize: 255\n    })\n    email?: string\n\n    @Column.text()\n    password?: string\n\n    @Column.text({\n        nullable: true\n    })\n    email_verification_token?: string\n\n    @Column.text()\n    full_name?: string\n}\n","filename":"models/User.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Column,Model} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/orm"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        index"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"          type"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"UNIQUE"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":","}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"          name"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"unique_email"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        },"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        masSize"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"255"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    email"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    password"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    email_verification_token"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    full_name"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"delete"},"children":[{"type":"text","value":"delete()"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"deletes an existing row of data in the table in the database"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().where({column_name: value }).delete() \n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"where"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({column_name"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" value })."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"delete"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async controllerFunction(res: Response, req: Request) {\n    const { user_id } = req.data;\n    await new User().where({id: user_id }).delete() // delete the user with the user_id passed\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"controllerFunction"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" { user_id } "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" req.data;"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"where"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" user_id })."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"delete"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// delete the user with the user_id passed"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" User "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Column,Model} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/orm"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"int"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        references"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    author"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    title"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    content"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"json"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    tags"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"[];"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    category"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]}]},{"type":"element","tag":"h2","props":{"id":"query-options"},"children":[{"type":"text","value":"Query Options"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"These are the list of methods to query a model. Other Model options can be tagged along with the query options to factor down the query records"}]},{"type":"element","tag":"h3","props":{"id":"find"},"children":[{"type":"text","value":"find"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"return an object of the first record with the specified "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"id"}]}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().find(id)\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"find"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(id)"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const blogWithId await new User().find(some_id) // finds the row in the user model with the id of some_id\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"createPost"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {some_id } "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" req.data;"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" blogWithId await new User().find(some_id) "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// finds the row in the user model with the id of some_id"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" User "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Column,Model} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/orm"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"int"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        references"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    author"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    title"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    content"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"json"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    tags"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"[];"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    category"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"findby"},"children":[{"type":"text","value":"findBy"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds and return an object of the first record that fulfill a specified column_name and value. It is an alternative to "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".where({col: val}).first()"}]}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().findBy(column_name, value)\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"findBy"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(column_name, value)"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const firstBlogWithUserIdSpecified =  await this.model.findBy(user_id, some_id) // finds the firts blog where the user_id is equal to the some_id specified\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"createPost"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {some_id } "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" req.data;"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" firstBlogWithUserIdSpecified "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"this"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":".model."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"findBy"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(user_id, some_id) "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// finds the firts blog where the user_id is equal to the some_id specified"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" User "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Column,Model} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/orm"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"int"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        references"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    author"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    title"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    content"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"json"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    tags"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"[];"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    category"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"findall"},"children":[{"type":"text","value":"findAll"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds and returns an array of records with the specified "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"id"}]}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().findAll(id)\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"findAll"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(id)"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const allUserWithId =  await this.model.findAll(some_id)// finds all the user where the id is equal to the some_id specified\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"createPost"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {some_id } "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" req.data;"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" allUserWithId "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"this"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":".model."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"findAll"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(some_id)"}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// finds all the user where the id is equal to the some_id specified"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Column,Model} from \"@avanda/orm\";\n\nexport default class User extends Model{\n    id?: number;\n\n    @Column.text({\n        index:{\n          type: \"UNIQUE\",\n          name: \"unique_email\"\n        },\n        masSize: 255\n    })\n    email?: string\n\n    @Column.text()\n    password?: string\n\n    @Column.text({\n        nullable: true\n    })\n    email_verification_token?: string\n\n    @Column.text()\n    full_name?: string\n}\n","filename":"models/User.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Column,Model} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/orm"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        index"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"          type"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"UNIQUE"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":","}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"          name"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"unique_email"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        },"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        masSize"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"255"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    email"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    password"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    email_verification_token"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    full_name"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"findallby"},"children":[{"type":"text","value":"findAllBy"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds and returns all the records that fulfill a specified column_name and value. It is an alternative to "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".where({col: val}).all()"}]}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().findAllBy(column_name, value)\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"findAllBy"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(column_name, value)"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const allBlogWithUserIdSpecified =  await this.model.findAllBy(user_id, some_id) // finds all the blog where the user_id is equal to the some_id specified\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"createPost"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {some_id } "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" req.data;"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" allBlogWithUserIdSpecified "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"this"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":".model."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"findAllBy"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(user_id, some_id) "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// finds all the blog where the user_id is equal to the some_id specified"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" User "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Column,Model} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/orm"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"int"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        references"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    author"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    title"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    content"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"json"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    tags"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"[];"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    category"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"where"},"children":[{"type":"text","value":"where"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds only those records that fulfill a specified column_name and value. Mostly used with "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".first"}]},{"type":"text","value":" to get the first record and "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".all"}]},{"type":"text","value":" to get all the records"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().where({column_name: value})\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"where"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({column_name"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" value})"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const {some_id } = req.data;\n    const allBlogWithUserIdSpecified =  await this.model.where({user_id: some_id}).all() // finds all the blog where the user_id is equal to the some_id specified\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"createPost"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {some_id } "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" req.data;"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" allBlogWithUserIdSpecified "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"this"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":".model."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"where"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" some_id})."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"all"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// finds all the blog where the user_id is equal to the some_id specified"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" User "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Column,Model} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/orm"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"int"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        references"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    author"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    title"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    content"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"json"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    tags"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"[];"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    category"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"wherecolin"},"children":[{"type":"text","value":"whereColIn"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds only those records where the specified column_name has a value that exists inside the specified values array"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().whereColIn(column_name, [value1, value2,...])\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"whereColIn"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(column_name, [value1, value2,"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"..."}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"])"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n      let some_ids = [1,3,5]\n    const allBlogWithUserIdArraySpecified =  await this.model.whereColIn(user_id, some_ids).all() // finds all the blog where the user_id is equal to any of the element in the some_id array\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"createPost"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"let"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" some_ids "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" ["}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"1"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":","}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"3"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":","}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"5"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"]"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" allBlogWithUserIdArraySpecified "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"this"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":".model."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"whereColIn"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(user_id, some_ids)."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"all"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// finds all the blog where the user_id is equal to any of the element in the some_id array"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" User "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Column,Model} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/orm"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"int"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        references"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    author"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    title"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    content"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"json"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    tags"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"[];"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    category"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"wherecolnotin"},"children":[{"type":"text","value":"whereColNotIn"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds only those records where the specified column_name does not have a value that exists inside the specified values array"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().whereColNotIn(column_name, [value1, value2,...])\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"whereColNotIn"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(column_name, [value1, value2,"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"..."}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"])"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n      let some_ids = [1,3,5]\n    const allBlogWithUserIdArraySpecified =  await this.model.whereColNotIn(user_id, some_ids).all() // finds all the blog where the user_id is not equal to any of the element in the some_id array\n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"createPost"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"      "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"let"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" some_ids "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" ["}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"1"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":","}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"3"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":","}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"5"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"]"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" allBlogWithUserIdArraySpecified "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"this"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":".model."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"whereColNotIn"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(user_id, some_ids)."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"all"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// finds all the blog where the user_id is not equal to any of the element in the some_id array"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" User "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Column,Model} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/orm"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"int"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        references"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    author"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    title"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    content"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"json"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    tags"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"[];"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    category"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"wherecolisnull"},"children":[{"type":"text","value":"whereColIsNull"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds only those records where the specified column_name value is null"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().whereColIsNull(column_name)\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"whereColIsNull"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(column_name)"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const allBlogWithTagsNull =  await this.model.whereColIsNull(tags).all() // finds all the blog where the tags column value is null \n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"createPost"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" allBlogWithTagsNull "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"this"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":".model."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"whereColIsNull"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(tags)."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"all"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// finds all the blog where the tags column value is null "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" User "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Column,Model} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/orm"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"int"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        references"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    author"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    title"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    content"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"json"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    tags"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"[];"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    category"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"wherecolisnotnull"},"children":[{"type":"text","value":"whereColIsNotNull"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"finds only those records where the specified column_name value is  not null"}]},{"type":"element","tag":"code-group","props":{"toggle-text":"Usage,Example,Schema"},"children":[{"type":"element","tag":"template","props":{"v-slot:Usage":""},"children":[{"type":"element","tag":"code","props":{"code":"await new Model().whereColIsNotNull(column_name)\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"whereColIsNotNull"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(column_name)"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Example":""},"children":[{"type":"element","tag":"code","props":{"code":"import {Controller, Request, Response, Get} from \"@avanda/http\";\nimport BlogModel from \"../models/Blog\"\n\nexport default class Blog extends Controller {\n    model?:  BlogModel\n    @Post() //accepts middleware \n    async createPost(res: Response, req: Request) {\n    const allBlogWithTagsNull =  await this.model.whereColIsNotNull(tags).all() // finds all the blog where the tags column value is null \n  }\n\n}\n","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Controller, Request, Response, Get} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/http"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" BlogModel "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Controller"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"BlogModel"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Post"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"//accepts middleware "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"async"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"createPost"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Response"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":", "}]},{"type":"element","tag":"span","props":{"style":{"color":"#FFB86C"}},"children":[{"type":"text","value":"req"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Request"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":") {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"const"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" allBlogWithTagsNull "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"="}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"await"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"this"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":".model."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"whereColIsNotNull"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"(tags)."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"all"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"() "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7B7F8B"}},"children":[{"type":"text","value":"// finds all the blog where the tags column value is null "}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"  }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]},{"type":"element","tag":"template","props":{"v-slot:Schema":""},"children":[{"type":"element","tag":"code","props":{"code":"import User from '../models/User';\nimport {Column,Model} from \"@avanda/orm\";\n\nexport default class Blog extends Model{\n    id?: number;\n\n    @Column.int({\n        references: new User()\n    })\n    user_id?: number;\n\n    @Column.text()\n    author?:string;\n\n    @Column.text()\n    title?:string;\n\n    @Column.text()\n    content?:string;\n\n    @Column.json({\n        nullable:true\n    })\n    tags?:string[];\n\n    @Column.text({\n        nullable:true\n    })\n    category?:string;\n}\n","filename":"models/BlogPost.ts","language":"ts"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" User "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"../models/User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"'"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"import"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" {Column,Model} "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"from"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#E7EE98"}},"children":[{"type":"text","value":"@avanda/orm"}]},{"type":"element","tag":"span","props":{"style":{"color":"#DEE492"}},"children":[{"type":"text","value":"\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"export"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"default"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"class"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Blog"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"extends"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"Model"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"int"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        references"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"new"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"User"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    user_id"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"number"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    author"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    title"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"()"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    content"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"json"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    tags"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"[];"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    @"}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"Column"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#62E884"}},"children":[{"type":"text","value":"text"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"({"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"        nullable"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":":"}]},{"type":"element","tag":"span","props":{"style":{"color":"#BF9EEE"}},"children":[{"type":"text","value":"true"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    })"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"    category"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F286C4"}},"children":[{"type":"text","value":"?:"}]},{"type":"element","tag":"span","props":{"style":{"color":"#97E1F1"}},"children":[{"type":"text","value":"string"}]},{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":";"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#F6F6F4"}},"children":[{"type":"text","value":"}"}]}]}]}]}]}]}]}],"toc":{"title":"","searchDepth":3,"depth":3,"links":[{"id":"create-a-model","depth":2,"text":"Create a Model"},{"id":"model-usage","depth":2,"text":"Model Usage","children":[{"id":"usage-in-respective-controller","depth":3,"text":"Usage in Respective Controller"},{"id":"global-usage","depth":3,"text":"Global usage"}]},{"id":"model-options","depth":2,"text":"Model Options","children":[{"id":"operations-options","depth":3,"text":"Operations Options","children":[{"id":"create","depth":4,"text":".create()"},{"id":"update","depth":4,"text":".update()"}]},{"id":"delete","depth":3,"text":"delete()"}]},{"id":"query-options","depth":2,"text":"Query Options","children":[{"id":"find","depth":3,"text":"find"},{"id":"findby","depth":3,"text":"findBy"},{"id":"findall","depth":3,"text":"findAll"},{"id":"findallby","depth":3,"text":"findAllBy"},{"id":"where","depth":3,"text":"where"},{"id":"wherecolin","depth":3,"text":"whereColIn"},{"id":"wherecolnotin","depth":3,"text":"whereColNotIn"},{"id":"wherecolisnull","depth":3,"text":"whereColIsNull"},{"id":"wherecolisnotnull","depth":3,"text":"whereColIsNotNull"}]}]}},"_type":"markdown","_id":"content:3.guide:2.models.md","_source":"content","_file":"3.guide/2.models.md","_extension":"md"},null]