Update: I have been able to completely port the feathers-chat from sqlite to MySQL.
Plugging this here just incase anyone might need the same
Feathers Chat MySQL Version
I am trying to port the feathers-chat-ts from the sqlite to use MySQl instead. But this always errors. I have updated the default.json, created mysql.ts and also updated the knexfile.js but this does not seem to work
Steps to reproduce
Remove sqlite.ts and replace with mysql.ts
//mysql.ts
// For more information about this file see https://dove.feathersjs.com/guides/cli/databases.html
import knex from 'knex'
import type { Knex } from 'knex'
import type { Application } from './declarations'
// Load our database connection info from the app configuration
const config = app.get('mysql')
module.exports = config
- Update app.ts to use MySQL rather than sqlite
//app.ts
import { mysql } from './mysql'
......
app.configure(mysql)
(First please check that this issue is not already solved as [described
here](https://github.com/feathersjs/feathers/blob/master/.github/contributing.md#report-a-bug))
- [ ] Tell us what broke. The more detailed the better.
- [ ] If you can, please create a simple example that reproduces the issue and link to a gist, jsbin, repo, etc.
### Expected behavior
Tell us what should happen
The feathers app should still work exactly the same with populating the db provided
### Actual behavior
Tell us what happens instead
Errors when I run `npm run migrate` or `npm run dev` (or start).
//error
Error: You must provide a Model (the initialized
knex object)
### System configuration
Tell us about the applicable parts of your setup.
**Module versions** (especially the part that's not working):
"mysql": "^2.18.1",
"@feathersjs/feathers": "^5.0.0",
**NodeJS version**:
v18.17.1
**Operating System**:
Windows
**Browser Version**:
**React Native Version**:
**Module Loader**:
Update: I have been able to completely port the feathers-chat from sqlite to MySQL. Plugging this here just incase anyone might need the same Feathers Chat MySQL Version
I am trying to port the
feathers-chat-ts
from the sqlite to use MySQl instead. But this always errors. I have updated the default.json, created mysql.ts and also updated the knexfile.js but this does not seem to workSteps to reproduce
declare module './declarations' { interface Configuration { mysqlClient: Knex } }
export const mysql = (app: Application) => { const config = app.get('mysql') const db = knex(config!)
app.set('mysqlClient', db) }
//config/default.json "mysql": { "client": "mysql", "connection": { "host": "",
"port": ,
"user": "",
"password": "",
"database": ""
}
},
//knexfile.ts // For more information about this file see https://dove.feathersjs.com/guides/cli/databases.html import { app } from './src/app'
// Load our database connection info from the app configuration const config = app.get('mysql')
module.exports = config
//app.ts
import { mysql } from './mysql'
......
app.configure(mysql)
//error Error: You must provide a Model (the initialized knex object)