[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/orm](../../README) / [index](../README) / SchemaDiffer

# Variable: SchemaDiffer

> `const` **SchemaDiffer**: `object`

Defined in: [packages/orm/src/schema/SchemaDiffer.ts:40](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/orm/src/schema/SchemaDiffer.ts#L40)

Compares a set of model schemas against the live database and returns
the deltas: tables that need to be created and columns that need to be added.

Additive deltas (newTables, newColumns) are always safe to apply. Dropped
columns are reported separately and only applied by a disruptive synchronize.

## Type Declaration

### diff()

> **diff**(`schemas`): `Promise`\<[`DiffResult`](../interfaces/DiffResult)\>

#### Parameters

##### schemas

[`ModelSchema`](../interfaces/ModelSchema)[]

#### Returns

`Promise`\<[`DiffResult`](../interfaces/DiffResult)\>

### isEmpty()

> **isEmpty**(`diff`): `boolean`

True when there is nothing *additive* to generate. Dropped columns are
deliberately excluded: `migrate:generate` never emits drops, so a table with
only dropped columns is still "in sync" from the generator's perspective.

#### Parameters

##### diff

[`DiffResult`](../interfaces/DiffResult)

#### Returns

`boolean`
