Postgresql Configuration

I am trying to build Moqui and want to use PostgreSQL v15. I have a few questions regarding loading demo data using “load demo”.

Will “load demo” create schemas, tables, and attributes on the fly for PostgreSQL, or do I need to do this manually before running “load types=demo”? If I have to do it manually, where is the XML or file that contains this information?

The same question as above, but what if I start Moqui without “types=demo” and use PostgreSQL?

Is there a PostgreSQL configuration document available that someone can share or point me to?

Thanks

1 Like

The configuration for PG is in the file framework\src\main\resources\MoquiDefaultConf.xml.
I dont remember the different cmd line options , but with default database, if you run gradlew load run , all the demo data will be loaded into the database.

If you are using pg, then , you can have pg admin installed, then take a look on database after you run the cmd.

About all the infomation you asked, you can go to the moqui site, there is a doc existing long time. Read it from the first page. Be patient, though Moqui has a deep learning curve, it is a well orgnized framework.
Good luck

1 Like

@strand Thank you.

I searched through the Moqui site but has no come across any doc explain Postgres implementation steps.

It is not talking pg directly, it is talking configuaration stuff.
If you go to the first page, you will see DOC , and a book in pdf called making apps with moqui. This pdf is not in the state of the art, but it is a quite good place to start to understand what is moqui, and what is its strategy, convention, and so on.

My sugguest is to read through the book or doc, and find the corresponding part in the code. If you start develope something without reading through the book, it would be more difficult. After reading the book or doc, you will bear something in mind such that when in coding you bump into something, you will have a clue and know where to dig, where to search.

Without reading it wuld be like a headless fly flying around . This is my little pity experience …

Thank you for your recommendation. Not all but I have read quite a bit before starting this Moqui server build and configuration process. I assume others might also use PostgreSQL and could share some insights instead of reinventing the wheel. If we don’t have such a document, I would be happy to create a PostgreSQL configuration and integration document once I am done.

THERE is a pg config there in the file i referenced. What you need is to replace very a few info with your own.

And you might need to register your database manually first before running the cmd. Setup password and such.

Based my knowledge, there is no need for separate pg config for moqui, but pg has its own config file which might need to be tuned somehow. I just use the default.

Based on moqui 3.1.0-rc1:
1、There are configuration instructions for PostgreSQL .xml configuration file framework/src/main/resources/MoquiDefaultConf

You can copy the configuration into the runtime/conf/MoquiDevConf .xml , just for development

2、At the same time, to modify framework/build.gradle, add the driver of PostgreSQL, the version number depends on the version of the database, the example is as follows:
api ‘org.postgresql:postgresql:42.6.0’

3、recompile and run

1 Like

I would not use the Postgres configuration for dev because it’s more of a pain and not really necessary unless specifically testing postgres functionality with moqui.

I usually put the postgres file in the runtime lib like: https://github.com/coarchy/moqui-runtime/tree/coarchy/lib.

See this for moqui database deployment with environment variables.

After a recompile and run, with the right credentials, you moqui should work just fine on postgres.

This method is good, can do without modifying the kernel framework

1 Like