1
0
Fork 0

Update database from disk in case of changes

This commit is contained in:
Joris van der Hoeven 2015-04-15 08:08:24 +00:00
parent 7da4eb33e1
commit cea0e5d1dc
2 changed files with 23 additions and 23 deletions

View File

@ -6,13 +6,16 @@
<tmdoc-title|The <TeXmacs> database model> <tmdoc-title|The <TeXmacs> database model>
The <TeXmacs> database manipulation API has mainly been designed for The <TeXmacs> database manipulation API has mainly been designed for
internal use and not as a<nbsp>general purpose interface to SQL. In internal use. It is based on a<nbsp>dedicated
particular, we only support a limit number of entry types and field types, <hlink|NoSQL|http://en.wikipedia.org/wiki/NoSQL>-style database model,
although new types can easily be added later. Currently, databases are used using a variant of <hlink|column data stores|http://en.wikipedia.org/wiki/Column_%28data_store%29>.
for managing remote files, bibliographies, user lists, versions, etc. For the moment, we only support a limit number of entry types and field
types, although new types can easily be added later. Currently, databases
are used for managing remote files, bibliographies, user lists, versions,
etc.
The interface has been kept to be as simple as possible, so that our The interface has been kept to be as simple as possible, so that our low
SQL-based implementation can be most easily optimized for efficiently when level implementation can be most easily optimized for efficiently when
needed. Furthermore, the routines of our basic API can all be customized needed. Furthermore, the routines of our basic API can all be customized
<em|a posteriori> to add specific features. For instance, the basic API is <em|a posteriori> to add specific features. For instance, the basic API is
string-based, so a<nbsp>special additional layer was added to support string-based, so a<nbsp>special additional layer was added to support
@ -30,14 +33,6 @@
alternative time for database queries, which make it possible to easily alternative time for database queries, which make it possible to easily
recover any past state of the database. recover any past state of the database.
From the SQL implementation point of view, the database consists of a
single table with five columns: unique identifier, attribute, value,
creation date, expiration date. Grouping together rows with the same
identifier, one obtains the various entries. Grouping together rows with
the same identifier and the same attribute, one obtains the individual
values. Strictly speaking, the creation and expiration dates apply to
individual values in the lists of values.
<paragraph|Macros for context specification> <paragraph|Macros for context specification>
<\explain> <\explain>

View File

@ -5,15 +5,20 @@
<\body> <\body>
<tmdoc-title|Indexation> <tmdoc-title|Indexation>
The purpose of the first extension of the basic database API in The purpose of the first extension of the basic database API is to permit
<scm|index-base.scm> is to permit searching for certain keywords in the searching for certain keywords in the database entries. The current
database entries. The current implementation achieves this by maintaining a implementation achieves this by maintaining a<nbsp>few additional tables
few additional tables with the list of entries in which given keywords with the list of entries in which given keywords occur. We also maintain
occur and counters of how many times a given keyword appears. We also a<nbsp>few additional prefix tables which allow us to search for
maintain a few additional prefix tables which allow us to search for uncompleted keywords. For efficiency reasons, the indexation is done at a
uncompleted keywords. The indexation mechanism only indexates low level in C++.
alphanumerical keywords and normalizes all keywords to lowercase; see
<verbatim|indexation.cpp> for more details. It should be noticed that the indexation mechanism only indexates
alphanumerical keywords and normalizes all keywords to lowercase. Accented
characters and characters in other (<abbr|e.g.><nbsp>cyrillic) scripts are
also ``transliterated'' into basic unaccented roman characters. For
instance, we write ``é'' and ``\<#449\>'' as ``e'' and ``shch''. As a
consequence, a search for ``poincare'' will match ``Poincaré''.
<paragraph|Macros for context specification> <paragraph|Macros for context specification>