singlestoredb 0.3.3__py3-none-any.whl → 1.0.3__py3-none-any.whl

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.

Potentially problematic release.


This version of singlestoredb might be problematic. Click here for more details.

Files changed (121) hide show
  1. singlestoredb/__init__.py +33 -2
  2. singlestoredb/alchemy/__init__.py +90 -0
  3. singlestoredb/auth.py +6 -4
  4. singlestoredb/config.py +116 -16
  5. singlestoredb/connection.py +489 -523
  6. singlestoredb/converters.py +275 -26
  7. singlestoredb/exceptions.py +30 -4
  8. singlestoredb/functions/__init__.py +1 -0
  9. singlestoredb/functions/decorator.py +142 -0
  10. singlestoredb/functions/dtypes.py +1639 -0
  11. singlestoredb/functions/ext/__init__.py +2 -0
  12. singlestoredb/functions/ext/arrow.py +375 -0
  13. singlestoredb/functions/ext/asgi.py +661 -0
  14. singlestoredb/functions/ext/json.py +427 -0
  15. singlestoredb/functions/ext/mmap.py +306 -0
  16. singlestoredb/functions/ext/rowdat_1.py +744 -0
  17. singlestoredb/functions/signature.py +673 -0
  18. singlestoredb/fusion/__init__.py +11 -0
  19. singlestoredb/fusion/graphql.py +213 -0
  20. singlestoredb/fusion/handler.py +621 -0
  21. singlestoredb/fusion/handlers/__init__.py +0 -0
  22. singlestoredb/fusion/handlers/stage.py +257 -0
  23. singlestoredb/fusion/handlers/utils.py +162 -0
  24. singlestoredb/fusion/handlers/workspace.py +412 -0
  25. singlestoredb/fusion/registry.py +164 -0
  26. singlestoredb/fusion/result.py +399 -0
  27. singlestoredb/http/__init__.py +27 -0
  28. singlestoredb/http/connection.py +1192 -0
  29. singlestoredb/management/__init__.py +3 -2
  30. singlestoredb/management/billing_usage.py +148 -0
  31. singlestoredb/management/cluster.py +19 -14
  32. singlestoredb/management/manager.py +100 -40
  33. singlestoredb/management/organization.py +188 -0
  34. singlestoredb/management/region.py +6 -8
  35. singlestoredb/management/utils.py +253 -4
  36. singlestoredb/management/workspace.py +1153 -35
  37. singlestoredb/mysql/__init__.py +177 -0
  38. singlestoredb/mysql/_auth.py +298 -0
  39. singlestoredb/mysql/charset.py +214 -0
  40. singlestoredb/mysql/connection.py +1814 -0
  41. singlestoredb/mysql/constants/CLIENT.py +38 -0
  42. singlestoredb/mysql/constants/COMMAND.py +32 -0
  43. singlestoredb/mysql/constants/CR.py +78 -0
  44. singlestoredb/mysql/constants/ER.py +474 -0
  45. singlestoredb/mysql/constants/FIELD_TYPE.py +32 -0
  46. singlestoredb/mysql/constants/FLAG.py +15 -0
  47. singlestoredb/mysql/constants/SERVER_STATUS.py +10 -0
  48. singlestoredb/mysql/constants/__init__.py +0 -0
  49. singlestoredb/mysql/converters.py +271 -0
  50. singlestoredb/mysql/cursors.py +713 -0
  51. singlestoredb/mysql/err.py +92 -0
  52. singlestoredb/mysql/optionfile.py +20 -0
  53. singlestoredb/mysql/protocol.py +388 -0
  54. singlestoredb/mysql/tests/__init__.py +19 -0
  55. singlestoredb/mysql/tests/base.py +126 -0
  56. singlestoredb/mysql/tests/conftest.py +37 -0
  57. singlestoredb/mysql/tests/test_DictCursor.py +132 -0
  58. singlestoredb/mysql/tests/test_SSCursor.py +141 -0
  59. singlestoredb/mysql/tests/test_basic.py +452 -0
  60. singlestoredb/mysql/tests/test_connection.py +851 -0
  61. singlestoredb/mysql/tests/test_converters.py +58 -0
  62. singlestoredb/mysql/tests/test_cursor.py +141 -0
  63. singlestoredb/mysql/tests/test_err.py +16 -0
  64. singlestoredb/mysql/tests/test_issues.py +514 -0
  65. singlestoredb/mysql/tests/test_load_local.py +75 -0
  66. singlestoredb/mysql/tests/test_nextset.py +88 -0
  67. singlestoredb/mysql/tests/test_optionfile.py +27 -0
  68. singlestoredb/mysql/tests/thirdparty/__init__.py +6 -0
  69. singlestoredb/mysql/tests/thirdparty/test_MySQLdb/__init__.py +9 -0
  70. singlestoredb/mysql/tests/thirdparty/test_MySQLdb/capabilities.py +323 -0
  71. singlestoredb/mysql/tests/thirdparty/test_MySQLdb/dbapi20.py +865 -0
  72. singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py +110 -0
  73. singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py +224 -0
  74. singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py +101 -0
  75. singlestoredb/mysql/times.py +23 -0
  76. singlestoredb/pytest.py +283 -0
  77. singlestoredb/tests/empty.sql +0 -0
  78. singlestoredb/tests/ext_funcs/__init__.py +385 -0
  79. singlestoredb/tests/test.sql +210 -0
  80. singlestoredb/tests/test2.sql +1 -0
  81. singlestoredb/tests/test_basics.py +482 -117
  82. singlestoredb/tests/test_config.py +13 -15
  83. singlestoredb/tests/test_connection.py +241 -289
  84. singlestoredb/tests/test_dbapi.py +27 -0
  85. singlestoredb/tests/test_exceptions.py +0 -2
  86. singlestoredb/tests/test_ext_func.py +1193 -0
  87. singlestoredb/tests/test_ext_func_data.py +1101 -0
  88. singlestoredb/tests/test_fusion.py +465 -0
  89. singlestoredb/tests/test_http.py +32 -28
  90. singlestoredb/tests/test_management.py +588 -10
  91. singlestoredb/tests/test_plugin.py +33 -0
  92. singlestoredb/tests/test_results.py +11 -14
  93. singlestoredb/tests/test_types.py +0 -2
  94. singlestoredb/tests/test_udf.py +687 -0
  95. singlestoredb/tests/test_xdict.py +0 -2
  96. singlestoredb/tests/utils.py +3 -4
  97. singlestoredb/types.py +4 -5
  98. singlestoredb/utils/config.py +71 -12
  99. singlestoredb/utils/convert_rows.py +0 -2
  100. singlestoredb/utils/debug.py +13 -0
  101. singlestoredb/utils/mogrify.py +151 -0
  102. singlestoredb/utils/results.py +4 -3
  103. singlestoredb/utils/xdict.py +12 -12
  104. singlestoredb-1.0.3.dist-info/METADATA +139 -0
  105. singlestoredb-1.0.3.dist-info/RECORD +112 -0
  106. {singlestoredb-0.3.3.dist-info → singlestoredb-1.0.3.dist-info}/WHEEL +1 -1
  107. singlestoredb-1.0.3.dist-info/entry_points.txt +2 -0
  108. singlestoredb/drivers/__init__.py +0 -46
  109. singlestoredb/drivers/base.py +0 -200
  110. singlestoredb/drivers/cymysql.py +0 -40
  111. singlestoredb/drivers/http.py +0 -49
  112. singlestoredb/drivers/mariadb.py +0 -42
  113. singlestoredb/drivers/mysqlconnector.py +0 -51
  114. singlestoredb/drivers/mysqldb.py +0 -62
  115. singlestoredb/drivers/pymysql.py +0 -39
  116. singlestoredb/drivers/pyodbc.py +0 -67
  117. singlestoredb/http.py +0 -794
  118. singlestoredb-0.3.3.dist-info/METADATA +0 -105
  119. singlestoredb-0.3.3.dist-info/RECORD +0 -46
  120. {singlestoredb-0.3.3.dist-info → singlestoredb-1.0.3.dist-info}/LICENSE +0 -0
  121. {singlestoredb-0.3.3.dist-info → singlestoredb-1.0.3.dist-info}/top_level.txt +0 -0
@@ -1,8 +1,6 @@
1
1
  #!/usr/bin/env python
2
2
  # type: ignore
3
3
  """Test SingleStoreDB results."""
4
- from __future__ import annotations
5
-
6
4
  import os
7
5
  import unittest
8
6
 
@@ -31,7 +29,6 @@ class TestResults(unittest.TestCase):
31
29
  def setUp(self):
32
30
  self.conn = s2.connect(database=type(self).dbname)
33
31
  self.cur = self.conn.cursor()
34
- self.driver = self.conn._driver.dbapi.__name__
35
32
 
36
33
  def tearDown(self):
37
34
  try:
@@ -49,12 +46,12 @@ class TestResults(unittest.TestCase):
49
46
  pass
50
47
 
51
48
  def test_tuples(self):
52
- with s2.options(('results.format', 'tuple')):
49
+ with s2.options(('results.type', 'tuples')):
53
50
  with s2.connect(database=type(self).dbname) as conn:
54
51
  with conn.cursor() as cur:
55
52
  cur.execute('select * from data')
56
53
  out = cur.fetchone()
57
- assert type(out) == tuple, type(out)
54
+ assert type(out) is tuple, type(out)
58
55
  assert len(out) == 3, len(out)
59
56
  cur.fetchall()
60
57
 
@@ -62,7 +59,7 @@ class TestResults(unittest.TestCase):
62
59
  out = cur.fetchall()
63
60
  assert len(out) == 5, len(out)
64
61
  assert len(out[0]) == 3, len(out[0])
65
- assert type(out[0]) == tuple, type(out[0])
62
+ assert type(out[0]) is tuple, type(out[0])
66
63
  assert sorted(out) == sorted([
67
64
  ('a', 'antelopes', 2),
68
65
  ('b', 'bears', 2),
@@ -75,7 +72,7 @@ class TestResults(unittest.TestCase):
75
72
  assert len(out) == 0, len(out)
76
73
 
77
74
  def test_namedtuples(self):
78
- with s2.options(('results.format', 'namedtuple')):
75
+ with s2.options(('results.type', 'namedtuples')):
79
76
  with s2.connect(database=type(self).dbname) as conn:
80
77
  with conn.cursor() as cur:
81
78
  cur.execute('select * from data')
@@ -109,18 +106,18 @@ class TestResults(unittest.TestCase):
109
106
  assert len(out) == 0, len(out)
110
107
 
111
108
  def test_dict(self):
112
- with s2.options(('results.format', 'dict')):
109
+ with s2.options(('results.type', 'dicts')):
113
110
  with s2.connect(database=type(self).dbname) as conn:
114
111
  with conn.cursor() as cur:
115
112
  cur.execute('select * from data')
116
113
  out = cur.fetchone()
117
- assert type(out) == dict, type(out)
114
+ assert type(out) is dict, type(out)
118
115
  assert len(out) == 3, len(out)
119
116
  cur.fetchall()
120
117
 
121
118
  cur.execute('select * from data')
122
119
  out = cur.fetchall()
123
- assert type(out[0]) == dict, type(out[0])
120
+ assert type(out[0]) is dict, type(out[0])
124
121
  assert len(out) == 5, len(out)
125
122
  assert len(out[0]) == 3, len(out[0])
126
123
  assert sorted(out, key=lambda x: x['id']) == sorted(
@@ -136,19 +133,19 @@ class TestResults(unittest.TestCase):
136
133
  out = cur.fetchall()
137
134
  assert len(out) == 0, len(out)
138
135
 
139
- def test_dataframe(self):
140
- with s2.options(('results.format', 'dataframe')):
136
+ def _test_dataframe(self):
137
+ with s2.options(('results.type', 'dataframe')):
141
138
  with s2.connect(database=type(self).dbname) as conn:
142
139
  with conn.cursor() as cur:
143
140
  cur.execute('select * from data')
144
141
  out = cur.fetchone()
145
- assert type(out) == pd.DataFrame, type(out)
142
+ assert type(out) is pd.DataFrame, type(out)
146
143
  assert len(out) == 1, len(out)
147
144
  cur.fetchall()
148
145
 
149
146
  cur.execute('select * from data')
150
147
  out = cur.fetchall()
151
- assert type(out) == pd.DataFrame, type(out)
148
+ assert type(out) is pd.DataFrame, type(out)
152
149
  assert len(out) == 5, len(out)
153
150
  out = out.sort_values('id').reset_index(drop=True)
154
151
  exp = pd.DataFrame(
@@ -1,8 +1,6 @@
1
1
  #!/usr/bin/env python
2
2
  # type: ignore
3
3
  """Test SingleStoreDB data types."""
4
- from __future__ import annotations
5
-
6
4
  import datetime
7
5
  import unittest
8
6