Class QuartzPostgresFeatureSchema
- Namespace
- Quartz
- Assembly
- Quartz.Weasel.PostgreSQL.dll
Quartz.NET's job store tables as a Weasel feature schema, for adding to a Marten store so that Marten applies them with the rest of its schema.
public sealed class QuartzPostgresFeatureSchema : IFeatureSchema
- Inheritance
-
QuartzPostgresFeatureSchema
- Implements
-
IFeatureSchema
- Inherited Members
Remarks
This is the join mode: opts.Storage.Add(QuartzPostgresFeatureSchema.ForScheduler(services))
inside ConfigureMarten. Marten then creates and migrates Quartz's tables whenever it applies
its own — at startup, in db-apply, in resources setup — and Quartz registers no
database of its own. Call either this or UseWeaselForPostgres for one scheduler, never both.
A feature schema rather than StoreOptions.Storage.ExtendedSchemaObjects: Marten's
CompletelyRemoveAllAsync drops every extended schema object with CASCADE, which would
take the schedule with it; a feature schema is left alone.
The tables are the same objects UseWeaselForPostgres applies: add-only, spelled the way
PostgreSQL's catalog reads them back, and with the index names 3.x created and 4.x retired dropped.
Constructors
QuartzPostgresFeatureSchema(string)
The tables for a table prefix, spelled as TablePrefix spells it.
public QuartzPostgresFeatureSchema(string tablePrefix = "QRTZ_")
Parameters
tablePrefixstringThe store's table prefix; a schema before the last dot is the schema the tables are in, and
publicis used when there is none.
Properties
Identifier
Really just the filename when the SQL is exported
public string Identifier { get; }
Property Value
Migrator
public Migrator Migrator { get; }
Property Value
- Migrator
Objects
public ISchemaObject[] Objects { get; }
Property Value
- ISchemaObject[]
StorageType
Identifier by type for this feature. Used along with the DependentTypes() collection to control the proper ordering of object creation or scripting
public Type StorageType { get; }
Property Value
Methods
DependentTypes()
Any document or feature types that this feature depends on. Used to intelligently order the creation and scripting of database schema objects
public IEnumerable<Type> DependentTypes()
Returns
ForScheduler(IServiceProvider, string?)
The tables of a scheduler registered with AddQuartz, read from its store's table prefix.
public static QuartzPostgresFeatureSchema ForScheduler(IServiceProvider services, string? schedulerName = null)
Parameters
servicesIServiceProviderThe application's services, as
ConfigureMarten((services, opts) => …)hands them over.schedulerNamestringThe scheduler's registration name, or null for the default scheduler.
Returns
Exceptions
- SchedulerConfigException
The scheduler's schema is already managed standalone, by
UseWeaselForPostgres.
WritePermissions(Migrator, TextWriter)
Write any permission SQL when this feature is exported to a SQL file
public void WritePermissions(Migrator rules, TextWriter writer)
Parameters
rulesMigratorwriterTextWriter