Giter Club home page Giter Club logo

h-mysql's People

Contributors

haizhilin2013 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

h-mysql's Issues

使用 node demo.js 无法运行事例

1)按例子写,会报错如下:
const {error, result}= await hMysql.table('mytable').where().select().execSql();
^^^^^
SyntaxError: await is only valid in async function
2)去掉 await,返回值是一个 promise;不报错,但没有响应结果
2020-08-03 13:50:00 | SELECT * FROM mytable
undefined
3)如果只是第一句const result= hMysql.table('mytable');console.log(result);
不报错,能返回一个大对象,如下

hMysql {
connection: Pool {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
config: PoolConfig {
acquireTimeout: 1000,
connectionConfig: [ConnectionConfig],
waitForConnections: true,
connectionLimit: 10,
queueLimit: 0
},
_acquiringConnections: [],
_allConnections: [],
_freeConnections: [],
_connectionQueue: [],
_closed: false,
[Symbol(kCapture)]: false
},
sqlObj: { table: 'mytable' },
tempObj: {},
config: {
host: 'localhost',
port: 3306,
user: 'root',
password: '‘,
database: 'exercise',
acquireTimeout: 1000,
waitForConnections: true,
connectionLimit: 10,
queueLimit: 0,
isPool: true,
defaultSqlPre: '',
isDebug: true
},
mixed: {
table: [Function: bound table],
alias: [Function: bound alias],
field: [Function: bound field],
where: [Function: bound where],
data: [Function: bound data],
order: [Function: bound order],
limit: [Function: bound limit],
page: [Function: bound page],
join: [Function: bound join],
union: [Function: bound union],
distinct: [Function: bound distinct],
lock: [Function: bound lock],
comment: [Function: bound comment],
group: [Function: bound group],
having: [Function: bound having],
count: [Function: bound count],
max: [Function: bound max],
min: [Function: bound min],
avg: [Function: bound avg],
sum: [Function: bound sum],
select: [Function: bound select],
find: [Function: bound find],
update: [Function: bound update],
insert: [Function: bound insert],
delete: [Function: bound delete],
query: [Function: bound query],
connect: [Function: bound connect],
poolEvent: [Function: bound poolEvent],
execSql: [Function: bound execSql] AsyncFunction,
transaction: [Function: bound transaction] AsyncFunction
},
isMixedWith: [Function (anonymous)],
pageNum: 1,
pageSize: 50
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.