Cannot connect to database

System Information
  • 3.4.1:
  • MacOS 11.0.1 (20B29):
  • sqlite:
  • 12.18.4:
  • 6.14.6:
  • 1.22.10:

Using default configurations (sqlite + bookshelf) with strapi application (created via yarn create strapia-app my-project --quick-start).
In the documentation we interact with models of our ORM system via models with .query method which is bounded onto our strapi object. But the issue in that I don’t have .query porperty bounded onto the strapi obj.
I suggess, that strapi application is wrong configured, but I’ve combing through all the configuration files of the project but didn’t find the place where’s this bingind occurs.

Does anyone else stuck with a such problem?

But do you have access to other properties like strapi.models? Can you share the configuration file for ./config/database.js

1 Like
module.exports = ({ env }) => ({
  defaultConnection: 'default',
  connections: {
    default: {
      connector: 'bookshelf',
      settings: {
        client: 'sqlite',
        filename: env('DATABASE_FILENAME', '.tmp/data.db'),
      },
      options: {
        useNullAsDefault: true,
      },
    },
  },
})

Actually, some problem was with the project as is.
So, the solution was to regenerate a new project.