# Platformatic v0.10.0

Hi Folks,

Another week, another release of Platformatic. We are busy fixing bugs and improving things. If something is not working or it's not clear for you, reach out via [Discord](https://discord.gg/platformatic) or through [GitHub Issues](https://github.com/platformatic/platformatic/issues/new).

The full release notes are available at: https://github.com/platformatic/platformatic/releases/tag/v0.10.0

Here are the highlights of this release.

## feat(config): Add schema JSON

[Roberto Bianchi](https://github.com/rozzilla) sent this amazing contribution to automatically generate the Platformatic DB configuration schema when doing `plt db init`, so that you can have autocompletion of all the configurations options. Check it out in action:

<iframe width="640" height="416" src="https://www.loom.com/embed/992b7abc08584309b73467b61105df34"></iframe>

## Fetch all relation keys when fetching relations in GraphQL

In [#428](https://github.com/platformatic/platformatic/issues/428), [Anwar Salim](https://github.com/pccrazy) found a bad crash of Platformatic DB when accessing a graph that was 3 level deep. As an example, the following query lead to a bad crash:

```graphql
query companyWithSocialMedia {
  company {
    name
    companySocialMedias {
      username
      socialMedias {
        name
        baseUrl
      }
    }
  }
}
```

Here is the crash details:

```plaintext
TypeError: Cannot read properties of undefined (reading 'toString')
    at Wrapper.loader [as func] (/run/media/anwar/data/dev-playground/infodrop-monorepo/node_modules/@platformatic/db-core/node_modules/@platformatic/sql-graphql/lib/relationship.js:42:59)
    at /run/media/anwar/data/dev-playground/infodrop-monorepo/node_modules/single-user-cache/index.js:93:12
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
```

This was fixed in [#432](https://github.com/platformatic/platformatic/pull/432) by *always* fetching all foreign keys when reading rows from the database.

## Always use string for BigInts

In previous releases of Platformatic DB, there was a loss of precision when using BigInt columns in MariaDB, MySQL and PostgreSQL. The change introduced in [#434](https://github.com/platformatic/platformatic/pull/434), make sure that BigInt columns are mapped to JavaScript strings and not numbers.

This feature was built last Monday during my [stream](https://www.twitch.tv/matteocollina):

<iframe width="560" height="315" src="https://www.youtube.com/embed/xt16hln3kj4"></iframe>

## Remove requirement for foreign keys to have \_id suffix

In [#319](https://github.com/platformatic/platformatic/issues/319), [Roberto Bianchi](https://github.com/rozzilla) caught a corner we cut to ship Platformatic DB: we required all foreign key columns [to end with `_id`](https://github.com/platformatic/platformatic/blob/72d9aae2b262323cbb5a4492027231e1cbdadf09/packages/sql-graphql/lib/relationship.js#L23). This was fixed in [#430](https://github.com/platformatic/platformatic/pull/430).

## Setup user on demand in db-authorization

In this last minute addition, I moved the logic that is validating the user credential from a `preHandler` hook to an on-demand basis. In this way, we would be doing expensive computations (or remote call in case of webhook) at first use, saving precious latency.
