Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for PostgreSQL #75

Open
MatteoJoliveau opened this issue Oct 8, 2019 · 10 comments
Open

Support for PostgreSQL #75

MatteoJoliveau opened this issue Oct 8, 2019 · 10 comments
Assignees
Labels
enhancement New feature or request feature Feature request Fund
Milestone

Comments

@MatteoJoliveau
Copy link

MatteoJoliveau commented Oct 8, 2019

Is your feature request related to a problem? Please describe.
Our stack is based on PostgreSQL as our primary datastore. We would love to use one of the existing server instances for our Traduora deployment instead of having to provision a MySQL instance just for it.

Describe the solution you'd like
Ideally, since TypeORM supports different database systems, we could find a way to keep Traduora agnostic and let the users pick the database they want.

Describe alternatives you've considered
I could fork the repo and replace MySQL's config with Postgre's one, but it would be hacky and less useful for other users.

I'm willing to try and implement this if there is enough interest from the community and the maintainers.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@MatteoJoliveau MatteoJoliveau added the feature Feature request label Oct 8, 2019
@anthonynsimon anthonynsimon added the help wanted Extra attention is needed label Nov 14, 2019
@azlux
Copy link
Contributor

azlux commented Mar 1, 2022

It's look like TypeORM support everything.
So the only line you need to change is:

type: 'mysql',
with a new environment variable.

@evereq evereq added this to the Traduora 1.0 milestone Mar 1, 2022
@evereq
Copy link
Member

evereq commented Mar 1, 2022

@rahul-rathore-576 please see if we can copy the logic of configurations for DB from our other projects (e.g. https://github.com/ever-co/ever-gauzy) to Traduora as seems it's interesting for multiple customers.
Please also make sure all works well with PostgreSQL and SQLite.

@evereq evereq added enhancement New feature or request and removed help wanted Extra attention is needed labels Mar 1, 2022
@peh
Copy link

peh commented Feb 17, 2023

The merged PR does not fully fix this issue in my eyes as trying to run the application with postgres as DB_TYPE results in
DriverPackageNotInstalledError: Postgres package has not been found installed. Try to install it: npm install pg --save

@peh
Copy link

peh commented Feb 17, 2023

Data type "binary" in "User.encryptedPassword" is not supported by "postgres" database.

this is far as I come...

@oldluke92
Copy link

this is far as I come...

I also stopped here. I guess it would be possible to use postgres 'bytea' column type instead of 'binary' but that would require to change the column type based on which DB is used.

@oldluke92
Copy link

I went ahead and replaced "binary" with "bytea". Next stop is migrations

Migration "addLocales1537531930470" failed, error: syntax error at or near "`"
/opt/traduora/node_modules/typeorm/error/TypeORMError.js:9
        var _this = _super.call(this, message) || this;
                           ^

QueryFailedError: syntax error at or near "`"
    at QueryFailedError.TypeORMError [as constructor] (/opt/traduora/node_modules/typeorm/error/TypeORMError.js:9:28)
    at new QueryFailedError (/opt/traduora/node_modules/typeorm/error/QueryFailedError.js:13:28)
    at PostgresQueryRunner.<anonymous> (/opt/traduora/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:281:31)
    at step (/opt/traduora/node_modules/typeorm/node_modules/tslib/tslib.js:143:27)
    at Object.throw (/opt/traduora/node_modules/typeorm/node_modules/tslib/tslib.js:124:57)
    at rejected (/opt/traduora/node_modules/typeorm/node_modules/tslib/tslib.js:115:69)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  query: 'CREATE TABLE IF NOT EXISTS `locale` (`code` varchar(255) NOT NULL, `language` varchar(255) NOT NULL, `region` varchar(255) NOT NULL, `dateCreated` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), `dateModified` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), PRIMARY KEY (`code`)) ENGINE=InnoDB',

Giving up for now.

@csampaio26
Copy link

The merged PR does not fully fix this issue in my eyes as trying to run the application with postgres as DB_TYPE results in DriverPackageNotInstalledError: Postgres package has not been found installed. Try to install it: npm install pg --save

How did you fix this?

@oldluke92
Copy link

Hey there,
as my pevious comments show - not at all really.
I built a new docker that has the pg package installed aswell as some db type replacements in the code. Did not invest too much time and therefor did not get it running with postgres anyways. I spun up a seperate mysql instance instead.

@evereq
Copy link
Member

evereq commented Sep 1, 2023

@csampaio26 / @oldluke92 not sure you saw, we have PR #391 by @vvadymk, however it's not yet finalized.

@vvadymk
Copy link
Contributor

vvadymk commented Sep 1, 2023

@csampaio26 / @oldluke92 not sure you saw, we have PR #391 by @vvadymk, however it's not yet finalized.

Yes, it is still in progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature Feature request Fund
Projects
None yet
Development

No branches or pull requests

9 participants