Class SQLWrapperUpdater
A class that can be implemented by any custom sql wrapper that should be dynamically generated or updated on every database upgrade
For instance the system QUERYNAME canvas query is regenerated every time the system is updated to account for any new entities and their changes
Typically this implementation can also implement IBaseDataSetProcessorWithDBSave to make sure this is automatically run when dependant items are modified tooInheritance
Inherited Members
Namespace: LemonEdge.API.Core.Migrations
Assembly: LemonEdge.API.Core.Migrations.dll
Syntax
public abstract class SQLWrapperUpdater
Constructors
SQLWrapperUpdater(IQueryBuilderFactory, IEntityUpdater, IReadOnlyCache, UserInfo)
Create a new sqlwrapper updater
Declaration
protected SQLWrapperUpdater(IQueryBuilderFactory builderFactory, IEntityUpdater updater, IReadOnlyCache cache, UserInfo user)
Parameters
| Type | Name | Description |
|---|---|---|
| IQueryBuilderFactory | builderFactory | A IQueryBuilderFactory for creation of SQL. |
| IEntityUpdater | updater | The context for modifiying or creating a new SQL Wrapper with |
| IReadOnlyCache | cache | The local cache |
| UserInfo | user | The current logged in user |
Properties
AlwaysRunOnDBUpgrade
Declaration
public virtual bool AlwaysRunOnDBUpgrade { get; }
Property Value
| Type | Description |
|---|---|
| bool |
BuilderFactory
A factory for creating instances of IQueryBuilders.
Declaration
protected IQueryBuilderFactory BuilderFactory { get; }
Property Value
| Type | Description |
|---|---|
| IQueryBuilderFactory |
Cache
The local cache
Declaration
public IReadOnlyCache Cache { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCache |
Reporter
Declaration
public BusyProgressReporter Reporter { get; set; }
Property Value
| Type | Description |
|---|---|
| BusyProgressReporter |
Updater
The context for modifiying or creating a new SQL Wrapper with
Declaration
public IEntityUpdater Updater { get; }
Property Value
| Type | Description |
|---|---|
| IEntityUpdater |
User
The current logged in user
Declaration
public UserInfo User { get; }
Property Value
| Type | Description |
|---|---|
| UserInfo |
Methods
LoadWrappersForVersionChangeOnly()
Declaration
public Task LoadWrappersForVersionChangeOnly()
Returns
| Type | Description |
|---|---|
| Task |
ResetVersions()
Declaration
public Task ResetVersions()
Returns
| Type | Description |
|---|---|
| Task |
SetupDependantQuery(IEntityUpdater, ISQLWrapper, string)
Declaration
protected Task SetupDependantQuery(IEntityUpdater updater, ISQLWrapper parent, string dependantName)
Parameters
| Type | Name | Description |
|---|---|---|
| IEntityUpdater | updater | |
| ISQLWrapper | parent | |
| string | dependantName |
Returns
| Type | Description |
|---|---|
| Task |
TaskInit(IEntityUpdater, IReadOnlyCache, UserInfo, BusyProgressReporter)
Declaration
protected void TaskInit(IEntityUpdater updater, IReadOnlyCache cache, UserInfo user, BusyProgressReporter progressReporter)
Parameters
| Type | Name | Description |
|---|---|---|
| IEntityUpdater | updater | |
| IReadOnlyCache | cache | |
| UserInfo | user | |
| BusyProgressReporter | progressReporter |
UpdateAllWrappers()
Runs upgradewrapper while also marking all datasets/sqlwrappers as being version 0
Declaration
public Task UpdateAllWrappers()
Returns
| Type | Description |
|---|---|
| Task |
UpgradeWrapper()
The custom function that is automatically called on every system database upgrade.
This can create and update a ISQLWrapper as required.
It is also capable of running any custom code during upgrades, not just upgrading sql wrapper.Declaration
public abstract Task UpgradeWrapper()
Returns
| Type | Description |
|---|---|
| Task |