evandrocoan
964cc1a11a
Merge remote-tracking branch 'danielelmes/master' into create_actions_for_windows_macos
...
# Conflicts:
# .github/scripts/trailing-newlines.sh
# .github/workflows/checks.yml
# Makefile
# pylib/Makefile
# qt/Makefile
# qt/tools/typecheck-setup.sh
# rspy/Makefile
2020-03-24 22:49:49 -03:00
Damien Elmes
1d819bd750
don't error when -l passes in language without _
2020-03-25 08:53:31 +10:00
Damien Elmes
da07298418
fix sync getting stuck in a loop when changes is a multiple of 250
2020-03-24 19:30:35 +10:00
Damien Elmes
83d1be8743
Merge pull request #510 from evandroforks/fix_tests_on_windows
...
Fix tests on windows
2020-03-24 15:33:02 +10:00
Damien Elmes
602d6b00c2
remove : check from dbproxy
2020-03-24 10:37:12 +10:00
evandrocoan
4fcecaed9f
Created the .github/workflows/windows.yml
...
# Conflicts:
# .github/scripts/trailing-newlines.sh
# Makefile
# qt/tools/typecheck-setup.sh
# react/Makefile
# rspy/Makefile
# svelte/Makefile
# tslib/Makefile
2020-03-23 19:51:03 -03:00
evandrocoan
093af85c2e
Merge remote-tracking branch 'danielelmes/master' into fix_tests_on_windows
...
# Conflicts:
# .github/scripts/trailing-newlines.sh
2020-03-23 18:44:11 -03:00
Damien Elmes
7a67f73183
convert asc to desc instead of appending desc to the end of the order
...
as the latter doesn't work when sorting on more than one column
https://anki.tenderapp.com/discussions/beta-testing/1868-anki-2124-beta#comment_48174812
2020-03-23 19:53:57 +10:00
Damien Elmes
a5d27ede6e
fix v2 timing being returned for v1 users
2020-03-23 13:53:09 +10:00
Damien Elmes
b7fdb8aeb4
fix setting of wal
2020-03-23 13:52:57 +10:00
Damien Elmes
f9f5a33e1f
simplify how the local offset is passed around
...
- no need to store it in conf
- move local_minutes_west() call to collection
2020-03-23 13:52:52 +10:00
Damien Elmes
0e9e7a84e9
release GIL during collection open/close
2020-03-23 09:27:42 +10:00
Damien Elmes
ac78699d13
add back new_timezone_enabled(), as it's used in the prefs screen
2020-03-23 07:40:50 +10:00
Damien Elmes
9d55260425
apply same list->tuple fix to v1 sched
2020-03-22 21:56:02 +10:00
zjosua
119df8c662
Fill _lrnQueue with tuples, not lists
2020-03-22 11:49:40 +01:00
Damien Elmes
71fcbc3ead
fix sync error introduced by e02f032a47
2020-03-22 17:32:34 +10:00
Damien Elmes
f44996075d
handle the two remaining timing issues
2020-03-22 14:43:29 +10:00
Damien Elmes
e02f032a47
use backend for v1 and v2 cutoff calculations
...
this should also fix the CI failures, which were happening because
the datetime module wasn't matching the shifted time.time()
2020-03-22 14:28:26 +10:00
Damien Elmes
b8aaa8fba4
add enum for controlling sort order
...
eg col.find_cards("", order=BuiltinSortKind.CARD_DUE)
2020-03-22 12:59:24 +10:00
Damien Elmes
b6ac1c0d1c
fall back on stock json if orjson unavailable
2020-03-21 21:24:21 +10:00
Damien Elmes
eab7686d2f
remove old finder code; add search hooks to browser & remove old one
2020-03-21 16:38:46 +10:00
Damien Elmes
0089f0149a
add note searching
2020-03-21 09:00:05 +10:00
Damien Elmes
f3a4552df3
don't set deck.sched.today in test
2020-03-21 08:12:32 +10:00
Damien Elmes
3cebb5b3fd
update tests to reflect what now constitutes an error
2020-03-21 08:12:01 +10:00
Damien Elmes
18b37bcb59
tests need to flush before searching
2020-03-21 08:10:52 +10:00
Damien Elmes
23717089e9
add the ability to provide a custom sort order; use backend for find
2020-03-21 07:55:21 +10:00
Damien Elmes
f36857ae27
prototype of integration
...
no ordering yet, and no tests
2020-03-20 21:15:23 +10:00
Damien Elmes
ae42885ee2
make sure we set db to None so we can tell when we've closed the DB
2020-03-20 21:15:23 +10:00
Damien Elmes
5aba5c3ab9
drop the separate i18n backend
2020-03-20 21:15:23 +10:00
Damien Elmes
e5f883d1c3
support opening and closing the DB while keeping backend alive
...
This is safer than just dropping the backend, as .close() will
block if something else is holding the mutex. Also means we can
drop the extra I18nBackend code.
Media syncing still needs fixing.
2020-03-20 21:15:23 +10:00
Damien Elmes
90a44509be
drop usage of flushSched()
2020-03-20 21:15:23 +10:00
Damien Elmes
e53ee52d2a
remove db.close()
2020-03-20 21:15:23 +10:00
Damien Elmes
258a8282d4
move .reopen() to mw; fix exporting
2020-03-20 21:15:23 +10:00
Damien Elmes
a02c4ed994
drop the DB progress handler code
...
This code was an awful hack to provide some semblance of UI
responsiveness while executing DB statements on the main thread.
Instead, we can just run DB statements in a background thread now,
keeping the UI responsive.
2020-03-20 21:15:23 +10:00
Damien Elmes
8cb3ed7435
drop lock() and setAutocommit()
...
We no longer need to worry about pysqlite implicitly beginning
transactions, and can be more explicit about beginning/ending
transactions
save() now also has a trx argument controlling whether a
transaction should be started / left open
2020-03-20 21:15:23 +10:00
Damien Elmes
3256c74409
pass weakref in from storage to fix type checking/code completion
2020-03-20 21:15:23 +10:00
Damien Elmes
116f7fa3f1
support first_row_only
2020-03-20 21:15:23 +10:00
Damien Elmes
7e5f713f05
proper implementation of executemany(); drop executescript()
2020-03-20 21:15:23 +10:00
Damien Elmes
3f3a45e2ba
add Collection struct, and get media check working again
...
- media check no longer needs collection to be closed
- use savepoints for operations initiated by Rust, so they are
atomic without forcing a commit
2020-03-20 21:15:23 +10:00
Damien Elmes
700d713f80
add begin/commit/rollback, and support creating collections
...
all but one unit test is now passing
2020-03-20 21:15:23 +10:00
Damien Elmes
0147d9e470
drop log= argument from Collection
2020-03-20 21:15:23 +10:00
Damien Elmes
70c7cde2cd
remove remaining db kwargs
2020-03-20 21:15:23 +10:00
Damien Elmes
d42df6e0f1
add a temporary executemany()
2020-03-20 21:15:23 +10:00
Damien Elmes
bd7ded18c3
drop the protobuf prototype
2020-03-20 21:15:23 +10:00
Damien Elmes
38d4ea5311
use (or)json for DB bridge
...
Some initial testing with orjson indicates performance varies from
slightly better than pysqlite to about 2x slower depending on the type
of query.
Performance could be improved by building the Python list in rspy
instead of sending back json that needs to be decoded, but it may make
more sense to rewrite the hotspots in Rust instead. More testing is
required in any case.
2020-03-20 21:15:23 +10:00
Damien Elmes
a129b8f8cf
initial work on DB handling in Rust
...
committing the Protobuf implementation for posterity, but will replace
it with json, as Protobuf measures about 6x slower for some workloads
like 'select * from notes'
2020-03-20 21:15:23 +10:00
Damien Elmes
1db876ba1c
tweak db type hints
2020-03-20 21:15:23 +10:00
Damien Elmes
7fbc229dcd
drop usage of pysqlite Cursor
2020-03-20 21:15:23 +10:00
Damien Elmes
e5a465cccb
tweak layout of db methods
2020-03-20 21:15:23 +10:00
Damien Elmes
7bf27febe6
drop .cursor()
2020-03-20 21:15:23 +10:00