feat(db-postgres): allow to store blocks in a JSON column (#12750)
Continuation of https://github.com/payloadcms/payload/pull/6245. This PR allows you to pass `blocksAsJSON: true` to SQL adapters and the adapter instead of aligning with the SQL preferred relation approach for blocks will just use a simple JSON column, which can improve performance with a large amount of blocks. To try these changes you can install `3.43.0-internal.c5bbc84`.
This commit is contained in:
@@ -95,6 +95,7 @@ export function vercelPostgresAdapter(args: Args = {}): DatabaseAdapterObj<Verce
|
||||
afterSchemaInit: args.afterSchemaInit ?? [],
|
||||
allowIDOnCreate,
|
||||
beforeSchemaInit: args.beforeSchemaInit ?? [],
|
||||
blocksAsJSON: args.blocksAsJSON ?? false,
|
||||
createDatabase,
|
||||
createExtensions,
|
||||
defaultDrizzleSnapshot,
|
||||
|
||||
@@ -33,6 +33,10 @@ export type Args = {
|
||||
* To generate Drizzle schema from the database, see [Drizzle Kit introspection](https://orm.drizzle.team/kit-docs/commands#introspect--pull)
|
||||
*/
|
||||
beforeSchemaInit?: PostgresSchemaHook[]
|
||||
/**
|
||||
* Store blocks as JSON column instead of storing them in relational structure.
|
||||
*/
|
||||
blocksAsJSON?: boolean
|
||||
connectionString?: string
|
||||
/**
|
||||
* Pass `true` to disale auto database creation if it doesn't exist.
|
||||
|
||||
Reference in New Issue
Block a user