singlestoredb 1.0.4__py3-none-any.whl → 1.2.0__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 (40) hide show
  1. singlestoredb/__init__.py +1 -1
  2. singlestoredb/config.py +131 -0
  3. singlestoredb/connection.py +3 -0
  4. singlestoredb/converters.py +390 -0
  5. singlestoredb/functions/dtypes.py +5 -198
  6. singlestoredb/functions/ext/__init__.py +0 -1
  7. singlestoredb/functions/ext/asgi.py +671 -153
  8. singlestoredb/functions/ext/json.py +2 -2
  9. singlestoredb/functions/ext/mmap.py +174 -67
  10. singlestoredb/functions/ext/rowdat_1.py +2 -2
  11. singlestoredb/functions/ext/utils.py +169 -0
  12. singlestoredb/fusion/handler.py +115 -9
  13. singlestoredb/fusion/handlers/stage.py +246 -13
  14. singlestoredb/fusion/handlers/workspace.py +417 -14
  15. singlestoredb/fusion/registry.py +86 -1
  16. singlestoredb/http/connection.py +40 -2
  17. singlestoredb/management/__init__.py +1 -0
  18. singlestoredb/management/organization.py +4 -0
  19. singlestoredb/management/utils.py +2 -2
  20. singlestoredb/management/workspace.py +79 -6
  21. singlestoredb/mysql/connection.py +81 -0
  22. singlestoredb/mysql/constants/EXTENDED_TYPE.py +3 -0
  23. singlestoredb/mysql/constants/FIELD_TYPE.py +16 -0
  24. singlestoredb/mysql/constants/VECTOR_TYPE.py +6 -0
  25. singlestoredb/mysql/cursors.py +177 -4
  26. singlestoredb/mysql/protocol.py +50 -1
  27. singlestoredb/notebook/__init__.py +15 -0
  28. singlestoredb/notebook/_objects.py +212 -0
  29. singlestoredb/tests/test.sql +259 -0
  30. singlestoredb/tests/test_connection.py +1715 -133
  31. singlestoredb/tests/test_ext_func.py +2 -2
  32. singlestoredb/tests/test_ext_func_data.py +1 -1
  33. singlestoredb/utils/dtypes.py +205 -0
  34. singlestoredb/utils/results.py +367 -14
  35. {singlestoredb-1.0.4.dist-info → singlestoredb-1.2.0.dist-info}/METADATA +2 -1
  36. {singlestoredb-1.0.4.dist-info → singlestoredb-1.2.0.dist-info}/RECORD +40 -34
  37. {singlestoredb-1.0.4.dist-info → singlestoredb-1.2.0.dist-info}/LICENSE +0 -0
  38. {singlestoredb-1.0.4.dist-info → singlestoredb-1.2.0.dist-info}/WHEEL +0 -0
  39. {singlestoredb-1.0.4.dist-info → singlestoredb-1.2.0.dist-info}/entry_points.txt +0 -0
  40. {singlestoredb-1.0.4.dist-info → singlestoredb-1.2.0.dist-info}/top_level.txt +0 -0
@@ -363,6 +363,216 @@ INSERT INTO alltypes SET
363
363
  ;
364
364
 
365
365
 
366
+ CREATE TABLE IF NOT EXISTS alltypes_no_nulls (
367
+ `id` INT(11) NOT NULL,
368
+ `tinyint` TINYINT NOT NULL,
369
+ `unsigned_tinyint` TINYINT UNSIGNED NOT NULL,
370
+ `bool` BOOL NOT NULL,
371
+ `boolean` BOOLEAN NOT NULL,
372
+ `smallint` SMALLINT NOT NULL,
373
+ `unsigned_smallint` SMALLINT UNSIGNED NOT NULL,
374
+ `mediumint` MEDIUMINT NOT NULL,
375
+ `unsigned_mediumint` MEDIUMINT UNSIGNED NOT NULL,
376
+ `int24` MEDIUMINT NOT NULL,
377
+ `unsigned_int24` MEDIUMINT UNSIGNED NOT NULL,
378
+ `int` INT NOT NULL,
379
+ `unsigned_int` INT UNSIGNED NOT NULL,
380
+ `integer` INTEGER NOT NULL,
381
+ `unsigned_integer` INTEGER UNSIGNED NOT NULL,
382
+ `bigint` BIGINT NOT NULL,
383
+ `unsigned_bigint` BIGINT UNSIGNED NOT NULL,
384
+ `float` FLOAT NOT NULL,
385
+ `double` DOUBLE NOT NULL,
386
+ `real` REAL NOT NULL,
387
+ `decimal` DECIMAL(20,6) NOT NULL,
388
+ `dec` DEC(20,6) NOT NULL,
389
+ `fixed` FIXED(20,6) NOT NULL,
390
+ `numeric` NUMERIC(20,6) NOT NULL,
391
+ `date` DATE NOT NULL,
392
+ `time` TIME NOT NULL,
393
+ `time_6` TIME(6) NOT NULL,
394
+ `datetime` DATETIME NOT NULL,
395
+ `datetime_6` DATETIME(6) NOT NULL,
396
+ `timestamp` TIMESTAMP NOT NULL,
397
+ `timestamp_6` TIMESTAMP(6) NOT NULL,
398
+ `year` YEAR NOT NULL,
399
+ `char_100` CHAR(100) NOT NULL,
400
+ `binary_100` BINARY(100) NOT NULL,
401
+ `varchar_200` VARCHAR(200) NOT NULL,
402
+ `varbinary_200` VARBINARY(200) NOT NULL,
403
+ `longtext` LONGTEXT NOT NULL,
404
+ `mediumtext` MEDIUMTEXT NOT NULL,
405
+ `text` TEXT NOT NULL,
406
+ `tinytext` TINYTEXT NOT NULL,
407
+ `longblob` LONGBLOB NOT NULL,
408
+ `mediumblob` MEDIUMBLOB NOT NULL,
409
+ `blob` BLOB NOT NULL,
410
+ `tinyblob` TINYBLOB NOT NULL,
411
+ `json` JSON NOT NULL,
412
+ -- `geographypoint` GEOGRAPHYPOINT NOT NULL,
413
+ -- `geography` GEOGRAPHY NOT NULL,
414
+ `enum` ENUM('one', 'two', 'three') NOT NULL,
415
+ `set` SET('one', 'two', 'three') NOT NULL,
416
+ `bit` BIT NOT NULL
417
+ )
418
+ COLLATE='utf8_unicode_ci';
419
+
420
+ INSERT INTO alltypes_no_nulls SET
421
+ `id`=0,
422
+ `tinyint`=80,
423
+ `unsigned_tinyint`=85,
424
+ `bool`=0,
425
+ `boolean`=1,
426
+ `smallint`=-27897,
427
+ `unsigned_smallint`=27897,
428
+ `mediumint`=104729,
429
+ `unsigned_mediumint`=120999,
430
+ `int24`=-200899,
431
+ `unsigned_int24`=407709,
432
+ `int`=-1295369311,
433
+ `unsigned_int`=3872362332,
434
+ `integer`=-1741727421,
435
+ `unsigned_integer`=3198387363,
436
+ `bigint`=-266883847,
437
+ `unsigned_bigint`=980007287362,
438
+ `float`=-146486683.754744,
439
+ `double`=-474646154.719356,
440
+ `real`=-901409776.279346,
441
+ `decimal`=28111097.610822,
442
+ `dec`=389451155.931428,
443
+ `fixed`=-143773416.044092,
444
+ `numeric`=866689461.300046,
445
+ `date`='8524-11-10',
446
+ `time`='00:07:00',
447
+ `time_6`='01:10:00.000002',
448
+ `datetime`='9948-03-11 15:29:22',
449
+ `datetime_6`='1756-10-29 02:02:42.000008',
450
+ `timestamp`='1980-12-31 01:10:23',
451
+ `timestamp_6`='1991-01-02 22:15:10.000006',
452
+ `year`=1923,
453
+ `char_100`='This is a test of a 100 character column.',
454
+ `binary_100`=x'000102030405060708090A0B0C0D0E0F',
455
+ `varchar_200`='This is a test of a variable character column.',
456
+ `varbinary_200`=x'000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F',
457
+ `longtext`='This is a longtext column.',
458
+ `mediumtext`='This is a mediumtext column.',
459
+ `text`='This is a text column.',
460
+ `tinytext`='This is a tinytext column.',
461
+ `longblob`=x'000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F',
462
+ `mediumblob`=x'000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F',
463
+ `blob`=x'000102030405060708090A0B0C0D0E0F',
464
+ `tinyblob`=x'0A0B0C0D0E0F',
465
+ `json`='{"a": 10, "b": 2.75, "c": "hello world"}',
466
+ `enum`='one',
467
+ `set`='two',
468
+ `bit`=128
469
+ ;
470
+
471
+ -- Minimum values
472
+ INSERT INTO alltypes_no_nulls SET
473
+ `id`=2,
474
+ `tinyint`=-128,
475
+ `unsigned_tinyint`=0,
476
+ `bool`=-128,
477
+ `boolean`=-128,
478
+ `smallint`=-32768,
479
+ `unsigned_smallint`=0,
480
+ `mediumint`=-8388608,
481
+ `unsigned_mediumint`=0,
482
+ `int24`=-8388608,
483
+ `unsigned_int24`=0,
484
+ `int`=-2147483648,
485
+ `unsigned_int`=0,
486
+ `integer`=-2147483648,
487
+ `unsigned_integer`=0,
488
+ `bigint`=-9223372036854775808,
489
+ `unsigned_bigint`=0,
490
+ `float`=0,
491
+ `double`=-1.7976931348623158e308,
492
+ `real`=-1.7976931348623158e308,
493
+ `decimal`=-99999999999999.999999,
494
+ `dec`=-99999999999999.999999,
495
+ `fixed`=-99999999999999.999999,
496
+ `numeric`=-99999999999999.999999,
497
+ `date`='1000-01-01',
498
+ `time`='-838:59:59',
499
+ `time_6`='-838:59:59.000000',
500
+ `datetime`='1000-01-01 00:00:00',
501
+ `datetime_6`='1000-01-01 00:00:00.000000',
502
+ `timestamp`='1970-01-01 00:00:01',
503
+ `timestamp_6`='1970-01-01 00:00:01.000000',
504
+ `year`=1901,
505
+ `char_100`='',
506
+ `binary_100`=x'',
507
+ `varchar_200`='',
508
+ `varbinary_200`=x'',
509
+ `longtext`='',
510
+ `mediumtext`='',
511
+ `text`='',
512
+ `tinytext`='',
513
+ `longblob`=x'',
514
+ `mediumblob`=x'',
515
+ `blob`=x'',
516
+ `tinyblob`=x'',
517
+ `json`='{}',
518
+ `enum`='one',
519
+ `set`='two',
520
+ `bit`=0
521
+ ;
522
+
523
+ -- Maximum values
524
+ INSERT INTO alltypes_no_nulls SET
525
+ `id`=3,
526
+ `tinyint`=127,
527
+ `unsigned_tinyint`=255,
528
+ `bool`=127,
529
+ `boolean`=127,
530
+ `smallint`=32767,
531
+ `unsigned_smallint`=65535,
532
+ `mediumint`=8388607,
533
+ `unsigned_mediumint`=16777215,
534
+ `int24`=8388607,
535
+ `unsigned_int24`=16777215,
536
+ `int`=2147483647,
537
+ `unsigned_int`=4294967295,
538
+ `integer`=2147483647,
539
+ `unsigned_integer`=4294967295,
540
+ `bigint`=9223372036854775807,
541
+ `unsigned_bigint`=18446744073709551615,
542
+ `float`=0,
543
+ `double`=1.7976931348623158e308,
544
+ `real`=1.7976931348623158e308,
545
+ `decimal`=99999999999999.999999,
546
+ `dec`=99999999999999.999999,
547
+ `fixed`=99999999999999.999999,
548
+ `numeric`=99999999999999.999999,
549
+ `date`='9999-12-31',
550
+ `time`='838:59:59',
551
+ `time_6`='838:59:59.999999',
552
+ `datetime`='9999-12-31 23:59:59',
553
+ `datetime_6`='9999-12-31 23:59:59.999999',
554
+ `timestamp`='2038-01-18 21:14:07',
555
+ `timestamp_6`='2038-01-18 21:14:07.999999',
556
+ `year`=2155,
557
+ `char_100`='',
558
+ `binary_100`=x'',
559
+ `varchar_200`='',
560
+ `varbinary_200`=x'',
561
+ `longtext`='',
562
+ `mediumtext`='',
563
+ `text`='',
564
+ `tinytext`='',
565
+ `longblob`=x'',
566
+ `mediumblob`=x'',
567
+ `blob`=x'',
568
+ `tinyblob`=x'',
569
+ `json`='{}',
570
+ `enum`='one',
571
+ `set`='two',
572
+ `bit`=18446744073709551615
573
+ ;
574
+
575
+
366
576
  --
367
577
  -- Table of extended data types
368
578
  --
@@ -396,4 +606,53 @@ INSERT INTO `badutf8` VALUES ('🥷🧙👻.eth');
396
606
  INSERT INTO `badutf8` VALUES ('🥒rick.eth');
397
607
 
398
608
 
609
+ CREATE TABLE IF NOT EXISTS `f32_vectors` (
610
+ id INT(11),
611
+ a VECTOR(3)
612
+ );
613
+ INSERT INTO f32_vectors VALUES(1, '[0.267261237,0.534522474,0.801783681]');
614
+ INSERT INTO f32_vectors VALUES(2, '[0.371390671,0.557085991,0.742781341]');
615
+ INSERT INTO f32_vectors VALUES(3, '[-0.424264073,-0.565685451,0.707106829]');
616
+
617
+ CREATE TABLE IF NOT EXISTS `f64_vectors` (
618
+ id INT(11),
619
+ a VECTOR(3, F64)
620
+ );
621
+ INSERT INTO f64_vectors VALUES(1, '[0.267261237,0.534522474,0.801783681]');
622
+ INSERT INTO f64_vectors VALUES(2, '[0.371390671,0.557085991,0.742781341]');
623
+ INSERT INTO f64_vectors VALUES(3, '[-0.424264073,-0.565685451,0.707106829]');
624
+
625
+ CREATE TABLE `i8_vectors` (
626
+ id INT(11),
627
+ a VECTOR(3, I8)
628
+ );
629
+ INSERT INTO i8_vectors VALUES(1, '[1, 2, 3]');
630
+ INSERT INTO i8_vectors VALUES(2, '[4, 5, 6]');
631
+ INSERT INTO i8_vectors VALUES(3, '[-1, -4, 8]');
632
+
633
+ CREATE TABLE `i16_vectors` (
634
+ id INT(11),
635
+ a VECTOR(3, I16)
636
+ );
637
+ INSERT INTO i16_vectors VALUES(1, '[1, 2, 3]');
638
+ INSERT INTO i16_vectors VALUES(2, '[4, 5, 6]');
639
+ INSERT INTO i16_vectors VALUES(3, '[-1, -4, 8]');
640
+
641
+ CREATE TABLE `i32_vectors` (
642
+ id INT(11),
643
+ a VECTOR(3, I32)
644
+ );
645
+ INSERT INTO i32_vectors VALUES(1, '[1, 2, 3]');
646
+ INSERT INTO i32_vectors VALUES(2, '[4, 5, 6]');
647
+ INSERT INTO i32_vectors VALUES(3, '[-1, -4, 8]');
648
+
649
+ CREATE TABLE `i64_vectors` (
650
+ id INT(11),
651
+ a VECTOR(3, I64)
652
+ );
653
+ INSERT INTO i64_vectors VALUES(1, '[1, 2, 3]');
654
+ INSERT INTO i64_vectors VALUES(2, '[4, 5, 6]');
655
+ INSERT INTO i64_vectors VALUES(3, '[-1, -4, 8]');
656
+
657
+
399
658
  COMMIT;