Giter Site home page Giter Site logo

egg-knex's People

Contributors

cemremengu avatar dependabot[bot] avatar ibd-team avatar okoala avatar solarhell avatar sunfuze avatar yolopunk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

egg-knex's Issues

是不是不支持Typescript?

配置部分:
${app_root}/config/plugin.ts:
import { EggPlugin } from 'egg';
const plugin: EggPlugin = {
knex: {
enable: true,
package: 'egg-knex'
}
};
export default plugin;
${app_root}/config/config.${env}.ts:
import { DefaultConfig } from './config.default';
export default () => {
const config: DefaultConfig = {};
config.knex = {
client: {
dialect: 'mysql',
connection: {
host: '127.0.0.1',
port: '3306',
user: 'root',
password: '111111',
database: 'life'
},
pool: { min: 0, max: 5 },
acquireConnectionTimeout: 30000,
},
app: true,
agent: true,
}
return config;
};
结果:
image
在Application对象上获取不到knex?

README中的update示例有问题

README中的update示例有问题,return回来的是更新的行数,不是数组不需要结构赋值。update传入的row已经为对象,不需要加外层大括号

const row = {
  name: 'fengmk2',
  otherField: 'other field value',
  modifiedAt: app.knex.raw('CURRENT_TIMESTAMP'),
};
// Returns [1] in "mysql", "sqlite", "oracle"; [] in "postgresql" unless the 'returning' parameter is set.
const affectedRows = yield app.knex('posts')
  .update(row)
  .where(id, 1);

请问在多数据库实例下如何设置acquireConnectionTimeout?

在多数据库实例下,acquireConnectionTimeout如何设置?
如下为配置文件:
// Edit config.default.js
exports.knex = {
default: {
acquireConnectionTimeout: 30000,
},
app: true,
agent: false,
};

这样设置后,acquireConnectionTimeout的时间依旧没有生效,是否为我配置错误?感谢!

示例代码中的配置样例有个类型提示的错误

Add Configurations

Edit ${app_root}/config/config.${env}.js 段落中的

...
    // port
      port: '3306', 这里的 3306 ts中的type是number,而不是string
...

需要修改为 port:3306,否则会报类型提示不符合的错误。

Does oracle work?

I am getting error during initialization phase Error: SHOW TABLES - ORA-00900: invalid SQL statement

I did #11 to get it working with the oracledb driver but seems like did not work. Is there another way to connect oracle ?

自定义logger输出

现在的日志是在coreLogger
在开发的时候会想输出在console里,
能不能像egg-sequelize一样可以自定义日志输出. 默认也是输出到app.logger. 这样方便调试. 不需要去文件里查看.

谢谢!

3.0.0 version throw `knex.client._formatQuery is not a function` when i start egg application.

knex.client._formatQuery is not a function

2021-05-14 19:00:20,137 ERROR 81953 nodejs.TypeError: knex.client._formatQuery is not a function
   at Function.<anonymous> (/Users/colin/work/eggjs_demo/backend/node_modules/egg-knex/lib/knex.js:171:23)
   at Function.emit (events.js:315:20)
   at Client_MySQL.<anonymous> (/Users/colin/work/eggjs_demo/backend/node_modules/knex/lib/knex-builder/make-knex.js:300:10)
   at Client_MySQL.emit (events.js:315:20)
   at /Users/colin/work/eggjs_demo/backend/node_modules/knex/lib/execution/runner.js:154:21
   at processTicksAndRejections (internal/process/task_queues.js:93:5)
   at async Runner.ensureConnection (/Users/colin/work/eggjs_demo/backend/node_modules/knex/lib/execution/runner.js:272:14)
   at async Runner.run (/Users/colin/work/eggjs_demo/backend/node_modules/knex/lib/execution/runner.js:30:19)
   at async isReady (/Users/colin/work/eggjs_demo/backend/node_modules/egg-knex/lib/knex.js:128:20)

pid: 81953
hostname: xxxxx

2021-05-14 19:00:20,137 ERROR 81953 [app_worker] start error, exiting with code:1

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.