Giter VIP home page Giter VIP logo

Comments (6)

simov avatar simov commented on May 18, 2024

You need some tables in your database. Exress Admin can't create tables for you, it can only edit existing ones.

from express-admin.

emekanw avatar emekanw commented on May 18, 2024

I have a table, I even used the express-admin-example but got the same error. For some reason
SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' works on pgadmin and returns the tables but returns an empty array with

var sql = query.replace('show-tables', schema);.

this.client.query(sql, function (err, rows) {
console.log(rows);
if (err) return cb(err);
if (rows.length) return cb(null, false);
cb(null, true);
}

in https://github.com/simov/express-admin/blob/master/lib/db/database.js

from express-admin.

simov avatar simov commented on May 18, 2024

This error message might not be correct. Can you check out if the database user you are connecting with have granted permissions for this schema, tables and sequences you are using.

Example for granting permissions to your user here - https://github.com/simov/express-admin-examples/#postgresql

from express-admin.

emekanw avatar emekanw commented on May 18, 2024

yes I did that, my user has permission.

from express-admin.

simov avatar simov commented on May 18, 2024

That's very strange, the only problem I can think of is misconfiguration or missing privileges (the error message isn't correct, which is silly)

Here is what I normally do

# import
sudo -u postgres psql 'db' < dump.sql
# cmd
sudo -u postgres psql
\c "to-the-database-first!"
grant all on database "express-admin-examples" to liolio;
grant all on schema "public" to liolio;
grant all on all tables in schema "public" to liolio;
grant all on all sequences in schema "public" to liolio;

-- additionally you may need to change the owner of each table and sequence
alter table [tableName] owner to liolio;
alter sequence [sequenceName] owner to liolio;

from express-admin.

emekanw avatar emekanw commented on May 18, 2024

That helped thanks

from express-admin.

Related Issues (20)

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.