Skip to content

Commit bf77b83

Browse files
committed
v3.5.3
1 parent 47b157c commit bf77b83

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## v3.5.3 (2024-04-08)
4+
5+
### Updates
6+
7+
* added `backend_storage_mode` and `backend_file_storage_location` constructor args for specifying a file based backend (not applicable in `server_mode`)
8+
39
## v3.5.2 (2024-03-21)
410

511
### Updates

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,4 @@ To publish the package to PyPI, run the following command:
193193

194194
::
195195

196-
twine upload dist/pystackql-3.5.2.tar.gz
196+
twine upload dist/pystackql-3.5.3.tar.gz

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
# -- Project information -----------------------------------------------------
2121

2222
project = 'pystackql'
23-
copyright = '2024, StackQL Studios'
23+
copyright = '2021-2024, StackQL Studios'
2424
author = 'StackQL Studios'
2525

2626
# The short X.Y version
2727
version = ''
2828
# The full version, including alpha/beta/rc tags
29-
release = '3.5.2'
29+
release = '3.5.3'
3030

3131

3232
# -- General configuration ---------------------------------------------------

pystackql/stackql.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ class StackQL:
2626
:param server_port: The port of the StackQL server
2727
(`server_mode` only, defaults to `5466`)
2828
:type server_port: int, optional
29+
:param backend_storage_mode: Specifies backend storage mode, options are 'memory' and 'file'
30+
(defaults to `'memory'`, this option is ignored in `server_mode`)
31+
:type backend_storage_mode: str, optional
32+
:param backend_file_storage_location: Specifies location for database file, only applicable when `backend_storage_mode` is 'file'
33+
(defaults to `'{cwd}/stackql.db'`, this option is ignored in `server_mode`)
34+
:type backend_file_storage_location: str, optional
2935
:param output: Determines the format of the output, options are 'dict', 'pandas', and 'csv'
3036
(defaults to `'dict'`, `'csv'` is not supported in `server_mode`)
3137
:type output: str, optional
@@ -210,7 +216,9 @@ def _run_query(self, query):
210216
def __init__(self,
211217
server_mode=False,
212218
server_address='127.0.0.1',
213-
server_port=5466,
219+
server_port=5466,
220+
backend_storage_mode='memory',
221+
backend_file_storage_location='stackql.db',
214222
download_dir=None,
215223
app_root=None,
216224
execution_concurrency_limit=1,
@@ -284,7 +292,12 @@ def __init__(self,
284292
self.params.append("csv")
285293
else:
286294
self.params.append("json")
287-
295+
296+
# backend storage settings
297+
if backend_storage_mode == 'file':
298+
self.params.append("--sqlBackend")
299+
self.params.append(json.dumps({ "dsn": f"file:{backend_file_storage_location}" }))
300+
288301
# get or download the stackql binary
289302
binary = _get_binary_name(this_os)
290303

@@ -330,10 +343,8 @@ def __init__(self,
330343
# if custom_registry is set, use it
331344
if custom_registry is not None:
332345
self.custom_registry = custom_registry
333-
custom_reg_obj = { "url": custom_registry }
334-
custom_reg_str = json.dumps(custom_reg_obj)
335346
self.params.append("--registry")
336-
self.params.append(custom_reg_str)
347+
self.params.append(json.dumps({ "url": custom_registry }))
337348

338349
# csv output
339350
if self.output == "csv":

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
setup(
1212
name='pystackql',
13-
version='3.5.2',
13+
version='3.5.3',
1414
description='A Python interface for StackQL',
1515
long_description=readme,
1616
author='Jeffrey Aven',

0 commit comments

Comments
 (0)