-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate using sqlite3 backend for itsdb #204
Comments
Another question is how to define the keys in SQLite terms. [incr tsdb()] just specifies columns as
They both specify Also consider
It has 3 Another oddity (but not necessarily problematic) is that There doesn't seem to be a good way of determining which keys are primary and which are foreign in a general way. We could just mark them as regular keys, but then SQLite will not automatically maintain database integrity the way we'd want, and thus using |
If we were to propose an addition to the
Since foreign keys reference keys of the same name in other tables, explicitly spelling out the table and name could be optional (e.g., just If all non-primary keys are marked as foreign, then it might not be necessary to put something like |
I think explicitly marking the relations as you suggest is a great idea.
…On Wed, Feb 27, 2019 at 1:23 PM Michael Wayne Goodman < ***@***.***> wrote:
If we were to propose an addition to the relations file format, we would
need to be able to say which keys are foreign and which table (and column?)
they reference. For example:
analysis:
i-id :integer :key :foreign(item:i-id)
...
Since foreign keys reference keys of the same name in other tables,
explicitly spelling out the table and name could be optional (e.g., just
:foreign(item)), or simply forbidden if we require that shared keys have
the same name.
If all non-primary keys are marked as foreign, then it might not be
necessary to put something like :primary on, for instance, i-id in item.
Partial keys (which I take to mean "composite" keys in sqlite) are still a
problem though. For instance, item-phenomenon has 3 keys, but none are
marked as :partial, so it's not the case that all 3 are required to
uniquely select a row. In set, there is a s-id (primary?) key and a p-id
partial foreign key, and in item-set there are two foreign keys of which
one is marked :partial. I think I need more information to determine what
to do here (maybe we should mark all keys in the composite as :partial,
whether or not they are primary or foreign.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#204 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABD8xtMhfGFDx47D6E65opWqHIW1su6Zks5vRhZigaJpZM4bPTec>
.
--
Francis Bond <http://www3.ntu.edu.sg/home/fcbond/>
Division of Linguistics and Multilingual Studies
Nanyang Technological University
|
I didn't understand this sentence above. In the If I understood your point, you were expecting the
Right? Or maybe I didn't get your point about this table too:
Another detail that could be made explicit is the abbreviation used for the tables names (i.e. |
Maybe you all know that, but one more thing to take into consideration. In the logon tree I found 639
|
In fact, Stephan puts a fair bit of effort into updating the relation files
to the latest version, but not everyone has the time or expertise, so it is
very useful to be able to read the old ones.
…On Wed, Feb 27, 2019 at 7:44 PM Alexandre Rademaker < ***@***.***> wrote:
Maybe you all know that, but one more thing to take into consideration. In
the logon tree I found 639 relations file. Only 16 differ. The majority
of them are all equal to
lingo/lkb/src/tsdb/skeletons/english/esd/relations. That is, the
capability of adapting the profile schema is rarely used, maybe because the
tools are not ready for that.
$ find . -name 'relations' | wc -l
639
$ find . -name 'relations' -exec diff -q lingo/lkb/src/tsdb/skeletons/english/esd/relations {} \; | wc -l
16
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#204 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABD8xq3uR-sWu2d4REERV8TFUJC1VSbMks5vRm-ogaJpZM4bPTec>
.
--
Francis Bond <http://www3.ntu.edu.sg/home/fcbond/>
Division of Linguistics and Multilingual Studies
Nanyang Technological University
|
Do you have any pointer for the documentation about those changes? |
There is normally an announcement in the developers mailing list.
…On Wed, Feb 27, 2019 at 9:57 PM Alexandre Rademaker < ***@***.***> wrote:
Do you have any pointer for the documentation about those changes?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#204 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABD8xuwZrH1Cgz0x8DZHIiu0C2gDGkadks5vRo6xgaJpZM4bPTec>
.
--
Francis Bond <http://www3.ntu.edu.sg/home/fcbond/>
Division of Linguistics and Multilingual Studies
Nanyang Technological University
|
@arademaker the point was that if all instances of |
If there isn't support upstream for changing |
Another variation to the proposal:
This would encode the way to Also (2) is in the list above because I found that I could not enforce the unique-keys constraint on Given the above, all test suites (either up-converted or defined with the improved schema) would be mapable to traditional SQL databases, and we could then use one as the backend. |
Closing this as there are no immediate plans to move to a sqlite3 backend. My thoughts regarding extensions to TSDB schema have been recorded at http://moin.delph-in.net/TsdbSchemaRfc. |
In the interest of maintainability and, secondly, speed, I'm curious if we could use Python's
sqlite3
module as the backend foritsdb.TestSuite
. Doing so may remove the need to implement selects, joins, etc. on my own custom classes, and the task then turns into transforming the [incr tsdb()] database format into SQL commands (for reading and writing). I wonder what is the minimal amount of changes to the Python API that would be needed to accommodate this, as I don't want to break things for users who may have recently switched to the newerTestSuite
API.Some questions are how to store the sqlite3 database. All in
:memory:
could get too big for giant profiles, unless I could flush rows to the [incr tsdb()] files mid-way. SQLite has a notion of temporary databases (connect to""
instead of":memory:"
), but there's no indication that Python'ssqlite3
supports that (but maybe it doesn't prevent it? ...still, I'd like it documented). Or I could make a temporary file to store the results?The text was updated successfully, but these errors were encountered: