question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to ... postgres

See original GitHub issue

Hello, I noticed that postgres is an option, which is fantastic! For the container, I added the typeorms for postgres and got an error at the npm install pg --save step about missing python for gyp. Do you have a dockerfile for this option?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
j2lcommented, Nov 3, 2021

@paulfitz I agree that sqlite is great to take away and it makes sense that grist focuses on this.

Personally, I have sqilte files and various spreadsheets that have many to many relationships (so not really spreadsheets) and I need them to become tables in a database that can scale and be shared as single point of truth, but the data will continue to evolve greatly.

So my use case is simple: Getting a grist-like spreadsheet for postgres (not speaking about functions here, simply a way to fill, manipulate data as in a spreadsheet), because the one-record only (card or line by line) approach of databases is sometimes not useful at all. Especially when you select a column or multiple cells to be changed at once. Hope my explanation makes sense 😃

I think Airtable nailed the point here, but your data is barely yours anymore since you can’t GET and aggregate linked records or even export them as is (csv are flatten, no more links).

If you know of other solutions to manage postgres data like a spreadsheet, please let me know.

I think we can close this one for now. Please, if you know changes of app/server/lib/DocStorage.ts for postgres, please let me know here 😃

2reactions
paulfitzcommented, Nov 3, 2021

@j2l for data, we don’t have plans to use postgres. As a hybrid spreadsheet/database application, it is helpful to have a file format that can be downloaded, uploaded, emailed around, accessed from other tools, and compared with other versions of itself. All that could be done with postgres and some mappings, but it is a lot simpler with sqlite.

That said, for database applications where having a file format isn’t important (apart from backup/restores), I could definitely see the utility of backing a specific document in Grist with an external database. The main thing that would need changing would be app/server/lib/DocStorage.ts, and then turning off some functionality that wouldn’t make much sense with such a back end. But this isn’t a priority for us. I’d be interested in hearing your use-case though.

About the add pg, the docker image is stripped down and isn’t ideal for building in - you might want to tweak the Dockerfile to use a single stage, rather than having a second stage that omits all the build dependencies. But otherwise, I think you could make yarn add pg work in a regular Grist container by doing:

  • apt update
  • apt install python sqlite3 build-essential
  • yarn add pg

(Although I realize that since you are looking for data in postgres, this isn’t actually useful any more).

Read more comments on GitHub >

github_iconTop Results From Across the Web

PostgreSQL Tutorial - Learn PostgreSQL from Scratch
First, you'll learn how to query data from a single table using basic data querying techniques, including selecting data, sorting result sets, and...
Read more >
Documentation: 15: Part I. Tutorial - PostgreSQL
Welcome to the PostgreSQL Tutorial. The following few chapters are intended to give a simple introduction to PostgreSQL, relational database concepts, ...
Read more >
Set Up a PostgreSQL Database on Windows - Micro Focus
Download and install a PostgreSQL server. · Add the PostgreSQL bin directory path to the PATH environmental variable. · Open the psql command-line...
Read more >
PostgreSQL Tutorial - Tutorialspoint
PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development and a proven architecture that...
Read more >
PostgreSQL Tutorial for Beginners: Learn Basic PSQL in 3 Days
How to Start PostgreSQL · Step 1) Go to Start Menu and search pgAdmin 4 · Step 2) The pgAdmin homepage will open...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found