Skip to content

Commit bcf4014

Browse files
committed
Squashed commit of the following:
commit 35f8bf3 Author: PySimpleSQL <[email protected]> Date: Fri Apr 21 11:36:03 2023 -0400 Fixes lastrowid not being returned correctly in duplicate Old code was trying to get the lastrowid after the entire list of queries ran, which would return None due to the insert being buried in the list of queries. We now grab it after the insert runs by chacking if it has been set yet, and if the result has a lastrowid commit 9628f65 Author: PySimpleSQL <[email protected]> Date: Fri Apr 21 11:29:31 2023 -0400 refs #281 MSAccess fixes Small fixes / ruff fixes commit 3f24c38 Author: PySimpleSQL <[email protected]> Date: Fri Apr 21 11:23:28 2023 -0400 refs #281 MSAccess fixes Duplicate now working. DROP TABLE IF EXISTS does not seem to work reliably through Jackcess, so added a workaround. The lastrowid was not being returned due to the nature of the executing a list of queries, so grabbed the inserted id after all of the queries were finished. commit f904950 Author: PySimpleSQL <[email protected]> Date: Fri Apr 21 10:26:48 2023 -0400 refs #281 MSAccess fixes Duplicate now mostly working (selects wrong item after duplicate still). Had to remove quote_table stuff from the driver, as the variable is used in other places that do not expect it to be quoted - it's not needed anyway, as this is specific driver code and not generalized for all SQLDrivers commit c53caa7 Author: PySimpleSQL <[email protected]> Date: Fri Apr 21 09:39:31 2023 -0400 refs #281 MSAccess fixes override insert_record - Jackcess does not like columns set to None commit 2179061 Author: PySimpleSQL <[email protected]> Date: Fri Apr 21 09:26:28 2023 -0400 refs #281 Pandas integration resolved a small merge conflict commit 3ff3385 Author: PySimpleSQL <[email protected]> Date: Thu Apr 20 15:58:42 2023 -0400 refs #281, Got a little bit of MSAccess working Duplicate still broken. Out of time to look at it for now commit fc134c3 Merge: 87e9fac 456c5a7 Author: PySimpleSQL <[email protected]> Date: Thu Apr 20 15:58:29 2023 -0400 Merge remote-tracking branch 'origin/pandas' into pandas # Conflicts: # pysimplesql/pysimplesql.py commit 87e9fac Author: PySimpleSQL <[email protected]> Date: Thu Apr 20 15:55:12 2023 -0400 refs #281, Got a little bit of MSAccess working Duplicate still broken. Out of time to look at it for now commit 456c5a7 Author: ssweber <[email protected]> Date: Thu Apr 20 15:48:17 2023 -0400 black commit 3c78b07 Author: ssweber <[email protected]> Date: Thu Apr 20 15:47:51 2023 -0400 Sqlserver conversions still need to do sqlserver pk_column... didn't have time to start up docker to test how that get returned commit a465cd4 Author: ssweber <[email protected]> Date: Thu Apr 20 15:43:42 2023 -0400 More Result.set conversions Access has issue with save and duplicate commit 204842b Author: PySimpleSQL <[email protected]> Date: Thu Apr 20 11:46:07 2023 -0400 refs #281, Flatfile fixes Small fixes to Flatfile driver to work with pandas commit 2030c32 Author: ssweber <[email protected]> Date: Wed Apr 19 16:15:07 2023 -0400 Safeguard error if query somehow fails commit e5e1918 Author: ssweber <[email protected]> Date: Wed Apr 19 15:39:32 2023 -0400 Reverting line change I think both work correctly, so I'll just keep the one you wrote :) commit 10427c8 Author: ssweber <[email protected]> Date: Wed Apr 19 15:16:26 2023 -0400 Working mysql/postgres sql drivers Also fixed duplicate button always disabled Found other places where we needed to look at attrs instead of result.exception commit 9d86d1b Author: ssweber <[email protected]> Date: Wed Apr 19 13:54:40 2023 -0400 Update pysimplesql.py commit b7db10f Author: ssweber <[email protected]> Date: Wed Apr 19 13:53:33 2023 -0400 Fix for quick_editor, save_record Now with updated sqlite driver, this needed to update attrs commit f26c5b4 Author: ssweber <[email protected]> Date: Tue Apr 18 16:47:03 2023 -0400 Fixed checking for TableHeading I think this fixes the quick-editor commit 6a256a3 Author: ssweber <[email protected]> Date: Tue Apr 18 16:23:23 2023 -0400 Update pysimplesql.py commit 454a766 Author: PySimpleSQL <[email protected]> Date: Tue Apr 18 15:25:14 2023 -0400 refs #281, set_by_pk improvements There were certain situations where set_by_pk would fail if the primary key was not found (like after deleting a virtual record.). This ensures that an index will be selected even if the pk value is not found commit 7f159d8 Author: PySimpleSQL <[email protected]> Date: Tue Apr 18 15:18:35 2023 -0400 refs #281, set_by_pk improvements There were certain situations where set_by_pk would fail if the primary key was not found (like after deleting a virtual record.). This ensures that an index will be selected even if the pk value is not found commit b84643d Author: PySimpleSQL <[email protected]> Date: Tue Apr 18 14:34:25 2023 -0400 refs #281, Purge virtual working DataSet.purge_virtual is now working. Also added some pandas display options for easier debugging commit 3ebcd20 Merge: 149bdc7 749c717 Author: PySimpleSQL <[email protected]> Date: Tue Apr 18 12:49:42 2023 -0400 Merge pull request #288 Moved things from _SortCallbackWrapper to sort commit 149bdc7 Author: PySimpleSQL <[email protected]> Date: Tue Apr 18 12:47:36 2023 -0400 refs #281, Duplicate record working oops, forgot something commit 749c717 Author: ssweber <[email protected]> Date: Tue Apr 18 12:31:24 2023 -0400 Update pysimplesql.py commit db4030d Author: ssweber <[email protected]> Date: Tue Apr 18 12:28:07 2023 -0400 Update pysimplesql.py commit aa7c8ac Author: ssweber <[email protected]> Date: Tue Apr 18 12:27:04 2023 -0400 Move from _SortCallbackWrapper to sort commit 32266f1 Author: PySimpleSQL <[email protected]> Date: Tue Apr 18 12:20:38 2023 -0400 refs #281, Duplicate record working Duplicating records working once again commit 28118ed Author: PySimpleSQL <[email protected]> Date: Tue Apr 18 12:04:34 2023 -0400 refs #281, Sorting by foreign keys Sorting for foreign keys works again. A temporary column is added that maps the fk to the description column of the parent table, the dataset is sorted on this temporary column, then the temporary column is dropped in place. commit caa0754 Author: PySimpleSQL <[email protected]> Date: Tue Apr 18 11:03:10 2023 -0400 refs #281, Record search working again Searching for records works as expected again commit ccabe70 Author: PySimpleSQL <[email protected]> Date: Tue Apr 18 10:01:56 2023 -0400 refs #281, Pandas more cleanup Cleaned up a lot of the ResultSet references that are no longer valid now that we are working with DataFrames. Changed the set_by_pk call to update_elements, otherwise the navigation buttons don't update after sorting commit 25e5495 Author: ssweber <[email protected]> Date: Tue Apr 18 00:19:37 2023 -0400 fixes navigation buttons being wrong commit b7f7051 Author: ssweber <[email protected]> Date: Tue Apr 18 00:09:37 2023 -0400 Lots of fixes I think this gets us almost all the way there. in insert_row, setting the idx is not implemented yet Also, ruff is complaining about: F405: 'ResultSet' may be undefined ... but I didn't know what to replace that with. commit a9928e5 Author: ssweber <[email protected]> Date: Mon Apr 17 20:36:40 2023 -0400 small fix you're right, somethings still borked with sorting. sorry, this at least gets it in a workable state. commit 50e7430 Author: ssweber <[email protected]> Date: Mon Apr 17 17:08:48 2023 -0400 fixes commit 76b4835 Author: PySimpleSQL <[email protected]> Date: Mon Apr 17 15:48:42 2023 -0400 refs #281, Pandas partially working Pretty big step backwards with this one. Working on cleaning up the sorting code had some unexpected consequences. I'm out of time for a while, so checking this in for now commit 0a77f5e Author: PySimpleSQL <[email protected]> Date: Mon Apr 17 12:43:31 2023 -0400 refs #281, Pandas partially working Sorting code working. Still need to work out how to sort FK relationships by their description column commit e3e50eb Author: PySimpleSQL <[email protected]> Date: Mon Apr 17 11:04:31 2023 -0400 refs #281, Pandas partially working Sorting code moved into DataSet. Still some work to do, but very close to being functional again commit a529690 Author: PySimpleSQL <[email protected]> Date: Mon Apr 17 08:09:36 2023 -0400 refs #281, Pandas partially working Worked towards getting rid of ResultSet entirely and having SQLDriver.execute() returning DataFrames directly with the appropriate attrs set commit c6a8983 Author: PySimpleSQL <[email protected]> Date: Sun Apr 16 19:30:53 2023 -0400 refs #281 Pandas integration A little closer now. New records insert and mark as virtual. There was an issue with using .applymap on DataSet.rows, as .applymap returns a Dataset object directly, which was overwriting the ResultSet object. This fixes that issue. Still more to go, but another step closer commit 0cb39be Author: ssweber <[email protected]> Date: Sun Apr 16 15:12:18 2023 -0400 Properly insert series back into dataframe This fixes it adding that extra column. commit d1f11bd Author: PySimpleSQL <[email protected]> Date: Sun Apr 16 08:15:41 2023 -0400 refs #281, Pandas partially working More cleanup and experimentation. There is an issue with saving where sometimes the dict gets an extra key "0" and the update query fails. Also, even at times that the query goes through, the DataSet does not seem to update immediately to show the difference commit 0cc1f13 Author: PySimpleSQL <[email protected]> Date: Sat Apr 15 20:09:17 2023 -0400 refs #281, Pandas partially working More cleanup commit bf017ab Author: PySimpleSQL <[email protected]> Date: Sat Apr 15 18:02:33 2023 -0400 refs #281, Pandas partially working Lots of cleanup to do yet! commit 97e3686 Author: PySimpleSQL <[email protected]> Date: Sat Apr 15 16:00:21 2023 -0400 refs #281, getting a start on converting over to Pandas for ResultSets more conversions commit e9e9190 Merge: 70171b6 dedb62a Author: PySimpleSQL <[email protected]> Date: Sat Apr 15 15:07:02 2023 -0400 Merge branch 'pytest' into pandas commit dedb62a Merge: d494d67 d29cfc0 Author: PySimpleSQL <[email protected]> Date: Sat Apr 15 15:05:30 2023 -0400 Merge branch 'development' into pytest # Conflicts: # pysimplesql/pysimplesql.py commit 70171b6 Author: PySimpleSQL <[email protected]> Date: Fri Apr 14 04:25:15 2023 -0400 refs #281, getting a start on converting over to Pandas for ResultSets Got it pretty close to working (at least for the sqlite driver). More debugging and troubleshooting to go! commit d494d67 Author: PySimpleSQL <[email protected]> Date: Fri Apr 14 01:47:23 2023 -0400 refs #278 fix ruff errors adding # ruff: noqa to test files commit cfd3fd7 Author: PySimpleSQL <[email protected]> Date: Fri Apr 14 01:38:08 2023 -0400 refs #278 fix ruff error Ignore another SIM102 error. This one would be much messier to combine the if statements. Looks like the .ruffignore is not working either! commit f66000c Author: PySimpleSQL <[email protected]> Date: Fri Apr 14 01:35:41 2023 -0400 refs #278 fix ruff error Ignore another SIM102 error. This one would be much messier to combine the if statements. Looks like the .ruggignore is not working either! commit d504891 Author: PySimpleSQL <[email protected]> Date: Fri Apr 14 01:31:29 2023 -0400 refs #278 fix ruff error Fixed a SIM102 error flagged by ruff. This commit should also test if the .ruffignore file is working... commit 8191b8f Author: PySimpleSQL <[email protected]> Date: Fri Apr 14 01:25:21 2023 -0400 refs #278 Unit Tests ruff ignore add a .ruffignore file to ignore the /tests folder commit 61fc8ec Author: PySimpleSQL <[email protected]> Date: Fri Apr 14 01:21:17 2023 -0400 refs #278 Unit Test example for ProgressAnimate Finished up ProgressAnimate testing file along with improvments to bulletproof ProgressAnimate commit 7a97927 Merge: 65239d9 2d6938f Author: PySimpleSQL <[email protected]> Date: Fri Apr 14 00:23:56 2023 -0400 refs #278 Unit Test example for ProgressAnimate Not perfect yet, but shows the basic concepts of testing for both no failures and expected failures. I tried to fix things in ProgressAnimate as I went along so that hopefully you can see the correlation between what was being tested, and the fixes that went in to pass the tests. If you haven't used pytest before, there's a few things to do: - pip install pytest - make sure pysimplesql is reachable as a module. The easiest way is to do a local installation by running `pip -e .` in the pysimplesql root directory - from the commandline, run `pytest` to run all tests. Or you can run tests for a specific file, I.e. `pytest progressanimate_test.py`
1 parent d29cfc0 commit bcf4014

File tree

7 files changed

+516
-512
lines changed

7 files changed

+516
-512
lines changed

examples/Flatfile_examples/csv_test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import pysimplesql as ss
55
import PySimpleGUI as sg
66
import logging
7-
logger=logging.getLogger(__name__)
8-
logging.basicConfig(level=logging.INFO)
7+
logger = logging.getLogger(__name__)
8+
logging.basicConfig(level=logging.DEBUG)
99

1010
# Let's use a fun language pack
1111
ss.languagepack(ss.lp_90s)
@@ -36,7 +36,7 @@
3636
driver = ss.Driver.flatfile('test.csv', header_row_num=10)
3737

3838
# Use a pysimplesql Form to bind the window to the driver
39-
frm= ss.Form(driver, bind_window=win)
39+
frm = ss.Form(driver, bind_window=win)
4040

4141
# This is optional. Forces the saving of unchanged records. This will allow us to use our sortable headers to arrange
4242
# the data to our liking, then hit save without making any actual changes to the data and have the newly sorted
68 KB
Binary file not shown.

examples/SQLite_examples/Journal.db

0 Bytes
Binary file not shown.

examples/SQLite_examples/journal_external.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
]
2828

2929
win = sg.Window('Journal (external) example', layout, finalize=True)
30-
driver = ss.Driver.sqlite('./SQLite_examples/Journal.db', sql_script='journal.sql')
30+
driver = ss.Driver.sqlite('Journal.db', sql_script='journal.sql')
3131
frm = ss.Form(driver, bind_window=win) # <=== Here is the magic!
3232
# Note: sql_script is only run if Journal.db does not exist! This has the effect of creating a new blank
3333
# database as defined by the sql_script file if the database does not yet exist, otherwise it will use the database!

0 commit comments

Comments
 (0)