mysql2 2.3.3 → 3.0.0

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 (42) hide show
  1. package/README.md +6 -2
  2. package/index.d.ts +23 -9
  3. package/index.js +2 -0
  4. package/lib/auth_plugins/index.js +8 -0
  5. package/lib/auth_plugins/mysql_clear_password.js +17 -0
  6. package/lib/auth_plugins/sha256_password.js +2 -2
  7. package/lib/commands/auth_switch.js +3 -1
  8. package/lib/commands/change_user.js +19 -0
  9. package/lib/commands/client_handshake.js +40 -1
  10. package/lib/commands/prepare.js +2 -1
  11. package/lib/commands/quit.js +3 -3
  12. package/lib/commands/server_handshake.js +36 -1
  13. package/lib/connection.js +56 -11
  14. package/lib/connection_config.js +20 -3
  15. package/lib/constants/charset_encodings.js +4 -1
  16. package/lib/constants/charsets.js +41 -13
  17. package/lib/constants/client.js +8 -0
  18. package/lib/constants/ssl_profiles.js +274 -0
  19. package/lib/constants/types.js +60 -28
  20. package/lib/helpers.js +3 -1
  21. package/lib/packets/auth_next_factor.js +35 -0
  22. package/lib/packets/binary_row.js +49 -2
  23. package/lib/packets/column_definition.js +2 -0
  24. package/lib/packets/execute.js +62 -0
  25. package/lib/packets/index.js +6 -0
  26. package/lib/parsers/parser_cache.js +1 -1
  27. package/lib/parsers/text_parser.js +11 -4
  28. package/lib/pool.js +1 -1
  29. package/package.json +21 -14
  30. package/promise.d.ts +22 -2
  31. package/promise.js +12 -2
  32. package/typings/mysql/index.d.ts +43 -4
  33. package/typings/mysql/lib/Connection.d.ts +52 -8
  34. package/typings/mysql/lib/Pool.d.ts +4 -2
  35. package/typings/mysql/lib/PoolCluster.d.ts +3 -3
  36. package/typings/mysql/lib/PoolConnection.d.ts +1 -0
  37. package/typings/mysql/lib/Server.d.ts +13 -0
  38. package/typings/mysql/lib/protocol/packets/index.d.ts +5 -1
  39. package/typings/mysql/lib/protocol/packets/params/ErrorPacketParams.d.ts +6 -0
  40. package/typings/mysql/lib/protocol/packets/params/OkPacketParams.d.ts +9 -0
  41. package/typings/mysql/lib/protocol/sequences/Prepare.d.ts +52 -0
  42. package/typings/mysql/lib/protocol/sequences/Query.d.ts +12 -2
@@ -16,6 +16,11 @@ declare namespace Query {
16
16
  */
17
17
  values?: any | any[] | { [param: string]: any };
18
18
 
19
+ /**
20
+ * This overrides the namedPlaceholders option set at the connection level.
21
+ */
22
+ namedPlaceholders?: boolean;
23
+
19
24
  /**
20
25
  * Every operation takes an optional inactivity timeout option. This allows you to specify appropriate timeouts for
21
26
  * operations. It is important to note that these timeouts are not part of the MySQL protocol, and rather timeout
@@ -54,9 +59,14 @@ declare namespace Query {
54
59
 
55
60
  /**
56
61
  * This overrides the same option set at the connection level.
57
- *
62
+ *
58
63
  */
59
64
  rowsAsArray?: boolean
65
+
66
+ /**
67
+ * By specifying a function that returns a readable stream, an arbitrary stream can be sent when sending a local fs file.
68
+ */
69
+ infileStreamFactory?: (path: string) => Readable;
60
70
  }
61
71
 
62
72
  export interface StreamOptions {
@@ -126,7 +136,7 @@ declare class Query extends Sequence {
126
136
  *
127
137
  * @param options The options for the stream.
128
138
  */
129
- stream(options: Query.StreamOptions): Readable;
139
+ stream(options?: Query.StreamOptions): Readable;
130
140
 
131
141
  on(event: string, listener: Function): this;
132
142
  on(event: 'error', listener: (err: Query.QueryError) => any): this;