This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

WriteOnly/ReadOnly Database - Postgres configuration with Drupal 9

Hi All,

I would like to setup a Drupal with PostgreSQL for writeonly and readonly databases. I have gone through lots of article but something is missing from my side on implementation. I have following configuration in the settings.php file. Do I need any other changes any where else? Mainly would like to implement two database 1) write only (DB1) - All the write queries such as insert, update, delete etc and 2) readonly (DB2) - all the select queries. Will this implementation help me to achieve if DB1 goes down still all the traffic goes to DB2 (ReadOnly)?

Settings.php

Date field in query

In a form I have a date field

$form['data'] = array(
  '#type' => 'date',
  '#title' => 'Data',
  '#default_value' => date('Y-m-d', time()) ,
);

In the submitForm, I put the date in a variable, to be able to use it in the query

$field  = $form_state->getValues();
  $dData = $field['data'];

In the query

How does JSON:API Search API work?

I can't figure out how does JSON:API Search API works?

How can i search by something and get results? There is no documentation on https://www.drupal.org/project/jsonapi_search_api

How do i search after setting up search api and indexs?

/api/search_api_index/search_api_index with json api i can see this page but can't get how do i search for something

Custom mudule and rendering

Hi, I created a form and in the buildForm I define some fields. One of them is a table field ('#type' => 'table')
After choosing the field and pressing the button, I execute some code that updates the table field by adding rows and updating the fields.
At the end I would like to display the result obtained by displaying the table field. But I didn't understand how to do it.
If I put the code in the buidForm everything is fine but I can't choose the date
Is there a system?

I'm trying to create the simplest module to add some js and doesn't work

The libraries do not load

Directory: custom_simplelightbox

    custom_simplelightbox.libraries.yml

custom_simplelightbox:
  version: 1.x
  css:
    theme:
      css/simple-lightbox.min.css: {}
  js:
    js/simple-lightbox.jquery.min.js: {}
    js/settings.js: {}
  dependencies:
    - core/jquery

    custom_simplelightbox.module

    custom_simplelightbox.info.yml

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions