GitHub - ClusterDB/liberate-data: This repository demonstrates how data trapped in an RDBMS can be liberated by migrating to MongoDB Atlas, powering with search, graphql and mobile clients. This demo was created for AWS re:Invent 2022 and presented at the MongoDB booth area at the Venetian expo hall.
Liberate your data: From RDBMS to Search, GraphQL & Mobile ... in minutes!
Reduce the time it takes to modernize your applications by freeing the data trapped in your relational database and migrating to the next-gen fully transactional DB of MongoDB Atlas. Powering it with advanced lucene-based search, enable API consumption via fully-managed GraphQL, and expose to mobile and edge consumers via the Realm mobile DB and SDK’s.
WITH tbl AS
(SELECT table_schema,
TABLE_NAME
FROM information_schema.tables
WHERE TABLE_NAME not like 'pg_%'
AND table_schema in ('northwind'))
SELECT table_schema,
TABLE_NAME,
(xpath('/row/c/text()', query_to_xml(format('select count(*) as c from %I.%I', table_schema, TABLE_NAME), FALSE, TRUE, '')))[1]::text::int AS rows_n
FROM tbl
ORDER BY rows_n DESC;
output
-----------------------------------------
"table_schema","table_name","rows_n"
"northwind","order_details",2155
"northwind","orders",830
"northwind","customers",91
"northwind","products",77
"northwind","territories",53
"northwind","us_states",51
"northwind","employee_territories",49
"northwind","suppliers",29
"northwind","employees",9
"northwind","categories",8
"northwind","shippers",6
"northwind","region",4
"northwind","customer_customer_demo",0
"northwind","customer_demographics",0
{
"title": "order",
"required": [
"_id",
"customerId",
"employeeId",
"freight",
"orderDate",
"shipAddress",
"shipCity",
"shipCountry",
"shipName",
"shipPostalCode",
"shipRegion",
"shipVia",
"shippedDate"
],
...
}