Allow schema files that are missing checksums on the !!SCHEMAMATIC line.
[versaplex.git] / versaplexd / ischemabackend.cs
blobcd2945481443a33ff7440ca1d4f3cedf41633e7d
1 /*
2 * Versaplex:
3 * Copyright (C)2007-2008 Versabanq Innovations Inc. and contributors.
4 * See the included file named LICENSE for license information.
5 */
6 using System;
7 using System.Collections.Generic;
9 // An interface to a Schemamatic schema backend.
10 internal interface ISchemaBackend : IDisposable
12 // Update the backing store with all current elements.
13 // If an element's text is empty, it will be deleted.
14 VxSchemaErrors Put(VxSchema schema, VxSchemaChecksums sums, VxPutOpts opts);
16 // Get elements from the backing store.
17 // If keys is non-empty, only returns the schema for listed keys.
18 // If keys is empty, returns all schema elements.
19 VxSchema Get(IEnumerable<string> keys);
21 // Gets the checksums for all elements from the backing store.
22 VxSchemaChecksums GetChecksums();
24 // Removes the given elements from the schema.
25 VxSchemaErrors DropSchema(IEnumerable<string> keys);
27 // Returns a blob of text that can be used with PutSchemaData to fill
28 // the given table.
29 // "seqnum" provides a hint about the priority of the table when batch
30 // processing, and is used to locate the file on disk.
31 // "where" is the body of a SQL "WHERE" clause, to limit the data
32 // returned by the database, if applicable.
33 // "replaces" is the list of replacements to be made on a field
34 // "skipfields" is the list of fields to skip during export
35 string GetSchemaData(string tablename, int seqnum, string where,
36 Dictionary<string,string> replaces,
37 List<string> skipfields);
39 // Delete all rows from the given table and replace them with the given
40 // data. text is an opaque hunk of text returned from GetSchemaData.
41 // Seqnum provides a hint about the priority of the table when batch
42 // processing, and is used to locate the file on disk.
43 void PutSchemaData(string tablename, string text, int seqnum);
46 [Flags]
47 public enum VxPutOpts : int
49 None = 0,
50 // If set, PutSchema will do potentially destructive things like
51 // dropping a table in order to re-add it.
52 Destructive = 0x1,
53 // If set, PutSchema will not attempt to do any retries.
54 NoRetry = 0x2,
55 // If set and the element already exists, will create the new element
56 // with a different name that doesn't already exist.
57 // Currently only applies to the disk backend; other backends ignore this.
58 IsBackup = 0x4,