You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`typeCast`: Determines if column values should be converted to native
@@ -869,14 +871,13 @@ will have:
869
871
870
872
## Running unit tests
871
873
872
-
Set the environment variables `MYSQL_DATABASE`, `MYSQL_HOST`, `MYSQL_PORT`, `MYSQL_USER` and `MYSQL_PASSWORD`. (You may want to put these in a `config.sh` file and source it when you run the tests). Then run `make test`. E.g.
874
+
Set the environment variables `MYSQL_DATABASE`, `MYSQL_HOST`, `MYSQL_PORT`, `MYSQL_USER` and `MYSQL_PASSWORD`. (You may want to put these in a `config.sh` file and source it when you run the tests). Then run `make test`.
875
+
876
+
For example, if you have an installation of mysql running on localhost:3306 and no password set for the `root` user, run:
873
877
874
878
```
875
-
mysql -u root -e "CREATE DATABASE IF NOT EXISTS node_mysql_test_db"
876
-
mysql -u root -e "CREATE USER 'node_mysql_test'@'localhost' IDENTIFIED BY ''"
877
-
mysql -u root -e "GRANT ALL ON node_mysql_test_db.* TO 'node_mysql_test'@'%'"
mysql -u root -e "CREATE DATABASE IF NOT EXISTS node_mysql_test"
880
+
MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_DATABASE=node_mysql_test MYSQL_USER=root MYSQL_PASSWORD= make test
880
881
```
881
882
882
883
## Running unit tests on windows
@@ -885,11 +886,11 @@ Set the environment variables `MYSQL_DATABASE`, `MYSQL_HOST`, `MYSQL_PORT`, `MYS
885
886
* Make sure the database (e.g. 'test') you want to use exists and the user you entered has the proper rights to use the test database. (E.g. do not forget to execute the SQL-command ```FLUSH PRIVILEGES``` after you have created the user.)
886
887
* In a DOS-box (or CMD-shell) in the folder of your application run ```npm install mysql --dev``` or in the mysql folder (```node_modules\mysql```), run ```npm install --dev```. (This will install additional developer-dependencies for node-mysql.)
887
888
* Run ```npm test mysql``` in your applications folder or ```npm test``` in the mysql subfolder.
888
-
* If you want to log the output into a file use ```npm test mysql > test.log``` or ```npm test > test.log```.
889
+
* If you want to log the output into a file use ```npm test mysql > test.log``` or ```npm test > test.log```.
889
890
890
891
## Todo
891
892
892
893
* Prepared statements
893
894
* setTimeout() for Connection / Query
894
895
* Support for encodings other than UTF-8 / ASCII
895
-
* API support for transactions, similar to [php](http://www.php.net/manual/en/mysqli.quickstart.transactions.php)
896
+
* API support for transactions, similar to [php](http://www.php.net/manual/en/mysqli.quickstart.transactions.php)
0 commit comments