DEV Community

Cover image for Query Documents from PostgreSQL like MongoDB
Ken
Ken

Posted on

Query Documents from PostgreSQL like MongoDB

BackLogic Data Access Service (DAS) is in beta!

Forget about ORM, query builder and raw SQL. BackLogic DAS lets you

  • Query complex objects from PostgreSQL like from MongoDB; and
  • Build your entire data access layer with not Java, C#, Python or TypeScript, but SQL Only.

Is this object below complex enough?

[
    {
        "id": 10,
        "arr1": [
            {
                "id1": 1
            }
        ],
        "arr2": [
            {
                "id2": 2,
                "arr3": [
                    {
                        "id3": 3,
                        "val": "X"
                    }
                ]
            }
        ]
    },
    {
        "id": 20,
        "arr1": [
            {
                "id1": 2
            }
        ],
        "arr2": [
            {
                "id2": 4,
                "arr3": [
                    {
                        "id3": 6,
                        "val": "Y"
                    }
                ]
            }
        ]
    }
]
Enter fullscreen mode Exit fullscreen mode

It is returned by a DAS query service using this single SELECT statement:

select 10 as id, 1 as id1, 2 as id2, 3 as id3, 'X' as val
union all
select 20, 2, 4, 6, 'Y'
Enter fullscreen mode Exit fullscreen mode

Besides query service, BackLogic DAS also includes a repository service and a command service, both comprising only SQL and JSON elements but designed to handle objects of any shape.

Check it out!

Top comments (0)