aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/doc_reform/output/sqlite.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2018-11-15 18:57:53 -0500
committerRalph Amissah <ralph.amissah@gmail.com>2019-05-17 16:59:38 -0400
commitf7a56d241065cac08e6fba20cb9b658a8f073ad5 (patch)
tree3056f3246833590fb19b22dde5a338bb371195f4 /src/doc_reform/output/sqlite.d
parentcosmetic (diff)
0.4.0 sqlite related
Diffstat (limited to 'src/doc_reform/output/sqlite.d')
-rw-r--r--src/doc_reform/output/sqlite.d34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/doc_reform/output/sqlite.d b/src/doc_reform/output/sqlite.d
index bf0d546..0e424e6 100644
--- a/src/doc_reform/output/sqlite.d
+++ b/src/doc_reform/output/sqlite.d
@@ -913,28 +913,27 @@ template SQLiteTablesReCreate() {
pod_name VARCHAR(256) NULL, /* zipped pod, work to be done here */
pod_fingerprint VARCHAR(256) NULL, /* zipped pod, work to be done here */
pod_size VARCHAR(10) NULL, /* zipped pod, work to be done here */
- src_text TEXT NULL,
- fulltext TEXT NULL,
+ site_url_doc_root VARCHAR(256) NULL, /* url path to doc root */
links TEXT NULL
);
CREATE TABLE doc_objects (
lid BIGINT PRIMARY KEY,
uid_metadata_and_text VARCHAR(256) REFERENCES metadata_and_text(uid) ON DELETE CASCADE,
ocn SMALLINT,
- ocnd VARCHAR(6),
- ocns VARCHAR(6),
+ obj_id VARCHAR(6) NULL,
clean TEXT NULL,
body TEXT NULL,
seg VARCHAR(256) NULL,
lev_an VARCHAR(1),
- lev SMALLINT NULL,
is_of_type VARCHAR(16),
is_a VARCHAR(16),
+ lev SMALLINT NULL,
node VARCHAR(16) NULL,
parent VARCHAR(16) NULL,
last_decendant VARCHAR(16) NULL, /* headings only */
digest_clean CHAR(256),
digest_all CHAR(256),
+ html_seg_url CHAR(256),
types CHAR(1) NULL
);
CREATE INDEX idx_ocn ON doc_objects(ocn);
@@ -1021,7 +1020,8 @@ template SQLiteInsertMetadata() {
rights_copyright_text,
rights_copyright_translation,
rights_copyright_video,
- rights_license
+ rights_license,
+ site_url_doc_root
)
VALUES (
'%s',
@@ -1070,6 +1070,7 @@ template SQLiteInsertMetadata() {
'%s',
'%s',
'%s',
+ '%s',
'%s'
);
¶",
@@ -1119,7 +1120,8 @@ template SQLiteInsertMetadata() {
SQLinsertDelimiter!()(doc_matters.conf_make_meta.meta.rights_copyright_text),
SQLinsertDelimiter!()(doc_matters.conf_make_meta.meta.rights_copyright_translation),
SQLinsertDelimiter!()(doc_matters.conf_make_meta.meta.rights_copyright_video),
- SQLinsertDelimiter!()(doc_matters.conf_make_meta.meta.rights_license)
+ SQLinsertDelimiter!()(doc_matters.conf_make_meta.meta.rights_license),
+ SQLinsertDelimiter!()(doc_matters.conf_make_meta.conf.webserv_url_doc_root)
);
return _insert_metadata;
}
@@ -1130,34 +1132,41 @@ template SQLiteInsertDocObjectsLoop() {
D doc_abstraction,
) {
string _uid = SQLinsertDelimiter!()(doc_matters.src.doc_uid);
+ auto site_url = DocReformPathsUrl!()(doc_matters);
string insertDocObjectsRow(O)(O obj) {
string _insert_doc_objects_row = format(q"¶
INSERT INTO doc_objects (
uid_metadata_and_text,
ocn,
+ obj_id,
clean,
body,
lev,
is_of_type,
- is_a
+ is_a,
+ html_seg_url
)
VALUES (
'%s',
%s,
'%s',
'%s',
+ '%s',
%s,
'%s',
+ '%s',
'%s'
);
¶",
_uid,
obj.metainfo.ocn,
+ obj.metainfo.identifier,
SQLinsertDelimiter!()(obj_txt["text"]),
SQLinsertDelimiter!()(obj_txt["html"]),
obj.metainfo.heading_lev_markup,
obj.metainfo.is_of_type,
obj.metainfo.is_a,
+ site_url.html_seg(obj.tags.html_segment_anchor_tag_is, obj.metainfo.identifier),
);
return _insert_doc_objects_row;
}
@@ -1440,28 +1449,27 @@ template SQLiteTablesCreate() {
pod_name VARCHAR(256) NULL, /* zipped pod, work to be done here */
pod_fingerprint VARCHAR(256) NULL, /* zipped pod, work to be done here */
pod_size VARCHAR(10) NULL, /* zipped pod, work to be done here */
- src_text TEXT NULL,
- fulltext TEXT NULL,
+ site_url_doc_root VARCHAR(256) NULL, /* url path to doc root */
links TEXT NULL
);
CREATE TABLE doc_objects (
lid BIGINT PRIMARY KEY,
uid_metadata_and_text VARCHAR(256) REFERENCES metadata_and_text(uid) ON DELETE CASCADE,
ocn SMALLINT,
- ocnd VARCHAR(6),
- ocns VARCHAR(6),
+ obj_id VARCHAR(6) NULL,
clean TEXT NULL,
body TEXT NULL,
seg VARCHAR(256) NULL,
lev_an VARCHAR(1),
- lev SMALLINT NULL,
is_of_type VARCHAR(16),
is_a VARCHAR(16),
+ lev SMALLINT NULL,
node VARCHAR(16) NULL,
parent VARCHAR(16) NULL,
last_decendant VARCHAR(16) NULL, /* headings only */
digest_clean CHAR(256),
digest_all CHAR(256),
+ html_seg_url CHAR(256),
types CHAR(1) NULL
);
CREATE INDEX idx_ocn ON doc_objects(ocn);