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
@@ -0,0 +1,112 @@
1
+ singlestoredb/__init__.py,sha256=qDpKRys2vXRJVjzkvHX3g5DCp_FFJ2bw3Kw9qhFXdr0,1634
2
+ singlestoredb/auth.py,sha256=u8D9tpKzrqa4ssaHjyZnGDX1q8XBpGtuoOkTkSv7B28,7599
3
+ singlestoredb/config.py,sha256=Xaipos7C0bLTM2EBsuBXRuA4NI-AL3Attb7KC-DqlSg,7856
4
+ singlestoredb/connection.py,sha256=gDBIs3XgLOROVHtzMx9zmSYILc0aRVY7k8we3b4TxCw,44227
5
+ singlestoredb/converters.py,sha256=aH_QhLr94i9_AjvcplTar0HfX2yi53KGxHHzJc7lSU0,12515
6
+ singlestoredb/exceptions.py,sha256=HuoA6sMRL5qiCiee-_5ddTGmFbYC9Euk8TYUsh5GvTw,3234
7
+ singlestoredb/pytest.py,sha256=OyF3BO9mgxenifYhOihnzGk8WzCJ_zN5_mxe8XyFPOc,9074
8
+ singlestoredb/types.py,sha256=FIqO1A7e0Gkk7ITmIysBy-P5S--ItbMSlYvblzqGS30,9969
9
+ singlestoredb/alchemy/__init__.py,sha256=dXRThusYrs_9GjrhPOw0-vw94in_T8yY9jE7SGCqiQk,2523
10
+ singlestoredb/functions/__init__.py,sha256=WL1LqgMTdnGOse3tQqmD-HH8TdfCPS89GNO7hO0v_aw,41
11
+ singlestoredb/functions/decorator.py,sha256=H12MUeBw8VOppx6esntaR43ukeIffbnAr716CBpYJ4g,5193
12
+ singlestoredb/functions/dtypes.py,sha256=iP3_AvE2jBxlkziOHzoUvTtYCdBZlaxJHNgvGwp07Ao,36712
13
+ singlestoredb/functions/signature.py,sha256=fNnlTfc0R0sM9wm78UwG7Ok9eMJTtOfawrIpjts2wdY,18866
14
+ singlestoredb/functions/ext/__init__.py,sha256=kGCV3QC5pL95TytpI8pwvSVCqqoTrV8duQQEUp65sy4,66
15
+ singlestoredb/functions/ext/arrow.py,sha256=WB7n1ACslyd8nlbFzUvlbxn1BVuEjA9-BGBEqCWlSOo,9061
16
+ singlestoredb/functions/ext/asgi.py,sha256=3Rp0m2DNf5yzbCQpaazTTVoDCPfp3jT6dJ7MlvHijw0,21938
17
+ singlestoredb/functions/ext/json.py,sha256=UuUxTzlr5ztAbXqOGaVGUhO7xFN_oBY75nFh9B8cRog,10372
18
+ singlestoredb/functions/ext/mmap.py,sha256=lvdKiGPh-H7LfkrYbPvcH5BWv9zuz7t2FAvW-nYdWzI,9759
19
+ singlestoredb/functions/ext/rowdat_1.py,sha256=yZElsItSbVTFlXU3N-ee6QIybxuksqwv1UE3Y6h45c0,22274
20
+ singlestoredb/fusion/__init__.py,sha256=Qo7SuqGw-l-vE8-EI2jhm6hXJkYfOLUKIws9c7LFNX0,356
21
+ singlestoredb/fusion/graphql.py,sha256=ZA3HcDq5rER-dCEavwTqnF7KM0D2LCYIY7nLQk7lSso,5207
22
+ singlestoredb/fusion/handler.py,sha256=7Oau7A5mclO5t3egH2FINxo8By6zpwzAQLCMFIo9CCo,18338
23
+ singlestoredb/fusion/registry.py,sha256=xpaWO9Bne5QYSE0ump1NcyHimFQSYW49gu3NSPBhLCI,4084
24
+ singlestoredb/fusion/result.py,sha256=Bd3KbRpqWqQcWp_Chd4bzBy8Kfc8nXLS_Pn_GGbPO6o,11772
25
+ singlestoredb/fusion/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
+ singlestoredb/fusion/handlers/stage.py,sha256=Abj59HZyy7kUWwujG-7FZ9-8d14W3XWRc3XfOMgBeng,6386
27
+ singlestoredb/fusion/handlers/utils.py,sha256=oYbf13Y3orEkJfHMNnO7B_W1anEdK-0S9vVVkF2pPFk,5109
28
+ singlestoredb/fusion/handlers/workspace.py,sha256=hHE6ZTrt3wWnQsTMkEiiWWFiQend4VNTebX382Ot5FI,11342
29
+ singlestoredb/http/__init__.py,sha256=A_2ZUCCpvRYIA6YDpPy57wL5R1eZ5SfP6I1To5nfJ2s,912
30
+ singlestoredb/http/connection.py,sha256=YcUfY_GzpSz-XYTkVQCayct9eQvwhscwVfStLbNry_U,37410
31
+ singlestoredb/management/__init__.py,sha256=jXtKvpvl5diiotXPiEi2EpJwhPLEMb4_MTpndjCz3Kg,202
32
+ singlestoredb/management/billing_usage.py,sha256=9ighjIpcopgIyJOktBYQ6pahBZmWGHOPyyCW4gu9FGs,3735
33
+ singlestoredb/management/cluster.py,sha256=_TT4tV43VPDrtcdS_VN-TTYij7yFQzjAMeuYRF9zKj8,14362
34
+ singlestoredb/management/manager.py,sha256=m8I5zTmEqjMCEE4fmmVdzza8TvofhnIHvO0np0WH-Y8,8810
35
+ singlestoredb/management/organization.py,sha256=Oj4-VQoEc90hLQ9vxXu4fSrGWK_Qq5lftmkM1Q5l6lk,4916
36
+ singlestoredb/management/region.py,sha256=HnLcWUh7r_aLECliplCDHak4a_F3B7LOSXEYMW66qD0,1611
37
+ singlestoredb/management/utils.py,sha256=ZFt1jaUwNij16UplNxK_kvvd-w54OunsBaGHojqqUn8,8329
38
+ singlestoredb/management/workspace.py,sha256=xIdSA_X8aiLnCZjNJg8-xYZeVyVeL1i4sVJUx-zMG_g,51907
39
+ singlestoredb/mysql/__init__.py,sha256=olUTAvkiERhDW41JXQMawkg-i0tvBEkoTkII1tt6lxU,4492
40
+ singlestoredb/mysql/_auth.py,sha256=AugRitoUwgRIDFuJxuAH4MWIAmckY7Ji2pP6r_Ng9dY,8043
41
+ singlestoredb/mysql/charset.py,sha256=-FlONDS_oAUF5B3mIgeHBPb_SCt4zHD33arUeBNctU0,10510
42
+ singlestoredb/mysql/connection.py,sha256=VzVZTSRdRcJ521rkFeZVmeYPkV_LDxLjDrxEJ6fHZhg,64746
43
+ singlestoredb/mysql/converters.py,sha256=CVe8SDmjbIAhy1xpQ2N5OKWw6t5eWpw-EU3QTlA0Hh0,7500
44
+ singlestoredb/mysql/cursors.py,sha256=aWs4AzmeZJJltOmUU3GZNBWgod9nqnnFW5OHVquz5t0,21246
45
+ singlestoredb/mysql/err.py,sha256=-m5rqXi8yhq6b8SCEJ2h0E5Rudh_15dlAU_WbJ1YrM8,2388
46
+ singlestoredb/mysql/optionfile.py,sha256=DqL-rOQcqQncD5eVbPRkwZqo7Pj3Vh40VLx3E_e87TU,655
47
+ singlestoredb/mysql/protocol.py,sha256=mPkF1xfSbqoW2dr8Tk4MpOKXRs_5Qj6xGFWSxo-AwhA,12180
48
+ singlestoredb/mysql/times.py,sha256=2j7purNVnJmjhOUgwUze-r3kNlCWqxjXj-jtqOzBfZI,463
49
+ singlestoredb/mysql/constants/CLIENT.py,sha256=SSvMFPZCTVMU1UWa4zOrfhYMDdR2wG2mS0E5GzJhDsg,878
50
+ singlestoredb/mysql/constants/COMMAND.py,sha256=TGITAUcNWlq2Gwg2wv5UK2ykdTd4LYTk_EcJJOCpGIc,679
51
+ singlestoredb/mysql/constants/CR.py,sha256=z3Oa86nHVDgWcz_XYFOzkfvvfkZmEoNluzpbNOJxjKg,2305
52
+ singlestoredb/mysql/constants/ER.py,sha256=cH5wgU-e70wd0uSygNR5IFCnnXcrR9WLwJPMH22bhUw,12296
53
+ singlestoredb/mysql/constants/FIELD_TYPE.py,sha256=OU0MQ_NtfLEFG5Jy0Oay7rhhlkfGldyzxjf1rGaSN2M,382
54
+ singlestoredb/mysql/constants/FLAG.py,sha256=Fy-PrCLnUI7fx_o5WypYnUAzWAM0E9d5yL8fFRVKffY,214
55
+ singlestoredb/mysql/constants/SERVER_STATUS.py,sha256=m28Iq5JGCFCWLhafE73-iOvw_9gDGqnytW3NkHpbugA,333
56
+ singlestoredb/mysql/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
+ singlestoredb/mysql/tests/__init__.py,sha256=JFzNFYLRD6dxD9ZvGgGIZOWPMYKW8b4tywBsb_I51J4,997
58
+ singlestoredb/mysql/tests/base.py,sha256=sv_VpPrJDvCt2QRlikG6_YWU3yJX3KEkdc96YRXGvEI,4025
59
+ singlestoredb/mysql/tests/conftest.py,sha256=vWjt2DEnzwlXuOBbz3p_EZXXDopucKGXHsPPPmCAmms,1117
60
+ singlestoredb/mysql/tests/test_DictCursor.py,sha256=oxn_q4DJTT6XqByCzKt0zQYw24_k768_8YJhpYUkDmE,4878
61
+ singlestoredb/mysql/tests/test_SSCursor.py,sha256=1IySbqn6a-1Wt7S04HxO3mUZstVmKIuy0vF8B0ZT06I,4306
62
+ singlestoredb/mysql/tests/test_basic.py,sha256=MsOP0zCvH9Kx1F1guLG4Iiir5ePD-3In_PCNyAJp1Cc,15465
63
+ singlestoredb/mysql/tests/test_connection.py,sha256=MRS4mU9pO4-Ga2GYWRdo640CHH7PTZtucdqB278Srlg,32297
64
+ singlestoredb/mysql/tests/test_converters.py,sha256=lNxgzbkfhw55mYFwSczUJeJHOsY-jXSqjeihdEQuV0w,2002
65
+ singlestoredb/mysql/tests/test_cursor.py,sha256=1OGzKzf7UCcF96X2XN8GnB9xIiUVyXn4GOuzW7hp6Cw,5045
66
+ singlestoredb/mysql/tests/test_err.py,sha256=nxMjsP9aCHT58aIPIrFyPveo2UZaHMYz4voDgY4Wnr0,422
67
+ singlestoredb/mysql/tests/test_issues.py,sha256=Rv0IJaYQu_u88O_pgURpT6V8Eo-cMitjpV59hT9EKrI,18965
68
+ singlestoredb/mysql/tests/test_load_local.py,sha256=EVz1O9LDR31GrvU97eEpBddHaTUhX-zifdUvgCFuICE,2502
69
+ singlestoredb/mysql/tests/test_nextset.py,sha256=CdiCOeZI5a_pdnjMmnQaJLCqUoXeugFj0IhOkJ_LLTA,2725
70
+ singlestoredb/mysql/tests/test_optionfile.py,sha256=eb2WaNzKKu7TjpRmWBAgjv8yXJptyGH964H1Uhuy-U4,585
71
+ singlestoredb/mysql/tests/thirdparty/__init__.py,sha256=M1hysF-gCD33Q8msVNoTDYJ8Lq3xyOlxXe3dUwPySjg,117
72
+ singlestoredb/mysql/tests/thirdparty/test_MySQLdb/__init__.py,sha256=bG2vIeDuGH568xEQjM_YTvnJNgOLB9ofLmwfrBmicQc,307
73
+ singlestoredb/mysql/tests/thirdparty/test_MySQLdb/capabilities.py,sha256=AgEdvx7Njz_Y7KDMeQPMYI7y4nJRKblocVrC0VxVZZE,10171
74
+ singlestoredb/mysql/tests/thirdparty/test_MySQLdb/dbapi20.py,sha256=E5_jnyZEZ7_mZw_P4EAzxMSSgvU8DXpp1kTM_kubdbs,31414
75
+ singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_capabilities.py,sha256=szE4Zodgf7YwhkMBOrCvUwhTWppVtaodsqlV-vJ7fmY,3090
76
+ singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_dbapi20.py,sha256=t_OzqsVnj_ReBbmY_wx51ZcWbLz9nASZ0hno-9YeiyQ,8022
77
+ singlestoredb/mysql/tests/thirdparty/test_MySQLdb/test_MySQLdb_nonstandard.py,sha256=pl0bvuZo_nzAlYOINxRiR-Zi9khz0W2Pc7vP-K3sQYQ,2819
78
+ singlestoredb/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
79
+ singlestoredb/tests/empty.sql,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
+ singlestoredb/tests/local_infile.csv,sha256=sBtqjvfkS9aoOVx8nMXYgYv4rDuT4OuYhqUhNRu0O68,42
81
+ singlestoredb/tests/test.sql,sha256=zuckJJgKI8cjIkM03WC67hCTk75TSJYVNA3x9VLQWH4,9954
82
+ singlestoredb/tests/test2.sql,sha256=D4U2GSlOVeo39U8-RMM4YziJzYFfi4Ztm2YXJVJVAS8,37
83
+ singlestoredb/tests/test_basics.py,sha256=rUfUGZ54xybvgp11XYWdqnUYMKa6VckB3XkX9LFnxRw,44180
84
+ singlestoredb/tests/test_config.py,sha256=63lyIQ2KrvGE6C9403B_4Mc90mX4tp42ys5Bih2sXrE,11184
85
+ singlestoredb/tests/test_connection.py,sha256=RiE_NATLYPiMR5jWaBlcP5YddwitS6dzOHOVVOVXCSI,50741
86
+ singlestoredb/tests/test_dbapi.py,sha256=IKq5Hcwx8WikASP8_AB5fo3TXv7ryWPCVGonoly00gI,652
87
+ singlestoredb/tests/test_exceptions.py,sha256=tfr_8X2w1UmG4nkSBzWGB0C7ehrf1GAVgj6_ODaG-TM,1131
88
+ singlestoredb/tests/test_ext_func.py,sha256=Q-ZOl7fn6XfiHpHgxLvaBi7KSVzIehbS-cthitXpe8g,37347
89
+ singlestoredb/tests/test_ext_func_data.py,sha256=9Zb0Z1v-Yr0uOc97NJwPWuvJB49pLhzWKZtZWt-e7-Y,47693
90
+ singlestoredb/tests/test_fusion.py,sha256=UPaxXt5YNa3GS44l4oZfmUcq89YgN7EWWIbW_oCkYao,15100
91
+ singlestoredb/tests/test_http.py,sha256=RXasTqBWRn__omj0eLFTJYIbZjd0PPdIV2d4Cqz0MC8,8580
92
+ singlestoredb/tests/test_management.py,sha256=P5I50_gt1VE5ja4CNVo0j10fmwAqE57psxCvI_RWRFI,28223
93
+ singlestoredb/tests/test_plugin.py,sha256=qpO9wmWc62VaijN1sJ97YSYIX7I7Y5C6sY-WzwrutDQ,812
94
+ singlestoredb/tests/test_results.py,sha256=wg93sujwt-R9_eJCgSCElgAZhLDkIiAo3qPkPydOv78,6582
95
+ singlestoredb/tests/test_types.py,sha256=jqoAaSjhbgwB3vt0KsTcl7XBWoMMIa0mPFKhEi5bBjo,4500
96
+ singlestoredb/tests/test_udf.py,sha256=2Ml6VMTKIfstB-L31uX-zftwPsT5C64M29WZ6iuKdjI,28075
97
+ singlestoredb/tests/test_xdict.py,sha256=fqHspoi39nbX3fIDVkkRXcd5H50xdOsSvK0bxAMQnaE,10408
98
+ singlestoredb/tests/utils.py,sha256=76eNdYFVnsw6S3J_RaGgGQ87Rlm8pxwyYaFYXnvAEvk,4673
99
+ singlestoredb/tests/ext_funcs/__init__.py,sha256=qZLnDI_Ck0tguVi-K-BKXDHAcC0jui3dsm93Djj4x08,9290
100
+ singlestoredb/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
101
+ singlestoredb/utils/config.py,sha256=m3Xn6hsbdKyLufSnbokhFJ9Vfaz9Qpkj1IEnIiH9oJQ,24503
102
+ singlestoredb/utils/convert_rows.py,sha256=A6up7a8Bq-eV2BXdGCotQviqp1Q7XdJ2MA9339hLYVQ,1816
103
+ singlestoredb/utils/debug.py,sha256=0JiLA37u_9CKiDGiN9BK_PtFMUku3vIcNjERWaTNRSU,349
104
+ singlestoredb/utils/mogrify.py,sha256=-a56IF70U6CkfadeaZgfjRSVsAD3PuqRrzPpjZlgbwY,4050
105
+ singlestoredb/utils/results.py,sha256=cqFK4-0CBSDcT-R1ixKIWN5_sCn9s9SoEO6Gllj8mCI,5204
106
+ singlestoredb/utils/xdict.py,sha256=S9HKgrPrnu_6b7iOwa2KrW8CmU1Uqx0BWdEyogFzWbE,12896
107
+ singlestoredb-1.0.3.dist-info/LICENSE,sha256=Mlq78idURT-9G026aMYswwwnnrLcgzTLuXeAs5hjDLM,11341
108
+ singlestoredb-1.0.3.dist-info/METADATA,sha256=D-7UBUyQmH38miNEnUpaWgLmzIdEP-1uxhXxC8LJki8,5515
109
+ singlestoredb-1.0.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
110
+ singlestoredb-1.0.3.dist-info/entry_points.txt,sha256=bSLaTWB5zGjpVYPAaI46MkkDup0su-eb3uAhCNYuRV0,48
111
+ singlestoredb-1.0.3.dist-info/top_level.txt,sha256=eet8bVPNRqiGeY0PrO5ERH2UpamwlrKHEQCffz4dOh8,14
112
+ singlestoredb-1.0.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,2 @@
1
+ [pytest11]
2
+ singlestoredb = singlestoredb.pytest
@@ -1,46 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import re
4
- from typing import Any
5
- from typing import Dict
6
-
7
- from . import base
8
- from .cymysql import CyMySQLDriver
9
- from .http import HTTPDriver
10
- from .http import HTTPSDriver
11
- from .mariadb import MariaDBDriver
12
- from .mysqlconnector import MySQLConnectorDriver
13
- from .mysqldb import MySQLdbDriver
14
- from .pymysql import PyMySQLDriver
15
- from .pyodbc import PyODBCDriver
16
-
17
-
18
- def get_driver(name: str, params: Dict[str, Any]) -> base.Driver:
19
- """
20
- Return the driver with the given name.
21
-
22
- Parameters
23
- ----------
24
- name : str
25
- Name of the driver. All non-letters/digits will be removed
26
- from the name when matching. For example, 'mysqlconnector'
27
- will match 'mysql.connector' or 'mysqlconnector'. Matches
28
- are also case-insensitive.
29
- params : dict
30
- Dictionary of connection parameters
31
-
32
- Returns
33
- -------
34
- Driver
35
-
36
- """
37
- rm_symbols = re.compile(r'[^A-Z0-9]', flags=re.I)
38
- new_name = rm_symbols.sub(r'', name).lower()
39
- for item in globals().values():
40
- if type(item) is not type:
41
- continue
42
- if not issubclass(item, base.Driver):
43
- continue
44
- if new_name == rm_symbols.sub(r'', item.name.lower()):
45
- return item(**params)
46
- raise RuntimeError("Could not locate driver with name '{}'".format(name))
@@ -1,200 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import sys
4
- from typing import Any
5
- from typing import Callable
6
- from typing import Dict
7
- from typing import Optional
8
-
9
- from .. import exceptions
10
-
11
-
12
- def wrap_converter(
13
- outer: Optional[Callable[[Any], Any]],
14
- conv: Optional[Callable[[Any], Any]],
15
- ) -> Optional[Callable[[Any], Any]]:
16
- """Create a pipeline from two functions."""
17
- if outer is None:
18
- return conv
19
-
20
- if conv is None:
21
- return outer
22
-
23
- def converter(value: Any) -> Any:
24
- return outer(conv(value)) # type: ignore
25
-
26
- return converter
27
-
28
-
29
- class Driver(object):
30
- """Base driver class."""
31
-
32
- # Name of driver used in connections
33
- name: str = ''
34
-
35
- # Name of package to import
36
- pkg_name: str = ''
37
-
38
- # Name of the package on PyPI.org
39
- pypi: str = ''
40
-
41
- # Name of the package on Anaconda.org
42
- anaconda: str = ''
43
-
44
- # Does the driver return bytes for all data values?
45
- # If true and flags are available in the description to deterimine
46
- # if a character field is text or binary, the text will be automatically
47
- # decoded before conversion functions are run.
48
- returns_bytes: bool = False
49
-
50
- def __init__(self, **kwargs: Any):
51
- self._params = kwargs
52
-
53
- # These converters get applied after the driver does its own
54
- # conversions. This allows each driver to decide which conversions
55
- # get handled internally and which get applied by this framework.
56
- self.converters: Dict[int, Callable[[Any], Any]] = {}
57
-
58
- def connect(self) -> Any:
59
- """Create a new connection."""
60
- params = {
61
- k: v for k, v in self.remap_params(self._params).items() if v is not None
62
- }
63
- conn = self.dbapi.connect(**params)
64
- self.after_connect(conn, self._params)
65
- return conn
66
-
67
- def merge_converters(
68
- self,
69
- user_converters: Dict[int, Callable[[Any], Any]],
70
- driver_converters: Dict[int, Callable[[Any], Any]],
71
- ) -> Dict[int, Callable[[Any], Any]]:
72
- """Merge two sets of converters into pipelines as needed."""
73
- out = dict(driver_converters)
74
- for key, value in user_converters.items():
75
- func = wrap_converter(value, out.get(key))
76
- if func is not None:
77
- out[key] = func
78
- return out
79
-
80
- def after_connect(self, conn: Any, params: Dict[str, Any]) -> None:
81
- """
82
- Callback for immediately after making a connection.
83
-
84
- Parameters
85
- ----------
86
- conn : Connection
87
- Connection object
88
- params : dict
89
- Original connection parameters
90
-
91
- """
92
- return
93
-
94
- def is_connected(self, conn: Any, reconnect: bool = False) -> bool:
95
- """
96
- Determine if the server is still connected.
97
-
98
- Parameters
99
- ----------
100
- conn : Connection
101
- Connection object to test
102
- reconnect : bool, optional
103
- If the server is not connected, should a reconnection be attempted?
104
-
105
- Returns
106
- -------
107
- bool
108
-
109
- """
110
- raise NotImplementedError
111
-
112
- def remap_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
113
- """
114
- Map generalized parameters to package-specific parameters.
115
-
116
- Parameters
117
- ----------
118
- params : dict
119
- Dictionary of connection parameters.
120
-
121
- Returns
122
- -------
123
- dict
124
-
125
- """
126
- return params
127
-
128
- def convert_exception(self, exc: Exception) -> Exception:
129
- """Convert driver-specific exception to SingleStoreDB exception."""
130
- dbapi = self.dbapi
131
- if not isinstance(exc, (dbapi.Error, dbapi.Warning)):
132
- return exc
133
- new_exc: Optional[type] = None
134
- if isinstance(exc, dbapi.NotSupportedError):
135
- new_exc = exceptions.NotSupportedError
136
- elif isinstance(exc, dbapi.ProgrammingError):
137
- new_exc = exceptions.ProgrammingError
138
- elif isinstance(exc, dbapi.InternalError):
139
- new_exc = exceptions.InternalError
140
- elif isinstance(exc, dbapi.IntegrityError):
141
- new_exc = exceptions.IntegrityError
142
- elif isinstance(exc, dbapi.OperationalError):
143
- new_exc = exceptions.OperationalError
144
- elif isinstance(exc, dbapi.DataError):
145
- new_exc = exceptions.DataError
146
- elif isinstance(exc, dbapi.DatabaseError):
147
- new_exc = exceptions.DatabaseError
148
- elif isinstance(exc, dbapi.InterfaceError):
149
- new_exc = exceptions.InterfaceError
150
- elif isinstance(exc, dbapi.Error):
151
- new_exc = exceptions.Error
152
- elif isinstance(exc, dbapi.Warning):
153
- new_exc = exceptions.Warning
154
- if new_exc is None:
155
- return exc
156
-
157
- # Check for exceptions with errno / msg first
158
- errno = getattr(exc, 'errno', None)
159
- msg = getattr(exc, 'msg', None)
160
- if msg:
161
- return new_exc(
162
- errno=errno, msg=msg,
163
- sqlstate=getattr(exc, 'sqlstate', None),
164
- )
165
-
166
- # Check for exceptions with just args
167
- args = getattr(exc, 'args', [])
168
- if len(args) > 1:
169
- return new_exc(args[0], args[1])
170
- if len(args):
171
- return new_exc(args[0])
172
-
173
- # Don't know what type it is
174
- raise ValueError(f'Unrecognized exception format: {exc}')
175
-
176
- @property
177
- def dbapi(self) -> Any:
178
- """Return imported DB-API-compatible module."""
179
- if not type(self).pkg_name:
180
- raise ValueError('No package name defined in driver.')
181
- try:
182
- return __import__(type(self).pkg_name, {}, {}, ['connect'])
183
- except ModuleNotFoundError:
184
- msg = []
185
- msg.append('{} is not available.'.format(type(self).pkg_name))
186
- msg.append(" Use 'pip install {}'".format(type(self).pypi))
187
- if type(self).anaconda:
188
- if '::' in type(self).anaconda:
189
- msg.append(
190
- " or 'conda install -c {} {}' (for Anaconda)"
191
- .format(*type(self).anaconda.split('::', 1)),
192
- )
193
- else:
194
- msg.append(
195
- " or 'conda install {}' (for Anaconda)"
196
- .format(type(self).anaconda),
197
- )
198
- msg.append(' to install it.')
199
- print(''.join(msg), file=sys.stderr)
200
- raise
@@ -1,40 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import Any
4
- from typing import Dict
5
-
6
- try:
7
- from cymysql.converters import encoders
8
- except ImportError:
9
- encoders = {}
10
-
11
- from .base import Driver
12
- from ..converters import converters
13
-
14
-
15
- converters = dict(converters)
16
- converters.update(encoders)
17
-
18
-
19
- class CyMySQLDriver(Driver):
20
-
21
- name = 'CyMySQL'
22
-
23
- pkg_name = 'cymysql'
24
- pypi = 'cymysql'
25
- anaconda = 'cymysql'
26
-
27
- def remap_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
28
- params.pop('driver', None)
29
- params.pop('pure_python', None)
30
- params.pop('odbc_driver', None)
31
- params.pop('credential_type', None)
32
- params['port'] = params['port'] or 3306
33
- params['db'] = params.pop('database', None)
34
- params['passwd'] = params.pop('password', None)
35
- params['conv'] = self.merge_converters(params.pop('converters', {}), converters)
36
- params['ssl'] = dict(cipher=params.pop('ssl_cipher'))
37
- return params
38
-
39
- def is_connected(self, conn: Any, reconnect: bool = False) -> bool:
40
- return conn.ping(reconnect=reconnect)
@@ -1,49 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import warnings
4
- from typing import Any
5
- from typing import Dict
6
-
7
- from .base import Driver
8
-
9
-
10
- class HTTPDriver(Driver):
11
-
12
- name = 'http'
13
-
14
- pkg_name = 'singlestoredb.http'
15
- pypi = 'singlestoredb'
16
- anaconda = 'singlestore::singlestoredb'
17
-
18
- def remap_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
19
- params.pop('pure_python', False)
20
- params.pop('charset', None)
21
- params.pop('odbc_driver', None)
22
- params.pop('credential_type', None)
23
- params.pop('autocommit', None)
24
- params.pop('ssl_cipher', None)
25
-
26
- params['protocol'] = params.pop('driver', '').replace(
27
- 'singlestoredb+', '',
28
- ) or None
29
-
30
- if params.pop('local_infile', False):
31
- warnings.warn('The HTTP driver does not support file uploads.')
32
-
33
- if params['port'] is None:
34
- if type(self).name == 'https':
35
- params['port'] = 443
36
- else:
37
- params['port'] = 80
38
-
39
- self.converters = params.pop('converters', {})
40
-
41
- return params
42
-
43
- def is_connected(self, conn: Any, reconnect: bool = False) -> bool:
44
- return conn.is_connected()
45
-
46
-
47
- class HTTPSDriver(HTTPDriver):
48
-
49
- name = 'https'
@@ -1,42 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import json
4
- from typing import Any
5
- from typing import Dict
6
-
7
- from .base import Driver
8
-
9
-
10
- converters = {245: json.loads}
11
-
12
-
13
- class MariaDBDriver(Driver):
14
-
15
- name = 'mariadb'
16
-
17
- pkg_name = 'mariadb'
18
- pypi = 'mariadb-connector-python'
19
- anaconda = 'mariadb-connector-python'
20
-
21
- def remap_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
22
- params.pop('driver', None)
23
- params.pop('charset', None)
24
- params.pop('odbc_driver', None)
25
- params.pop('pure_python', None)
26
- params.pop('credential_type', None)
27
- params['converter'] = self.merge_converters(
28
- params.pop('converters', {}),
29
- dict(converters),
30
- )
31
- if params.pop('ssl_disabled', False):
32
- params['ssl'] = False
33
- params['ssl_verify_cert'] = False
34
-
35
- return params
36
-
37
- def is_connected(self, conn: Any, reconnect: bool = False) -> bool:
38
- try:
39
- conn.ping()
40
- return True
41
- except conn.InterfaceError:
42
- return False
@@ -1,51 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import Any
4
- from typing import Dict
5
-
6
- from .. import auth
7
- from ..converters import converters
8
- from .base import Driver
9
-
10
-
11
- class MySQLConnectorDriver(Driver):
12
-
13
- name = 'mysqlconnector'
14
-
15
- pkg_name = 'mysql.connector'
16
- pypi = 'mysql-connector-python'
17
- anaconda = 'mysql-connector-python'
18
-
19
- # This flag lets the connection do the decoding of text / binary accordingly
20
- returns_bytes = True
21
-
22
- def remap_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
23
- params.pop('driver', None)
24
- params.pop('odbc_driver', None)
25
- params.pop('ssl_cipher', None)
26
- if params.pop('pure_python', False):
27
- params['use_pure'] = True
28
- params['port'] = params['port'] or 3306
29
- params['allow_local_infile'] = params.pop('local_infile')
30
-
31
- # Always use raw, we're doing the conversions ourselves
32
- params['raw'] = True
33
-
34
- convs = params.pop('converters', {})
35
- self.converters = self.merge_converters(convs, converters)
36
-
37
- # Check authentication method
38
- cred = params.pop('credential_type', None)
39
- if cred in [auth.BROWSER_SSO, auth.JWT] and not params.get('use_pure', False):
40
- # params['auth_plugin'] = 'mysql_clear_password'
41
- params['ssl_verify_identity'] = True
42
- params['ssl_verify_cert'] = True
43
-
44
- return params
45
-
46
- def is_connected(self, conn: Any, reconnect: bool = False) -> bool:
47
- try:
48
- conn.ping(reconnect=reconnect)
49
- return True
50
- except conn.InterfaceError:
51
- return False
@@ -1,62 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import Any
4
- from typing import Dict
5
-
6
- from ..converters import converters
7
- from .base import Driver
8
-
9
-
10
- class MySQLdbDriver(Driver):
11
-
12
- name = 'MySQLdb'
13
-
14
- pkg_name = 'MySQLdb'
15
- pypi = 'mysqlclient'
16
- anaconda = 'mysqlclient'
17
-
18
- def remap_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
19
- params.pop('driver', None)
20
- params.pop('pure_python', None)
21
- params.pop('odbc_driver', None)
22
- params.pop('credential_type', None)
23
-
24
- params['conv'] = dict(converters)
25
-
26
- ssl = dict()
27
-
28
- if params.get('ssl_key', None):
29
- ssl['key'] = params.get('ssl_key')
30
- if params.get('ssl_cert', None):
31
- ssl['cert'] = params.get('ssl_cert')
32
- if params.get('ssl_ca', None):
33
- ssl['ca'] = params.get('ssl_ca')
34
- if params.get('ssl_cipher', None):
35
- ssl['cipher'] = params.get('ssl_cipher')
36
-
37
- params.pop('ssl_key', None)
38
- params.pop('ssl_cert', None)
39
- params.pop('ssl_ca', None)
40
- params.pop('ssl_cipher', None)
41
-
42
- if ssl:
43
- params['ssl'] = dict(ssl=ssl)
44
-
45
- if params.pop('ssl_disabled', False):
46
- params['ssl_mode'] = 'DISABLED'
47
-
48
- self.converters = params.pop('converters', {})
49
-
50
- return params
51
-
52
- def after_connect(self, conn: Any, params: Dict[str, Any]) -> None:
53
- # This must be done afterward because use_unicode= whacks the
54
- # json converter if you try to put it in earlier.
55
- conn.converter[245] = converters[245]
56
-
57
- def is_connected(self, conn: Any, reconnect: bool = False) -> bool:
58
- try:
59
- conn.ping(reconnect)
60
- return True
61
- except conn.InterfaceError:
62
- return False
@@ -1,39 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import Any
4
- from typing import Callable
5
- from typing import Dict
6
-
7
- try:
8
- from pymysql.converters import encoders
9
- except ImportError:
10
- encoders = {}
11
-
12
- from .base import Driver
13
- from ..converters import converters as convs
14
-
15
- converters: Dict[Any, Callable[..., Any]] = dict(convs)
16
- converters.update(encoders)
17
-
18
-
19
- class PyMySQLDriver(Driver):
20
-
21
- name = 'PyMySQL'
22
-
23
- pkg_name = 'pymysql'
24
- pypi = 'pymysql'
25
- anaconda = 'pymysql'
26
-
27
- def remap_params(self, params: Dict[str, Any]) -> Dict[str, Any]:
28
- params.pop('driver', None)
29
- params.pop('odbc_driver', None)
30
- params.pop('pure_python', None)
31
- params.pop('credential_type', None)
32
- # The cipher must be set to this level for SingleStoreDB Cloud.
33
- params['ssl'] = dict(cipher=params.pop('ssl_cipher'))
34
- params['port'] = params['port'] or 3306
35
- params['conv'] = self.merge_converters(params.pop('converters', {}), converters)
36
- return params
37
-
38
- def is_connected(self, conn: Any, reconnect: bool = False) -> bool:
39
- return conn.open