mysqlengine 1.0.0__cp311-cp311-win_amd64.whl → 1.0.3__cp311-cp311-win_amd64.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 mysqlengine might be problematic. Click here for more details.

mysqlengine/dml.py CHANGED
@@ -2559,8 +2559,22 @@ class DML:
2559
2559
 
2560
2560
  :param args `<'list/tuple/DataFrame/Any'>`: The arguments for the placeholders in the statement. Defaults to `None`.
2561
2561
 
2562
- :param cursor `<'type[Cursor]/None'>`: The cursor type (class) to use. Defaults to `None` (use pool default).
2563
- Determines the data type of the fetched result set after executing the statement.
2562
+ Supports:
2563
+ - **Python built-ins**:
2564
+ int, float, bool, str, None, datetime, date, time,
2565
+ timedelta, struct_time, bytes, bytearray, memoryview,
2566
+ Decimal, dict, list, tuple, set, frozenset, range
2567
+ - **Library [numpy](https://github.com/numpy/numpy)**:
2568
+ np.int, np.uint, np.float, np.bool, np.bytes,
2569
+ np.str, np.datetime64, np.timedelta64, np.ndarray
2570
+ - **Library [pandas](https://github.com/pandas-dev/pandas)**:
2571
+ pd.Timestamp, pd.Timedelta, pd.DatetimeIndex,
2572
+ pd.TimedeltaIndex, pd.Series, pd.DataFrame
2573
+ - **Library [cytimes](https://github.com/AresJef/cyTimes)**:
2574
+ cytimes.Pydt, cytimes.Pddt
2575
+
2576
+ :param cursor `<'type[Cursor]/None'>`: The cursor class (type) to use. Defaults to `None` (use pool default).
2577
+ Determines the data type of the fetched result set.
2564
2578
  Also accepts:
2565
2579
  1. `tuple` => `Cursor`;
2566
2580
  2. `dict` => `DictCursor`;
@@ -2619,13 +2633,28 @@ class DML:
2619
2633
  fetch: cython.bint = True,
2620
2634
  many: cython.bint = False,
2621
2635
  conn: object | None = None,
2636
+ batch: cython.bint = False,
2622
2637
  ) -> object:
2623
2638
  """(internal) [async] Execute the DML statement.
2624
2639
 
2625
2640
  :param args `<'list/tuple/DataFrame/Any'>`: The arguments for the placeholders in the statement. Defaults to `None`.
2626
2641
 
2627
- :param cursor `<'type[Cursor]/None'>`: The cursor type (class) to use. Defaults to `None` (use pool default).
2628
- Determines the data type of the fetched result set after executing the statement.
2642
+ Supports:
2643
+ - **Python built-ins**:
2644
+ int, float, bool, str, None, datetime, date, time,
2645
+ timedelta, struct_time, bytes, bytearray, memoryview,
2646
+ Decimal, dict, list, tuple, set, frozenset, range
2647
+ - **Library [numpy](https://github.com/numpy/numpy)**:
2648
+ np.int, np.uint, np.float, np.bool, np.bytes,
2649
+ np.str, np.datetime64, np.timedelta64, np.ndarray
2650
+ - **Library [pandas](https://github.com/pandas-dev/pandas)**:
2651
+ pd.Timestamp, pd.Timedelta, pd.DatetimeIndex,
2652
+ pd.TimedeltaIndex, pd.Series, pd.DataFrame
2653
+ - **Library [cytimes](https://github.com/AresJef/cyTimes)**:
2654
+ cytimes.Pydt, cytimes.Pddt
2655
+
2656
+ :param cursor `<'type[Cursor]/None'>`: The cursor class (type) to use. Defaults to `None` (use pool default).
2657
+ Determines the data type of the fetched result set.
2629
2658
  Also accepts:
2630
2659
  1. `tuple` => `Cursor`;
2631
2660
  2. `dict` => `DictCursor`;
@@ -2642,6 +2671,9 @@ class DML:
2642
2671
  If 'conn=None', the statement will be executed by a (random) connection
2643
2672
  from the pool, and commit automatically after the statement execution.
2644
2673
 
2674
+ :param batch `<'bool'>`: Whether to execute the INSERT/REPLACE statement in batch mode. Defaults to `False`.
2675
+ Should only be `True` for INSERT/REPLACE ... VALUES ... statements.
2676
+
2645
2677
  :returns `<'tuple[tuple]/tuple[dict]/DataFrame/int'>`: The result set of the statement.
2646
2678
  Returns the number of affected rows `<'int'>` only when 'fetch=False'.
2647
2679
  """
@@ -2670,8 +2702,8 @@ class DML:
2670
2702
  )
2671
2703
 
2672
2704
  # Connection from pool
2673
- # . no arguments / single-row
2674
- if args is None or not many:
2705
+ # . no arguments / single-row / batch-insert
2706
+ if args is None or not many or batch:
2675
2707
  async with self._pool.acquire() as conn:
2676
2708
  if self._multi_table:
2677
2709
  await conn.select_database(self._db_name)
@@ -4313,8 +4345,22 @@ class SelectDML(DML):
4313
4345
 
4314
4346
  :param args `<'list/tuple/DataFrame/Any'>`: The arguments for the placeholders in the statement. Defaults to `None`.
4315
4347
 
4316
- :param cursor `<'type[Cursor]/None'>`: The cursor type (class) to use. Defaults to `None` (use pool default).
4317
- Determines the data type of the fetched result set after executing the statement.
4348
+ Supports:
4349
+ - **Python built-ins**:
4350
+ int, float, bool, str, None, datetime, date, time,
4351
+ timedelta, struct_time, bytes, bytearray, memoryview,
4352
+ Decimal, dict, list, tuple, set, frozenset, range
4353
+ - **Library [numpy](https://github.com/numpy/numpy)**:
4354
+ np.int, np.uint, np.float, np.bool, np.bytes,
4355
+ np.str, np.datetime64, np.timedelta64, np.ndarray
4356
+ - **Library [pandas](https://github.com/pandas-dev/pandas)**:
4357
+ pd.Timestamp, pd.Timedelta, pd.DatetimeIndex,
4358
+ pd.TimedeltaIndex, pd.Series, pd.DataFrame
4359
+ - **Library [cytimes](https://github.com/AresJef/cyTimes)**:
4360
+ cytimes.Pydt, cytimes.Pddt
4361
+
4362
+ :param cursor `<'type[Cursor]/None'>`: The cursor class (type) to use. Defaults to `None` (use pool default).
4363
+ Determines the data type of the fetched result set.
4318
4364
  Also accepts:
4319
4365
  1. `tuple` => `Cursor`;
4320
4366
  2. `dict` => `DictCursor`;
@@ -4382,8 +4428,22 @@ class SelectDML(DML):
4382
4428
 
4383
4429
  :param args `<'list/tuple/DataFrame/Any'>`: The arguments for the placeholders in the statement. Defaults to `None`.
4384
4430
 
4385
- :param cursor `<'type[Cursor]/None'>`: The cursor type (class) to use. Defaults to `None` (use pool default).
4386
- Determines the data type of the fetched result set after executing the statement.
4431
+ Supports:
4432
+ - **Python built-ins**:
4433
+ int, float, bool, str, None, datetime, date, time,
4434
+ timedelta, struct_time, bytes, bytearray, memoryview,
4435
+ Decimal, dict, list, tuple, set, frozenset, range
4436
+ - **Library [numpy](https://github.com/numpy/numpy)**:
4437
+ np.int, np.uint, np.float, np.bool, np.bytes,
4438
+ np.str, np.datetime64, np.timedelta64, np.ndarray
4439
+ - **Library [pandas](https://github.com/pandas-dev/pandas)**:
4440
+ pd.Timestamp, pd.Timedelta, pd.DatetimeIndex,
4441
+ pd.TimedeltaIndex, pd.Series, pd.DataFrame
4442
+ - **Library [cytimes](https://github.com/AresJef/cyTimes)**:
4443
+ cytimes.Pydt, cytimes.Pddt
4444
+
4445
+ :param cursor `<'type[Cursor]/None'>`: The cursor class (type) to use. Defaults to `None` (use pool default).
4446
+ Determines the data type of the fetched result set.
4387
4447
  Also accepts:
4388
4448
  1. `tuple` => `Cursor`;
4389
4449
  2. `dict` => `DictCursor`;
@@ -4437,7 +4497,7 @@ class SelectDML(DML):
4437
4497
  UPDATE ...;
4438
4498
  COMMIT;
4439
4499
  """
4440
- return await self._aioExecute(args, cursor, fetch, False, conn)
4500
+ return await self._aioExecute(args, cursor, fetch, False, conn, False)
4441
4501
 
4442
4502
  # Validate -----------------------------------------------------------------------------
4443
4503
  @cython.cfunc
@@ -5522,6 +5582,20 @@ class InsertDML(DML):
5522
5582
 
5523
5583
  :param args `<'list/tuple/DataFrame/Any'>`: The arguments (data) for the placeholders in the statement. Defaults to `None`.
5524
5584
 
5585
+ Supports:
5586
+ - **Python built-ins**:
5587
+ int, float, bool, str, None, datetime, date, time,
5588
+ timedelta, struct_time, bytes, bytearray, memoryview,
5589
+ Decimal, dict, list, tuple, set, frozenset, range
5590
+ - **Library [numpy](https://github.com/numpy/numpy)**:
5591
+ np.int, np.uint, np.float, np.bool, np.bytes,
5592
+ np.str, np.datetime64, np.timedelta64, np.ndarray
5593
+ - **Library [pandas](https://github.com/pandas-dev/pandas)**:
5594
+ pd.Timestamp, pd.Timedelta, pd.DatetimeIndex,
5595
+ pd.TimedeltaIndex, pd.Series, pd.DataFrame
5596
+ - **Library [cytimes](https://github.com/AresJef/cyTimes)**:
5597
+ cytimes.Pydt, cytimes.Pddt
5598
+
5525
5599
  :param many `<'bool'>`: Whether the 'args' (data) is multi-rows. Determines how the data is escaped. Defaults to `False`.
5526
5600
  For a single-row data, set 'many=False'. For a multi-row data, set 'many=True'.
5527
5601
 
@@ -5575,6 +5649,20 @@ class InsertDML(DML):
5575
5649
 
5576
5650
  :param args `<'list/tuple/DataFrame/Any'>`: The arguments (data) for the placeholders in the statement. Defaults to `None`.
5577
5651
 
5652
+ Supports:
5653
+ - **Python built-ins**:
5654
+ int, float, bool, str, None, datetime, date, time,
5655
+ timedelta, struct_time, bytes, bytearray, memoryview,
5656
+ Decimal, dict, list, tuple, set, frozenset, range
5657
+ - **Library [numpy](https://github.com/numpy/numpy)**:
5658
+ np.int, np.uint, np.float, np.bool, np.bytes,
5659
+ np.str, np.datetime64, np.timedelta64, np.ndarray
5660
+ - **Library [pandas](https://github.com/pandas-dev/pandas)**:
5661
+ pd.Timestamp, pd.Timedelta, pd.DatetimeIndex,
5662
+ pd.TimedeltaIndex, pd.Series, pd.DataFrame
5663
+ - **Library [cytimes](https://github.com/AresJef/cyTimes)**:
5664
+ cytimes.Pydt, cytimes.Pddt
5665
+
5578
5666
  :param many `<'bool'>`: Whether the 'args' (data) is multi-rows. Determines how the data is escaped. Defaults to `False`.
5579
5667
  For a single-row data, set 'many=False'. For a multi-row data, set 'many=True'.
5580
5668
 
@@ -5616,7 +5704,8 @@ class InsertDML(DML):
5616
5704
  INSERT INTO db.tb VALUES (...);
5617
5705
  COMMIT;
5618
5706
  """
5619
- return await self._aioExecute(args, None, False, many, conn)
5707
+ batch: cython.bint = self._insert_mode == utils.INSERT_MODE.VALUES_MODE
5708
+ return await self._aioExecute(args, None, False, many, conn, batch)
5620
5709
 
5621
5710
  # Validate -----------------------------------------------------------------------------
5622
5711
  @cython.cfunc
@@ -6577,6 +6666,20 @@ class ReplaceDML(DML):
6577
6666
 
6578
6667
  :param args `<'list/tuple/DataFrame/Any'>`: The arguments (data) for the placeholders in the statement. Defaults to `None`.
6579
6668
 
6669
+ Supports:
6670
+ - **Python built-ins**:
6671
+ int, float, bool, str, None, datetime, date, time,
6672
+ timedelta, struct_time, bytes, bytearray, memoryview,
6673
+ Decimal, dict, list, tuple, set, frozenset, range
6674
+ - **Library [numpy](https://github.com/numpy/numpy)**:
6675
+ np.int, np.uint, np.float, np.bool, np.bytes,
6676
+ np.str, np.datetime64, np.timedelta64, np.ndarray
6677
+ - **Library [pandas](https://github.com/pandas-dev/pandas)**:
6678
+ pd.Timestamp, pd.Timedelta, pd.DatetimeIndex,
6679
+ pd.TimedeltaIndex, pd.Series, pd.DataFrame
6680
+ - **Library [cytimes](https://github.com/AresJef/cyTimes)**:
6681
+ cytimes.Pydt, cytimes.Pddt
6682
+
6580
6683
  :param many `<'bool'>`: Whether the 'args' (data) is multi-rows. Determines how the data is escaped. Defaults to `False`.
6581
6684
  For a single-row data, set 'many=False'. For a multi-row data, set 'many=True'.
6582
6685
 
@@ -6630,6 +6733,20 @@ class ReplaceDML(DML):
6630
6733
 
6631
6734
  :param args `<'list/tuple/DataFrame/Any'>`: The arguments (data) for the placeholders in the statement. Defaults to `None`.
6632
6735
 
6736
+ Supports:
6737
+ - **Python built-ins**:
6738
+ int, float, bool, str, None, datetime, date, time,
6739
+ timedelta, struct_time, bytes, bytearray, memoryview,
6740
+ Decimal, dict, list, tuple, set, frozenset, range
6741
+ - **Library [numpy](https://github.com/numpy/numpy)**:
6742
+ np.int, np.uint, np.float, np.bool, np.bytes,
6743
+ np.str, np.datetime64, np.timedelta64, np.ndarray
6744
+ - **Library [pandas](https://github.com/pandas-dev/pandas)**:
6745
+ pd.Timestamp, pd.Timedelta, pd.DatetimeIndex,
6746
+ pd.TimedeltaIndex, pd.Series, pd.DataFrame
6747
+ - **Library [cytimes](https://github.com/AresJef/cyTimes)**:
6748
+ cytimes.Pydt, cytimes.Pddt
6749
+
6633
6750
  :param many `<'bool'>`: Whether the 'args' (data) is multi-rows. Determines how the data is escaped. Defaults to `False`.
6634
6751
  For a single-row data, set 'many=False'. For a multi-row data, set 'many=True'.
6635
6752
 
@@ -6671,7 +6788,8 @@ class ReplaceDML(DML):
6671
6788
  REPLACE INTO db.tb VALUES (...);
6672
6789
  COMMIT;
6673
6790
  """
6674
- return await self._aioExecute(args, None, False, many, conn)
6791
+ batch: cython.bint = self._insert_mode == utils.INSERT_MODE.VALUES_MODE
6792
+ return await self._aioExecute(args, None, False, many, conn, batch)
6675
6793
 
6676
6794
  # Validate -----------------------------------------------------------------------------
6677
6795
  @cython.cfunc
@@ -7277,6 +7395,20 @@ class UpdateDML(DML):
7277
7395
 
7278
7396
  :param args `<'list/tuple/DataFrame/Any'>`: The arguments (data) for the placeholders in the statement. Defaults to `None`.
7279
7397
 
7398
+ Supports:
7399
+ - **Python built-ins**:
7400
+ int, float, bool, str, None, datetime, date, time,
7401
+ timedelta, struct_time, bytes, bytearray, memoryview,
7402
+ Decimal, dict, list, tuple, set, frozenset, range
7403
+ - **Library [numpy](https://github.com/numpy/numpy)**:
7404
+ np.int, np.uint, np.float, np.bool, np.bytes,
7405
+ np.str, np.datetime64, np.timedelta64, np.ndarray
7406
+ - **Library [pandas](https://github.com/pandas-dev/pandas)**:
7407
+ pd.Timestamp, pd.Timedelta, pd.DatetimeIndex,
7408
+ pd.TimedeltaIndex, pd.Series, pd.DataFrame
7409
+ - **Library [cytimes](https://github.com/AresJef/cyTimes)**:
7410
+ cytimes.Pydt, cytimes.Pddt
7411
+
7280
7412
  :param many `<'bool'>`: Whether the 'args' (data) is multi-rows. Determines how the data is escaped. Defaults to `False`.
7281
7413
  For a single-row data, set 'many=False'. For a multi-row data, set 'many=True'.
7282
7414
 
@@ -7348,6 +7480,20 @@ class UpdateDML(DML):
7348
7480
 
7349
7481
  :param args `<'list/tuple/DataFrame/Any'>`: The arguments (data) for the placeholders in the statement. Defaults to `None`.
7350
7482
 
7483
+ Supports:
7484
+ - **Python built-ins**:
7485
+ int, float, bool, str, None, datetime, date, time,
7486
+ timedelta, struct_time, bytes, bytearray, memoryview,
7487
+ Decimal, dict, list, tuple, set, frozenset, range
7488
+ - **Library [numpy](https://github.com/numpy/numpy)**:
7489
+ np.int, np.uint, np.float, np.bool, np.bytes,
7490
+ np.str, np.datetime64, np.timedelta64, np.ndarray
7491
+ - **Library [pandas](https://github.com/pandas-dev/pandas)**:
7492
+ pd.Timestamp, pd.Timedelta, pd.DatetimeIndex,
7493
+ pd.TimedeltaIndex, pd.Series, pd.DataFrame
7494
+ - **Library [cytimes](https://github.com/AresJef/cyTimes)**:
7495
+ cytimes.Pydt, cytimes.Pddt
7496
+
7351
7497
  :param many `<'bool'>`: Whether the 'args' (data) is multi-rows. Determines how the data is escaped. Defaults to `False`.
7352
7498
  For a single-row data, set 'many=False'. For a multi-row data, set 'many=True'.
7353
7499
 
@@ -7407,7 +7553,7 @@ class UpdateDML(DML):
7407
7553
  WHERE id=1;
7408
7554
  COMMIT;
7409
7555
  """
7410
- return await self._aioExecute(args, None, False, many, conn)
7556
+ return await self._aioExecute(args, None, False, many, conn, False)
7411
7557
 
7412
7558
  # Validate -----------------------------------------------------------------------------
7413
7559
  @cython.cfunc
@@ -7983,6 +8129,20 @@ class DeleteDML(DML):
7983
8129
 
7984
8130
  :param args `<'list/tuple/DataFrame/Any'>`: The arguments (data) for the placeholders in the statement. Defaults to `None`.
7985
8131
 
8132
+ Supports:
8133
+ - **Python built-ins**:
8134
+ int, float, bool, str, None, datetime, date, time,
8135
+ timedelta, struct_time, bytes, bytearray, memoryview,
8136
+ Decimal, dict, list, tuple, set, frozenset, range
8137
+ - **Library [numpy](https://github.com/numpy/numpy)**:
8138
+ np.int, np.uint, np.float, np.bool, np.bytes,
8139
+ np.str, np.datetime64, np.timedelta64, np.ndarray
8140
+ - **Library [pandas](https://github.com/pandas-dev/pandas)**:
8141
+ pd.Timestamp, pd.Timedelta, pd.DatetimeIndex,
8142
+ pd.TimedeltaIndex, pd.Series, pd.DataFrame
8143
+ - **Library [cytimes](https://github.com/AresJef/cyTimes)**:
8144
+ cytimes.Pydt, cytimes.Pddt
8145
+
7986
8146
  :param many `<'bool'>`: Whether the 'args' (data) is multi-rows. Determines how the data is escaped. Defaults to `False`.
7987
8147
  For a single-row data, set 'many=False'. For a multi-row data, set 'many=True'.
7988
8148
 
@@ -8044,6 +8204,20 @@ class DeleteDML(DML):
8044
8204
 
8045
8205
  :param args `<'list/tuple/DataFrame/Any'>`: The arguments (data) for the placeholders in the statement. Defaults to `None`.
8046
8206
 
8207
+ Supports:
8208
+ - **Python built-ins**:
8209
+ int, float, bool, str, None, datetime, date, time,
8210
+ timedelta, struct_time, bytes, bytearray, memoryview,
8211
+ Decimal, dict, list, tuple, set, frozenset, range
8212
+ - **Library [numpy](https://github.com/numpy/numpy)**:
8213
+ np.int, np.uint, np.float, np.bool, np.bytes,
8214
+ np.str, np.datetime64, np.timedelta64, np.ndarray
8215
+ - **Library [pandas](https://github.com/pandas-dev/pandas)**:
8216
+ pd.Timestamp, pd.Timedelta, pd.DatetimeIndex,
8217
+ pd.TimedeltaIndex, pd.Series, pd.DataFrame
8218
+ - **Library [cytimes](https://github.com/AresJef/cyTimes)**:
8219
+ cytimes.Pydt, cytimes.Pddt
8220
+
8047
8221
  :param many `<'bool'>`: Whether the 'args' (data) is multi-rows. Determines how the data is escaped. Defaults to `False`.
8048
8222
  For a single-row data, set 'many=False'. For a multi-row data, set 'many=True'.
8049
8223
 
@@ -8093,7 +8267,7 @@ class DeleteDML(DML):
8093
8267
  DELETE FROM db.tb AS t0 WHERE id=1;
8094
8268
  COMMIT;
8095
8269
  """
8096
- return await self._aioExecute(args, None, False, many, conn)
8270
+ return await self._aioExecute(args, None, False, many, conn, False)
8097
8271
 
8098
8272
  # Validate -----------------------------------------------------------------------------
8099
8273
  @cython.cfunc