From c5289d9b9f93aec95d6f2725430505b9db4d342e Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Tue, 28 May 2024 03:01:58 +1000 Subject: [PATCH] release --- .gitignore | 2 ++ CHANGELOG.md | 5 +++++ fastsql/__init__.py | 2 +- fastsql/core.py | 2 +- nbs/00_core.ipynb | 31 ++++++++++++++++++++++++++++++- nbs/index.ipynb | 29 +++++++++++++++++++++++++++++ settings.ini | 2 +- 7 files changed, 69 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 60e9078..5191631 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*.bak +conda/ *.sqlite *.db _proc/ diff --git a/CHANGELOG.md b/CHANGELOG.md index ec97632..af67a2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ +## 1.0.1 + +- Correct version number + + ## 0.0.1 - Init pypi/conda release; v2 support diff --git a/fastsql/__init__.py b/fastsql/__init__.py index 84f9c8e..9e0c83b 100644 --- a/fastsql/__init__.py +++ b/fastsql/__init__.py @@ -1,3 +1,3 @@ -__version__ = "0.0.2" +__version__ = "1.0.1" from .core import * diff --git a/fastsql/core.py b/fastsql/core.py index be62d73..84c8738 100644 --- a/fastsql/core.py +++ b/fastsql/core.py @@ -69,7 +69,7 @@ def get(self:Table, where=None, limit=None): "Select from table, optionally limited by `where` and `limit` clauses" return self.metadata.conn.sql(self.select().where(where).limit(limit)) -# %% ../nbs/00_core.ipynb 15 +# %% ../nbs/00_core.ipynb 17 @patch def close(self:MetaData): "Close the connection" diff --git a/nbs/00_core.ipynb b/nbs/00_core.ipynb index 8d36e61..099701d 100644 --- a/nbs/00_core.ipynb +++ b/nbs/00_core.ipynb @@ -235,7 +235,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b351d1b2", + "id": "cb6461fb", "metadata": {}, "outputs": [ { @@ -257,6 +257,35 @@ "a.get(a.c.Title.startswith('F'), limit=5)" ] }, + { + "cell_type": "markdown", + "id": "9a3153b9", + "metadata": {}, + "source": [ + "This is the query that will run behind the scenes:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6f4caf6c", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "SELECT \"Album\".\"AlbumId\", \"Album\".\"Title\", \"Album\".\"ArtistId\" \n", + "FROM \"Album\" \n", + "WHERE (\"Album\".\"Title\" LIKE :Title_1 || '%')\n", + " LIMIT :param_1\n" + ] + } + ], + "source": [ + "print(a.select().where(a.c.Title.startswith('F')).limit(5))" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/nbs/index.ipynb b/nbs/index.ipynb index 2a1cdbd..e75ae5d 100644 --- a/nbs/index.ipynb +++ b/nbs/index.ipynb @@ -195,6 +195,35 @@ "a.get(a.c.Title.startswith('F'), limit=5)" ] }, + { + "cell_type": "markdown", + "id": "9a3153b9", + "metadata": {}, + "source": [ + "This is the query that ran behind the scenes:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6f4caf6c", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "SELECT \"Album\".\"AlbumId\", \"Album\".\"Title\", \"Album\".\"ArtistId\" \n", + "FROM \"Album\" \n", + "WHERE (\"Album\".\"Title\" LIKE :Title_1 || '%')\n", + " LIMIT :param_1\n" + ] + } + ], + "source": [ + "print(a.select().where(a.c.Title.startswith('F')).limit(5))" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/settings.ini b/settings.ini index 17500c9..769474b 100644 --- a/settings.ini +++ b/settings.ini @@ -1,7 +1,7 @@ [DEFAULT] repo = fastsql lib_name = fastsql -version = 0.0.2 +version = 1.0.1 min_python = 3.9 license = apache2 black_formatting = False