easy-mysql-js
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "easy-mysql-js", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Easy MySQL for NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -27,2 +27,6 @@ # easy-mysql-js | ||
$ npx prisma init | ||
or | ||
$ sudo npx prisma init | ||
``` | ||
@@ -33,3 +37,5 @@ | ||
``` | ||
After installed Prisma, you will see "schema.prisma" file in prisma folder. Open schema.prisma file and change "postgresql" as "mysql". | ||
After run "npx prisma init" command, there will be "prisma" folder in your project. | ||
Open schema.prisma file in the prisma folder and change "postgresql" as "mysql". | ||
``` | ||
@@ -49,5 +55,10 @@ | ||
$ npx prisma generate | ||
or | ||
$ sudo npx prisma db pull | ||
$ sudo npx prisma generate | ||
``` | ||
NOTE: If you update your database tables, columns, etc. you need to run: | ||
NOTE: If you change your MySQL database tables, columns, etc. you need to run: | ||
@@ -57,2 +68,7 @@ ```shell | ||
$ npx prisma generate | ||
or | ||
$ sudo npx prisma db pull | ||
$ sudo npx prisma generate | ||
``` | ||
@@ -72,4 +88,26 @@ | ||
1- Create "index.js" file | ||
```js | ||
const {Select} = require('easy-mysql-js') | ||
async function test() { | ||
const table_name = 'users' | ||
const query = 'select * from '+table_name+' limit 2' // sql query | ||
const select_result = await Select(query) | ||
console.log(select_result) | ||
} | ||
test() | ||
``` | ||
2- Run | ||
```shell | ||
$ node index.js | ||
``` | ||
## Select | ||
@@ -76,0 +114,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14888
356