summaryrefslogtreecommitdiff
path: root/src/include/schema.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/schema.h')
-rw-r--r--src/include/schema.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/include/schema.h b/src/include/schema.h
new file mode 100644
index 00000000000..b7467fb18bb
--- /dev/null
+++ b/src/include/schema.h
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2008-2012 WiredTiger, Inc.
+ * All rights reserved.
+ *
+ * See the file LICENSE for redistribution information.
+ */
+
+#define WT_SCHEMA_FILENAME "WiredTiger.wt" /* Schema file name */
+#define WT_SCHEMA_URI "file:WiredTiger.wt" /* Schema file URI */
+
+#define WT_SCHEMA_VERSION "WiredTiger version" /* Version keys */
+#define WT_SCHEMA_VERSION_STR "WiredTiger version string"
+
+/* Character constants for projection plans. */
+#define WT_PROJ_KEY 'k' /* Go to key in cursor <arg>. */
+#define WT_PROJ_NEXT 'n' /* Process the next item (<arg> repeats). */
+#define WT_PROJ_REUSE 'r' /* Reuse the previous item (<arg> repeats). */
+#define WT_PROJ_SKIP 's' /* Skip a column in the cursor (<arg> repeats). */
+#define WT_PROJ_VALUE 'v' /* Go to the value in cursor <arg>. */
+
+/*
+ * WT_TABLE --
+ * Handle for a logical table. A table consists of one or more column
+ * groups, each of which holds some set of columns all sharing a primary
+ * key; and zero or more indices, each of which holds some set of columns
+ * in an index key that can be used to reconstruct the primary key.
+ */
+struct __wt_table {
+ const char *name, *config, *plan;
+ const char *key_format, *value_format;
+
+ WT_CONFIG_ITEM cgconf, colconf;
+
+ WT_BTREE **colgroup;
+ WT_BTREE **index;
+ size_t index_alloc;
+
+ TAILQ_ENTRY(__wt_table) q;
+
+ int cg_complete, idx_complete, is_simple;
+ int ncolgroups, nindices, nkey_columns;
+};
+
+/*
+ * Tables without explicit column groups have a single default column group
+ * containing all of the columns.
+ */
+#define WT_COLGROUPS(t) WT_MAX((t)->ncolgroups, 1)