Merged sqlite-leo branch in master

65 views
Skip to first unread message

vitalije

unread,
Aug 12, 2017, 7:19:11 AM8/12/17
to leo-editor
New file format for Leo documents

Leo now supports new .leo.db file format. It is actually SQLite database
file. In current version all data are stored in two tables:

  1. vnodes which contains all vnodes from outline stored one node per row.
  2. extra_infos which contains (key, value) pairs for additional informations
    like currently selected position, screen position and dimension of Leo
    application window, and such.

Plugins can create and use additional tables.


There is also new setting @string default_leo_extension = .leo. When saving to new file if user doesn't provide extension, this default file extension will be appended to filename. Leo will honor the extension explicitly set by user.


When editing .leo.db files c.sqlite_connection is sqlite3.Connection instance connected to .leo.db file.


In current implementation, Leo operates data base just when opening and saving Leo document. On every open/save command it retrieves/stores all nodes. This can be changed to update nodes on every change and to retrieve nodes on demand. But for now this all-in/all-out strategy is satisfying.


I have no more ideas what to say about this feature. Please ask me if there is something that needs more explanation.


I have been using this branch for more than a month and it served me very well. However, whenever merge is involved there is possibility something won't work as advertised. 


Please report any problem and I will try to fix it ASAP.

Vitalije

Edward K. Ream

unread,
Aug 12, 2017, 7:52:00 AM8/12/17
to leo-editor
On Sat, Aug 12, 2017 at 6:19 AM, vitalije <vita...@gmail.com> wrote:

​Something is not right.  When load my local copy of leoPy.leo, @file leoAtFile.py does not contain checkExternalFileAgainstDb.

I see this method (in an external editor), in the node:
#@+node:vitalije.20170701155512.1: *6* at.checkExternalFileAgainstDb

Clearing all caches does not help.  Such a thing has never happened before.

Saving the .leo file deletes the node from the external file.  git checkout leo restores it.

Vitalije, what might be causing this?

Edward

vitalije

unread,
Aug 12, 2017, 8:25:58 AM8/12/17
to leo-editor
Have you tried opening LeoPyRef.leo? 

Is it possible that some plugin that you have enabled and I don't can cause this difference? 

I hope we can find what is causing this strange thing, but it is something that I was complaining in #538 and #540. Perhaps it is not usual thing that you encounter this problem, because most of the time your copy of LeoPy.leo is fresher and richer than copy of others. 

The only thing that comes in my mind is that when g.SQLITE is true, retrieving from cache is skipped. Can you test once again clearing cache, then git checkout -f, so that  all external files are unchanged and then open LeoPy.leo?

Edward K. Ream

unread,
Aug 12, 2017, 8:48:49 AM8/12/17
to leo-editor

On Sat, Aug 12, 2017 at 7:25 AM, vitalije <vita...@gmail.com> wrote:

The only thing that comes in my mind is that when g.SQLITE is true, retrieving from cache is skipped. Can you test once again clearing cache, then git checkout -f, so that  all external files are unchanged and then open LeoPy.leo?

​Yes, -f works.  ​I don't understand why.

Edward

Edward K. Ream

unread,
Aug 12, 2017, 8:50:39 AM8/12/17
to leo-editor
​I spoke too soon.  When I reload leoPy.leo, using the cache, the code disappears​ again.

Edward

Edward K. Ream

unread,
Aug 12, 2017, 10:51:48 AM8/12/17
to leo-editor
​Attached is my leoPy.leo file.  Perhaps it will help you discover what is going on.

Edward
leoPy.leo

vitalije

unread,
Aug 12, 2017, 11:13:05 AM8/12/17
to leo-editor
This is very strange. When I put your leoPy.leo in my leo/core/ folder, I can open it without any problem. Writing all files under Code reports all unchanged files, and:
git status
gives no changed files at all.
Vitalije

tscv11

unread,
Jan 9, 2018, 12:50:16 PM1/9/18
to leo-editor
Hello Sir,

I think your work is brilliant, although I am not able to understand many
things, and I have not gone over it in detail. Still, I am sure from what I
do know that it's groundbreaking and fascinating!
 
I  suggest a possible collaboration (if I have anything to offer). I am
just an amateur but I have created 'leo4sqlite' and you might find
something interesting there. Hopefully you will have a little advice
for me either way!

You can find it here:
https://www.github.com/tscv11/leo4sqlite

Please feel free to post or send a message if you ever have a question,
and if there's anything you need (sqlite3-related) please let me know!

Thanks for your time!

tscv11
Reply all
Reply to author
Forward
0 new messages