# Platformatic v0.16.0

Hi Folks,

We are shipping another Platformatic release this week with a few new features and plenty of bugfixes!

## Generate `getSchema()` definitions

[`getSchema()`](https://www.fastify.io/docs/latest/Reference/Server/#getschema) is a useful utility to a reusable schema of an object. In Platformatic DB, we use this technique to share the schemas of all our entities. In [#700](https://github.com/platformatic/platformatic/pull/700), [@rozzilla](https://github.com/rozzilla) extended our typescript generator to include the types of those schemas.

```typescript
declare module 'fastify' {
  interface FastifyInstance {
    getSchema(schemaId: 'Movie'): {
      '$id': string,
      title: string,
      description: string,
      type: string,
      properties: object,
      required: string[]
    };
  }
}
```

## add request.platformaticContext decorator

We added a new `platformaticContext` [request decorator](https://www.fastify.io/docs/latest/Reference/Decorators/#decoraterequestname-value-dependencies) to help create an object with the right structure for the authorization plugin. Use it in this way in your custom plugins:

```js
  app.get('/all-pages', async (req, reply) => {
    // Optionally get the platformatic context.
    // Passing this to all sql-mapper functions allow to apply
    // authorization rules to the database queries (amongst other things).
    const ctx = req.platformaticContext
    // Will return all rows from 'pages' table
    const res = await app.platformatic.entities.page.find()
    const res = await app.platformatic.entities.page.find({ ctx })
    return res
  })
```

This new feature was added in https://github.com/platformatic/platformatic/pull/697.

## hot reload setting CLI flag

Platformatic hot reload functionality [might crash](https://github.com/platformatic/platformatic/issues/22) on your system. We are working on it, but it requires some new features in Node.js core to be implemented. In the meanwhile, you can disable it from the command line:

```sh
plt db start --hot-reload false
```

This feature was added by [@salesh](https://github.com/sales) in https://github.com/platformatic/platformatic/pull/679

## What's Changed

* docs(schema-type): Movie quotes tutorial update by [@rozzilla](https://github.com/rozzilla) in https://github.com/platformatic/platformatic/pull/708
* Fix nested transaction support in insertOne in https://github.com/platformatic/platformatic/pull/711
* chore(package.json): Update template by [@rozzilla](https://github.com/rozzilla) in https://github.com/platformatic/platformatic/pull/710
* Use platformatic bin in create-platformatic to support pnpm and yarn in https://github.com/platformatic/platformatic/pull/713
* fix(create-platformatic): create default migrations only when requested (#690) by [@marcelom97](https://github.com/marcelom97) in https://github.com/platformatic/platformatic/pull/712
* Adds minimum supported versions for databases by [@Marcellofabrizio](https://github.com/Marcellofabrizio) in https://github.com/platformatic/platformatic/pull/715
* Fix createdAt date formatting in Movie Quotes App tutorial by [@simonplend](https://github.com/simonplend) in https://github.com/platformatic/platformatic/pull/717
* Creates the GH action in the project folder by [@marcopiraccini](https://github.com/marcopiraccini) in https://github.com/platformatic/platformatic/pull/718
* fixes #636 by [@malforsaja](malforsaja) in https://github.com/platformatic/platformatic/pull/720
* Start platformatic from another folder with typescript enabled in https://github.com/platformatic/platformatic/pull/724


