arize-phoenix-sqlean 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. arize_phoenix_sqlean-0.1.0/LICENSE +19 -0
  2. arize_phoenix_sqlean-0.1.0/MANIFEST.in +29 -0
  3. arize_phoenix_sqlean-0.1.0/PKG-INFO +166 -0
  4. arize_phoenix_sqlean-0.1.0/README.md +128 -0
  5. arize_phoenix_sqlean-0.1.0/THIRD_PARTY_LICENSES +267 -0
  6. arize_phoenix_sqlean-0.1.0/arize_phoenix_sqlean.egg-info/PKG-INFO +166 -0
  7. arize_phoenix_sqlean-0.1.0/arize_phoenix_sqlean.egg-info/SOURCES.txt +102 -0
  8. arize_phoenix_sqlean-0.1.0/arize_phoenix_sqlean.egg-info/dependency_links.txt +1 -0
  9. arize_phoenix_sqlean-0.1.0/arize_phoenix_sqlean.egg-info/top_level.txt +1 -0
  10. arize_phoenix_sqlean-0.1.0/setup.cfg +8 -0
  11. arize_phoenix_sqlean-0.1.0/setup.py +199 -0
  12. arize_phoenix_sqlean-0.1.0/sqlean/__init__.py +22 -0
  13. arize_phoenix_sqlean-0.1.0/sqlean/dbapi2.py +96 -0
  14. arize_phoenix_sqlean-0.1.0/sqlean/extensions.py +58 -0
  15. arize_phoenix_sqlean-0.1.0/sqlite/crypto/base32.h +14 -0
  16. arize_phoenix_sqlean-0.1.0/sqlite/crypto/base64.h +15 -0
  17. arize_phoenix_sqlean-0.1.0/sqlite/crypto/base85.h +15 -0
  18. arize_phoenix_sqlean-0.1.0/sqlite/crypto/blake3.h +39 -0
  19. arize_phoenix_sqlean-0.1.0/sqlite/crypto/extension.h +13 -0
  20. arize_phoenix_sqlean-0.1.0/sqlite/crypto/hex.h +15 -0
  21. arize_phoenix_sqlean-0.1.0/sqlite/crypto/md5.h +34 -0
  22. arize_phoenix_sqlean-0.1.0/sqlite/crypto/sha1.h +21 -0
  23. arize_phoenix_sqlean-0.1.0/sqlite/crypto/sha2.h +89 -0
  24. arize_phoenix_sqlean-0.1.0/sqlite/crypto/url.h +15 -0
  25. arize_phoenix_sqlean-0.1.0/sqlite/crypto/xxhash.h +28 -0
  26. arize_phoenix_sqlean-0.1.0/sqlite/crypto/xxhash.impl.h +7238 -0
  27. arize_phoenix_sqlean-0.1.0/sqlite/define/define.h +17 -0
  28. arize_phoenix_sqlean-0.1.0/sqlite/define/extension.h +13 -0
  29. arize_phoenix_sqlean-0.1.0/sqlite/fileio/extension.h +13 -0
  30. arize_phoenix_sqlean-0.1.0/sqlite/fileio/fileio.h +15 -0
  31. arize_phoenix_sqlean-0.1.0/sqlite/fuzzy/common.h +61 -0
  32. arize_phoenix_sqlean-0.1.0/sqlite/fuzzy/extension.h +13 -0
  33. arize_phoenix_sqlean-0.1.0/sqlite/fuzzy/fuzzy.h +27 -0
  34. arize_phoenix_sqlean-0.1.0/sqlite/init.h +10 -0
  35. arize_phoenix_sqlean-0.1.0/sqlite/ipaddr/extension.h +13 -0
  36. arize_phoenix_sqlean-0.1.0/sqlite/math/extension.h +13 -0
  37. arize_phoenix_sqlean-0.1.0/sqlite/regexp/constants.h +18 -0
  38. arize_phoenix_sqlean-0.1.0/sqlite/regexp/extension.h +13 -0
  39. arize_phoenix_sqlean-0.1.0/sqlite/regexp/pcre2/config.h +457 -0
  40. arize_phoenix_sqlean-0.1.0/sqlite/regexp/pcre2/pcre2.h +998 -0
  41. arize_phoenix_sqlean-0.1.0/sqlite/regexp/pcre2/pcre2_internal.h +2047 -0
  42. arize_phoenix_sqlean-0.1.0/sqlite/regexp/pcre2/pcre2_intmodedep.h +934 -0
  43. arize_phoenix_sqlean-0.1.0/sqlite/regexp/pcre2/pcre2_ucp.h +396 -0
  44. arize_phoenix_sqlean-0.1.0/sqlite/regexp/regexp.h +16 -0
  45. arize_phoenix_sqlean-0.1.0/sqlite/shell.c +37415 -0
  46. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-crypto.c +2432 -0
  47. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-define.c +817 -0
  48. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-fileio.c +1518 -0
  49. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-fuzzy.c +2365 -0
  50. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-ipaddr.c +223 -0
  51. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-math.c +309 -0
  52. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-regexp.c +40764 -0
  53. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-stats.c +717 -0
  54. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-text.c +2464 -0
  55. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-time.c +1822 -0
  56. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-unicode.c +5395 -0
  57. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-uuid.c +312 -0
  58. arize_phoenix_sqlean-0.1.0/sqlite/sqlean-vsv.c +1551 -0
  59. arize_phoenix_sqlean-0.1.0/sqlite/sqlean.h +11 -0
  60. arize_phoenix_sqlean-0.1.0/sqlite/sqlite3.c +269654 -0
  61. arize_phoenix_sqlean-0.1.0/sqlite/sqlite3.h +14349 -0
  62. arize_phoenix_sqlean-0.1.0/sqlite/sqlite3ext.h +739 -0
  63. arize_phoenix_sqlean-0.1.0/sqlite/stats/extension.h +13 -0
  64. arize_phoenix_sqlean-0.1.0/sqlite/stats/stats.h +14 -0
  65. arize_phoenix_sqlean-0.1.0/sqlite/test_windirent.h +158 -0
  66. arize_phoenix_sqlean-0.1.0/sqlite/text/bstring.h +57 -0
  67. arize_phoenix_sqlean-0.1.0/sqlite/text/extension.h +13 -0
  68. arize_phoenix_sqlean-0.1.0/sqlite/text/rstring.h +51 -0
  69. arize_phoenix_sqlean-0.1.0/sqlite/text/runes.h +15 -0
  70. arize_phoenix_sqlean-0.1.0/sqlite/text/utf8/groups.h +159 -0
  71. arize_phoenix_sqlean-0.1.0/sqlite/text/utf8/rune.h +48 -0
  72. arize_phoenix_sqlean-0.1.0/sqlite/text/utf8/tables.h +266 -0
  73. arize_phoenix_sqlean-0.1.0/sqlite/text/utf8/utf8.h +55 -0
  74. arize_phoenix_sqlean-0.1.0/sqlite/time/extension.h +13 -0
  75. arize_phoenix_sqlean-0.1.0/sqlite/time/timex.h +270 -0
  76. arize_phoenix_sqlean-0.1.0/sqlite/unicode/extension.h +13 -0
  77. arize_phoenix_sqlean-0.1.0/sqlite/uuid/extension.h +13 -0
  78. arize_phoenix_sqlean-0.1.0/sqlite/vsv/extension.h +13 -0
  79. arize_phoenix_sqlean-0.1.0/src/blob.c +654 -0
  80. arize_phoenix_sqlean-0.1.0/src/blob.h +26 -0
  81. arize_phoenix_sqlean-0.1.0/src/cache.c +362 -0
  82. arize_phoenix_sqlean-0.1.0/src/cache.h +74 -0
  83. arize_phoenix_sqlean-0.1.0/src/connection.c +2219 -0
  84. arize_phoenix_sqlean-0.1.0/src/connection.h +129 -0
  85. arize_phoenix_sqlean-0.1.0/src/cursor.c +970 -0
  86. arize_phoenix_sqlean-0.1.0/src/cursor.h +70 -0
  87. arize_phoenix_sqlean-0.1.0/src/init.c +5 -0
  88. arize_phoenix_sqlean-0.1.0/src/init.h +10 -0
  89. arize_phoenix_sqlean-0.1.0/src/microprotocols.c +153 -0
  90. arize_phoenix_sqlean-0.1.0/src/microprotocols.h +52 -0
  91. arize_phoenix_sqlean-0.1.0/src/module.c +583 -0
  92. arize_phoenix_sqlean-0.1.0/src/module.h +55 -0
  93. arize_phoenix_sqlean-0.1.0/src/prepare_protocol.c +86 -0
  94. arize_phoenix_sqlean-0.1.0/src/prepare_protocol.h +42 -0
  95. arize_phoenix_sqlean-0.1.0/src/row.c +277 -0
  96. arize_phoenix_sqlean-0.1.0/src/row.h +40 -0
  97. arize_phoenix_sqlean-0.1.0/src/sqlean-time-msvc.patch +47 -0
  98. arize_phoenix_sqlean-0.1.0/src/sqlean.c +104 -0
  99. arize_phoenix_sqlean-0.1.0/src/statement.c +512 -0
  100. arize_phoenix_sqlean-0.1.0/src/statement.h +60 -0
  101. arize_phoenix_sqlean-0.1.0/src/test_windirent.h +158 -0
  102. arize_phoenix_sqlean-0.1.0/src/util.c +175 -0
  103. arize_phoenix_sqlean-0.1.0/src/util.h +84 -0
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2004-2007 Gerhard Häring, 2018+ Charles Leifer, 2023+ Anton Zhiyanov
2
+
3
+ This software is provided 'as-is', without any express or implied warranty. In
4
+ no event will the authors be held liable for any damages arising from the use
5
+ of this software.
6
+
7
+ Permission is granted to anyone to use this software for any purpose,
8
+ including commercial applications, and to alter it and redistribute it freely,
9
+ subject to the following restrictions:
10
+
11
+ 1. The origin of this software must not be misrepresented; you must not
12
+ claim that you wrote the original software. If you use this software in
13
+ a product, an acknowledgment in the product documentation would be
14
+ appreciated but is not required.
15
+
16
+ 2. Altered source versions must be plainly marked as such, and must not be
17
+ misrepresented as being the original software.
18
+
19
+ 3. This notice may not be removed or altered from any source distribution.
@@ -0,0 +1,29 @@
1
+ include MANIFEST.in
2
+ include README.md
3
+ include LICENSE
4
+ include THIRD_PARTY_LICENSES
5
+ include setup.py
6
+ include src/*.h
7
+ include src/*.c
8
+ include src/*.patch
9
+
10
+ include sqlite/*.h
11
+ include sqlite/*.c
12
+ include sqlite/crypto/*.h
13
+ include sqlite/define/*.h
14
+ include sqlite/fileio/*.h
15
+ include sqlite/fuzzy/*.h
16
+ include sqlite/init.h/*.h
17
+ include sqlite/ipaddr/*.h
18
+ include sqlite/math/*.h
19
+ include sqlite/regexp/*.h
20
+ include sqlite/regexp/pcre2/*.h
21
+ include sqlite/stats/*.h
22
+ include sqlite/text/*.h
23
+ include sqlite/text/utf8/*.h
24
+ include sqlite/time/*.h
25
+ include sqlite/unicode/*.h
26
+ include sqlite/uuid/*.h
27
+ include sqlite/vsv/*.h
28
+
29
+ global-exclude *~ *.pyc
@@ -0,0 +1,166 @@
1
+ Metadata-Version: 2.4
2
+ Name: arize-phoenix-sqlean
3
+ Version: 0.1.0
4
+ Summary: sqlite3 with extensions
5
+ Home-page: https://github.com/Arize-ai/phoenix/tree/main/packages/phoenix-sqlean
6
+ Author: Anton Zhiyanov
7
+ Author-email: m@antonz.org
8
+ Maintainer: Arize AI
9
+ Maintainer-email: phoenix-devs@arize.com
10
+ License: Zlib AND MIT AND BSD-2-Clause AND BSD-3-Clause AND PSF-2.0
11
+ Platform: ALL
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: MacOS :: MacOS X
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Operating System :: POSIX
17
+ Classifier: Programming Language :: C
18
+ Classifier: Programming Language :: Python
19
+ Classifier: Topic :: Database :: Database Engines/Servers
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.10, <3.15
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ License-File: THIRD_PARTY_LICENSES
25
+ Dynamic: author
26
+ Dynamic: author-email
27
+ Dynamic: classifier
28
+ Dynamic: description
29
+ Dynamic: description-content-type
30
+ Dynamic: home-page
31
+ Dynamic: license
32
+ Dynamic: license-file
33
+ Dynamic: maintainer
34
+ Dynamic: maintainer-email
35
+ Dynamic: platform
36
+ Dynamic: requires-python
37
+ Dynamic: summary
38
+
39
+ # arize-phoenix-sqlean
40
+
41
+ This package provides an SQLite Python wrapper bundled with [sqlean](https://github.com/nalgeon/sqlean) extensions. It's a drop-in replacement for the standard library's [sqlite3](https://docs.python.org/3/library/sqlite3.html) module.
42
+
43
+ > [!NOTE]
44
+ > This is a modified fork of [nalgeon/sqlean.py](https://github.com/nalgeon/sqlean.py),
45
+ > which was archived upstream in February 2026. It was imported at upstream commit
46
+ > [`bdd7097`](https://github.com/nalgeon/sqlean.py/commit/bdd7097f8d5777bc9e3ac3235d9be66b9db34519)
47
+ > and is maintained by [Arize AI](https://arize.com) as part of the Phoenix monorepo.
48
+ > Original work by Anton Zhiyanov and contributors,
49
+ > [zlib License](https://github.com/Arize-ai/phoenix/blob/main/packages/phoenix-sqlean/LICENSE).
50
+ > The `src/` directory contains code derived from CPython's `sqlite3` module
51
+ > (PSF License 2.0). Builds download the SQLite amalgamation (public domain) and
52
+ > [sqlean](https://github.com/nalgeon/sqlean) extension sources (MIT License), which
53
+ > include PCRE2 (BSD 3-Clause), STC (MIT), and code based on Go's time package
54
+ > (BSD 3-Clause). Full notices and the CPython change summary are in
55
+ > [THIRD_PARTY_LICENSES](https://github.com/Arize-ai/phoenix/blob/main/packages/phoenix-sqlean/THIRD_PARTY_LICENSES).
56
+
57
+ ```
58
+ pip install arize-phoenix-sqlean
59
+ ```
60
+
61
+ ```python
62
+ import sqlean
63
+
64
+ # enable all extensions
65
+ sqlean.extensions.enable_all()
66
+
67
+ # has the same API as the default sqlite3 module
68
+ conn = sqlean.connect(":memory:")
69
+ conn.execute("create table employees(id, name)")
70
+
71
+ # and comes with sqlean extensions
72
+ cur = conn.execute("select median(value) from generate_series(1, 99)")
73
+ print(cur.fetchone())
74
+ # (50.0,)
75
+
76
+ conn.close()
77
+ ```
78
+
79
+ ## Extensions
80
+
81
+ This package bundles essential SQLite extensions:
82
+
83
+ - [crypto](https://github.com/nalgeon/sqlean/blob/main/docs/crypto.md): Hashing, encoding and decoding data
84
+ - [define](https://github.com/nalgeon/sqlean/blob/main/docs/define.md): User-defined functions and dynamic SQL
85
+ - [fileio](https://github.com/nalgeon/sqlean/blob/main/docs/fileio.md): Reading and writing files
86
+ - [fuzzy](https://github.com/nalgeon/sqlean/blob/main/docs/fuzzy.md): Fuzzy string matching and phonetics
87
+ - [ipaddr](https://github.com/nalgeon/sqlean/blob/main/docs/ipaddr.md): IP address manipulation
88
+ - [regexp](https://github.com/nalgeon/sqlean/blob/main/docs/regexp.md): Regular expressions
89
+ - [stats](https://github.com/nalgeon/sqlean/blob/main/docs/stats.md): Math statistics
90
+ - [text](https://github.com/nalgeon/sqlean/blob/main/docs/text.md): String functions
91
+ - [time](https://github.com/nalgeon/sqlean/blob/main/docs/time.md): High-precision date/time
92
+ - [uuid](https://github.com/nalgeon/sqlean/blob/main/docs/uuid.md): Universally Unique IDentifiers
93
+ - [vsv](https://github.com/nalgeon/sqlean/blob/main/docs/vsv.md): CSV files as virtual tables
94
+
95
+ ## Installation
96
+
97
+ ```
98
+ pip install arize-phoenix-sqlean
99
+ ```
100
+
101
+ Note that the package name is `arize-phoenix-sqlean`, while the code imports are just `sqlean` — the same import name as the upstream `sqlean.py` package, so this fork is a drop-in replacement (only one of the two can be installed in an environment).
102
+
103
+ A binary package (wheel) is available for the following operating systems:
104
+
105
+ - Linux (x86_64/aarch64)
106
+ - macOS (x86_64/arm64)
107
+ - Windows (x86_64)
108
+
109
+ ## Usage
110
+
111
+ All extensions are disabled by default. You can still use `sqlean` as a drop-in replacement for `sqlite3`:
112
+
113
+ ```python
114
+ import sqlean as sqlite3
115
+
116
+ conn = sqlite3.connect(":memory:")
117
+ cur = conn.execute("select 'sql is awesome'")
118
+ print(cur.fetchone())
119
+ conn.close()
120
+ ```
121
+
122
+ To enable all extensions, call `sqlean.extensions.enable_all()` before calling `connect()`:
123
+
124
+ ```python
125
+ import sqlean
126
+
127
+ sqlean.extensions.enable_all()
128
+
129
+ conn = sqlean.connect(":memory:")
130
+ cur = conn.execute("select median(value) from generate_series(1, 99)")
131
+ print(cur.fetchone())
132
+ conn.close()
133
+ ```
134
+
135
+ To enable specific extensions, call `sqlean.extensions.enable()`:
136
+
137
+ ```python
138
+ import sqlean
139
+
140
+ sqlean.extensions.enable("stats", "text")
141
+
142
+ conn = sqlean.connect(":memory:")
143
+ cur = conn.execute("select median(value) from generate_series(1, 99)")
144
+ print(cur.fetchone())
145
+ conn.close()
146
+ ```
147
+
148
+ ## Building from source
149
+
150
+ Prepare source files:
151
+
152
+ ```
153
+ make prepare-src
154
+ make download-sqlite
155
+ make download-sqlean
156
+ ```
157
+
158
+ Build and test the package:
159
+
160
+ ```
161
+ make clean build
162
+ ```
163
+
164
+ ## Credits
165
+
166
+ Based on the [pysqlite3](https://github.com/coleifer/pysqlite3) project by Charles Leifer, which is in turn based on [pysqlite](https://github.com/ghaering/pysqlite) by Gerhard Häring. Available under the [zlib license](https://github.com/Arize-ai/phoenix/blob/main/packages/phoenix-sqlean/LICENSE).
@@ -0,0 +1,128 @@
1
+ # arize-phoenix-sqlean
2
+
3
+ This package provides an SQLite Python wrapper bundled with [sqlean](https://github.com/nalgeon/sqlean) extensions. It's a drop-in replacement for the standard library's [sqlite3](https://docs.python.org/3/library/sqlite3.html) module.
4
+
5
+ > [!NOTE]
6
+ > This is a modified fork of [nalgeon/sqlean.py](https://github.com/nalgeon/sqlean.py),
7
+ > which was archived upstream in February 2026. It was imported at upstream commit
8
+ > [`bdd7097`](https://github.com/nalgeon/sqlean.py/commit/bdd7097f8d5777bc9e3ac3235d9be66b9db34519)
9
+ > and is maintained by [Arize AI](https://arize.com) as part of the Phoenix monorepo.
10
+ > Original work by Anton Zhiyanov and contributors,
11
+ > [zlib License](https://github.com/Arize-ai/phoenix/blob/main/packages/phoenix-sqlean/LICENSE).
12
+ > The `src/` directory contains code derived from CPython's `sqlite3` module
13
+ > (PSF License 2.0). Builds download the SQLite amalgamation (public domain) and
14
+ > [sqlean](https://github.com/nalgeon/sqlean) extension sources (MIT License), which
15
+ > include PCRE2 (BSD 3-Clause), STC (MIT), and code based on Go's time package
16
+ > (BSD 3-Clause). Full notices and the CPython change summary are in
17
+ > [THIRD_PARTY_LICENSES](https://github.com/Arize-ai/phoenix/blob/main/packages/phoenix-sqlean/THIRD_PARTY_LICENSES).
18
+
19
+ ```
20
+ pip install arize-phoenix-sqlean
21
+ ```
22
+
23
+ ```python
24
+ import sqlean
25
+
26
+ # enable all extensions
27
+ sqlean.extensions.enable_all()
28
+
29
+ # has the same API as the default sqlite3 module
30
+ conn = sqlean.connect(":memory:")
31
+ conn.execute("create table employees(id, name)")
32
+
33
+ # and comes with sqlean extensions
34
+ cur = conn.execute("select median(value) from generate_series(1, 99)")
35
+ print(cur.fetchone())
36
+ # (50.0,)
37
+
38
+ conn.close()
39
+ ```
40
+
41
+ ## Extensions
42
+
43
+ This package bundles essential SQLite extensions:
44
+
45
+ - [crypto](https://github.com/nalgeon/sqlean/blob/main/docs/crypto.md): Hashing, encoding and decoding data
46
+ - [define](https://github.com/nalgeon/sqlean/blob/main/docs/define.md): User-defined functions and dynamic SQL
47
+ - [fileio](https://github.com/nalgeon/sqlean/blob/main/docs/fileio.md): Reading and writing files
48
+ - [fuzzy](https://github.com/nalgeon/sqlean/blob/main/docs/fuzzy.md): Fuzzy string matching and phonetics
49
+ - [ipaddr](https://github.com/nalgeon/sqlean/blob/main/docs/ipaddr.md): IP address manipulation
50
+ - [regexp](https://github.com/nalgeon/sqlean/blob/main/docs/regexp.md): Regular expressions
51
+ - [stats](https://github.com/nalgeon/sqlean/blob/main/docs/stats.md): Math statistics
52
+ - [text](https://github.com/nalgeon/sqlean/blob/main/docs/text.md): String functions
53
+ - [time](https://github.com/nalgeon/sqlean/blob/main/docs/time.md): High-precision date/time
54
+ - [uuid](https://github.com/nalgeon/sqlean/blob/main/docs/uuid.md): Universally Unique IDentifiers
55
+ - [vsv](https://github.com/nalgeon/sqlean/blob/main/docs/vsv.md): CSV files as virtual tables
56
+
57
+ ## Installation
58
+
59
+ ```
60
+ pip install arize-phoenix-sqlean
61
+ ```
62
+
63
+ Note that the package name is `arize-phoenix-sqlean`, while the code imports are just `sqlean` — the same import name as the upstream `sqlean.py` package, so this fork is a drop-in replacement (only one of the two can be installed in an environment).
64
+
65
+ A binary package (wheel) is available for the following operating systems:
66
+
67
+ - Linux (x86_64/aarch64)
68
+ - macOS (x86_64/arm64)
69
+ - Windows (x86_64)
70
+
71
+ ## Usage
72
+
73
+ All extensions are disabled by default. You can still use `sqlean` as a drop-in replacement for `sqlite3`:
74
+
75
+ ```python
76
+ import sqlean as sqlite3
77
+
78
+ conn = sqlite3.connect(":memory:")
79
+ cur = conn.execute("select 'sql is awesome'")
80
+ print(cur.fetchone())
81
+ conn.close()
82
+ ```
83
+
84
+ To enable all extensions, call `sqlean.extensions.enable_all()` before calling `connect()`:
85
+
86
+ ```python
87
+ import sqlean
88
+
89
+ sqlean.extensions.enable_all()
90
+
91
+ conn = sqlean.connect(":memory:")
92
+ cur = conn.execute("select median(value) from generate_series(1, 99)")
93
+ print(cur.fetchone())
94
+ conn.close()
95
+ ```
96
+
97
+ To enable specific extensions, call `sqlean.extensions.enable()`:
98
+
99
+ ```python
100
+ import sqlean
101
+
102
+ sqlean.extensions.enable("stats", "text")
103
+
104
+ conn = sqlean.connect(":memory:")
105
+ cur = conn.execute("select median(value) from generate_series(1, 99)")
106
+ print(cur.fetchone())
107
+ conn.close()
108
+ ```
109
+
110
+ ## Building from source
111
+
112
+ Prepare source files:
113
+
114
+ ```
115
+ make prepare-src
116
+ make download-sqlite
117
+ make download-sqlean
118
+ ```
119
+
120
+ Build and test the package:
121
+
122
+ ```
123
+ make clean build
124
+ ```
125
+
126
+ ## Credits
127
+
128
+ Based on the [pysqlite3](https://github.com/coleifer/pysqlite3) project by Charles Leifer, which is in turn based on [pysqlite](https://github.com/ghaering/pysqlite) by Gerhard Häring. Available under the [zlib license](https://github.com/Arize-ai/phoenix/blob/main/packages/phoenix-sqlean/LICENSE).
@@ -0,0 +1,267 @@
1
+ sqlean
2
+ ======
3
+
4
+ The bundled sqlean extension sources are distributed under the MIT License:
5
+
6
+ Copyright (c) 2021+ Anton Zhiyanov
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
25
+
26
+
27
+ PCRE2
28
+ =====
29
+
30
+ PCRE2 is a library of functions to support regular expressions whose syntax
31
+ and semantics are as close as possible to those of the Perl 5 language.
32
+
33
+ Releases 10.00 and above of PCRE2 are distributed under the terms of the "BSD"
34
+ licence, as specified below, with one exemption for certain binary
35
+ redistributions. The documentation for PCRE2, supplied in the "doc" directory,
36
+ is distributed under the same terms as the software itself. The data in the
37
+ testdata directory is not copyrighted and is in the public domain.
38
+
39
+ The basic library functions are written in C and are freestanding. Also
40
+ included in the distribution is a just-in-time compiler that can be used to
41
+ optimize pattern matching. This is an optional feature that can be omitted when
42
+ the library is built.
43
+
44
+ THE BASIC LIBRARY FUNCTIONS
45
+ ---------------------------
46
+
47
+ Written by: Philip Hazel
48
+ Email local part: Philip.Hazel
49
+ Email domain: gmail.com
50
+
51
+ Retired from University of Cambridge Computing Service,
52
+ Cambridge, England.
53
+
54
+ Copyright (c) 1997-2022 University of Cambridge
55
+ All rights reserved.
56
+
57
+ PCRE2 JUST-IN-TIME COMPILATION SUPPORT
58
+ --------------------------------------
59
+
60
+ Written by: Zoltan Herczeg
61
+ Email local part: hzmester
62
+ Email domain: freemail.hu
63
+
64
+ Copyright(c) 2010-2022 Zoltan Herczeg
65
+ All rights reserved.
66
+
67
+ STACK-LESS JUST-IN-TIME COMPILER
68
+ --------------------------------
69
+
70
+ Written by: Zoltan Herczeg
71
+ Email local part: hzmester
72
+ Email domain: freemail.hu
73
+
74
+ Copyright(c) 2009-2022 Zoltan Herczeg
75
+ All rights reserved.
76
+
77
+ THE "BSD" LICENCE
78
+ -----------------
79
+
80
+ Redistribution and use in source and binary forms, with or without
81
+ modification, are permitted provided that the following conditions are met:
82
+
83
+ * Redistributions of source code must retain the above copyright notices,
84
+ this list of conditions and the following disclaimer.
85
+
86
+ * Redistributions in binary form must reproduce the above copyright
87
+ notices, this list of conditions and the following disclaimer in the
88
+ documentation and/or other materials provided with the distribution.
89
+
90
+ * Neither the name of the University of Cambridge nor the names of any
91
+ contributors may be used to endorse or promote products derived from this
92
+ software without specific prior written permission.
93
+
94
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
95
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
96
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
97
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
98
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
99
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
100
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
101
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
102
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
103
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
104
+ POSSIBILITY OF SUCH DAMAGE.
105
+
106
+ EXEMPTION FOR BINARY LIBRARY-LIKE PACKAGES
107
+ ------------------------------------------
108
+
109
+ The second condition in the BSD licence (covering binary redistributions) does
110
+ not apply all the way down a chain of software. If binary package A includes
111
+ PCRE2, it must respect the condition, but if package B is software that
112
+ includes package A, the condition is not imposed on package B unless it uses
113
+ PCRE2 independently.
114
+
115
+
116
+ STC
117
+ ===
118
+
119
+ The sqlean text extension contains code from STC:
120
+
121
+ MIT License
122
+
123
+ Copyright (c) 2023 Tyge Løvset
124
+
125
+ Permission is hereby granted, free of charge, to any person obtaining a copy
126
+ of this software and associated documentation files (the "Software"), to deal
127
+ in the Software without restriction, including without limitation the rights
128
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
129
+ copies of the Software, and to permit persons to whom the Software is
130
+ furnished to do so, subject to the following conditions:
131
+
132
+ The above copyright notice and this permission notice shall be included in all
133
+ copies or substantial portions of the Software.
134
+
135
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
136
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
137
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
138
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
139
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
140
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
141
+ SOFTWARE.
142
+
143
+
144
+ Go
145
+ ==
146
+
147
+ The sqlean time extension is based on Go's time package:
148
+
149
+ Copyright 2009 The Go Authors.
150
+
151
+ Redistribution and use in source and binary forms, with or without
152
+ modification, are permitted provided that the following conditions are
153
+ met:
154
+
155
+ * Redistributions of source code must retain the above copyright
156
+ notice, this list of conditions and the following disclaimer.
157
+ * Redistributions in binary form must reproduce the above
158
+ copyright notice, this list of conditions and the following disclaimer
159
+ in the documentation and/or other materials provided with the
160
+ distribution.
161
+ * Neither the name of Google LLC nor the names of its
162
+ contributors may be used to endorse or promote products derived from
163
+ this software without specific prior written permission.
164
+
165
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
166
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
167
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
168
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
169
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
170
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
171
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
172
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
173
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
174
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
175
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
176
+
177
+
178
+ CPython
179
+ ~~~~~~~
180
+
181
+ Parts of the SQLite wrapper are derived from CPython's sqlite3 module. They
182
+ have been modified to compile against the bundled SQLite amalgamation and to
183
+ initialize the bundled sqlean extensions.
184
+
185
+ PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
186
+ --------------------------------------------
187
+
188
+ Copyright (c) 2001 Python Software Foundation; All Rights Reserved
189
+
190
+ 1. This LICENSE AGREEMENT is between the Python Software Foundation
191
+ ("PSF"), and the Individual or Organization ("Licensee") accessing and
192
+ otherwise using this software ("Python") in source or binary form and
193
+ its associated documentation.
194
+
195
+ 2. Subject to the terms and conditions of this License Agreement, PSF hereby
196
+ grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
197
+ analyze, test, perform and/or display publicly, prepare derivative works,
198
+ distribute, and otherwise use Python alone or in any derivative version,
199
+ provided, however, that PSF's License Agreement and PSF's notice of copyright,
200
+ i.e., "Copyright (c) 2001 Python Software Foundation; All Rights Reserved"
201
+ are retained in Python alone or in any derivative version prepared by Licensee.
202
+
203
+ 3. In the event Licensee prepares a derivative work that is based on
204
+ or incorporates Python or any part thereof, and wants to make
205
+ the derivative work available to others as provided herein, then
206
+ Licensee hereby agrees to include in any such work a brief summary of
207
+ the changes made to Python.
208
+
209
+ 4. PSF is making Python available to Licensee on an "AS IS"
210
+ basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
211
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
212
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
213
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
214
+ INFRINGE ANY THIRD PARTY RIGHTS.
215
+
216
+ 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
217
+ FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
218
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
219
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
220
+
221
+ 6. This License Agreement will automatically terminate upon a material
222
+ breach of its terms and conditions.
223
+
224
+ 7. Nothing in this License Agreement shall be deemed to create any
225
+ relationship of agency, partnership, or joint venture between PSF and
226
+ Licensee. This License Agreement does not grant permission to use PSF
227
+ trademarks or trade name in a trademark sense to endorse or promote
228
+ products or services of Licensee, or any third party.
229
+
230
+ 8. By copying, installing or otherwise using Python, Licensee
231
+ agrees to be bound by the terms and conditions of this License
232
+ Agreement.
233
+
234
+
235
+ xxHash
236
+ ~~~~~~
237
+
238
+ sqlean's crypto extension includes xxHash's header-only implementation as
239
+ crypto/xxhash.impl.h. It is fetched at build time from xxHash v0.8.3 (see
240
+ XXHASH_COMMIT in the Makefile) and compiled into the bundled extension.
241
+
242
+ Copyright (c) 2012-2023 Yann Collet
243
+
244
+ BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)
245
+
246
+ Redistribution and use in source and binary forms, with or without
247
+ modification, are permitted provided that the following conditions are
248
+ met:
249
+
250
+ * Redistributions of source code must retain the above copyright
251
+ notice, this list of conditions and the following disclaimer.
252
+ * Redistributions in binary form must reproduce the above
253
+ copyright notice, this list of conditions and the following disclaimer
254
+ in the documentation and/or other materials provided with the
255
+ distribution.
256
+
257
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
258
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
259
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
260
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
261
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
262
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
263
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
264
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
265
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
266
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
267
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.