Convert SQL query to Android Azure Mobile Service query - DISTINCT Statement - java

SQL Statement:
SELECT DISTINCT * messages FROM messages WHERE sender_id = 1
Into Azure Mobile Service
messagesTable.where().field("sender_id").eq(1).execute().get();
The problem is selecting DISTINCT columns. This is on android.

It sounds like you want to use Android client SDK for Azure Mobile Apps to write the code for querying the DISTINCT column, but there is not any method directly support it via Query interface on Android client SDK.
The only way is calling a custom API from android client to execute custom SQL statements at the backend server, please refer to the subsection How to: Execute custom SQL statements of the document section Custom APIs and the data/execute method for Node.js backend.

Related

Is it possible to fetch the app analytics data from firebase using java spring boot api [duplicate]

Is there any way i can query in my app for data from the analytics tab of dashboard?
For example:
ref.on("value", function(dashboard) {
console.log(dashboard.concurrentUsers)
});
From the "dashboard.concurrentUsers" in your question, it looks like you're trying to get the data from the Analytics tab of your dashboard.
As of Oct/Nov 2020 there is an Analytics Data API that you can use to run Analytics reports and retrieve data
You can also enable the BigQuery integration. Doing this means that all Google Analytics for Firebase events from that moment on will be written to BigQuery, where you can query them. This is the raw data, the events written by your apps, and not the aggregated data that you find in the dashboard.

Salesforce connector in google sheets to get all events

I am using the extension Salesforce connect to connect google sheets to Salesforce. I have to write a SOQL query to get all events grouped by event owner and import it ti google sheet using Salesforce connect. Its hard to write a query on event, some fields like status are in activities. Please advice how to get events from salesforce using SOQL query and including fields like status in the query

Is there a way to query firebase using java admin sdk without setting an onDataChange event?

I am trying query a firebase database using Java admin sdk. From the examples I see online, looks like I need to set an onchange event and then query the database inside that event handler.
Is there a way to directly query firebase without having to do it inside an event handler?
Not with the Admin SDK. All data retrieval happens asynchronously, and once completed Firebase calls your onDataChange or onChild... method(s).
If you want to have blocking code, you can consider using synchronous HTTP requests to Firebase's REST API. But you won't be using the Admin SDK then.

How to write a function to handle custom query in JPA repository in spring boot java?

Basically I am hosting a database on server side using spring boot. And I wanted to write custom query from client side which is developed in angular and call a function from server side for giving me the needed results.
The function for server side will look like this:
List<rows> func(String customQuery){
//fetch rows from table using this custom query and return those rows
//which I can use in client side.
}
Below are examples of customQuery which I need to send from client side:
select * from table;
select * from table where id>10;
select * from table where id>20 and id<30;
So far I searched in Internet I could not find any solution. Please help.
Sending SQL directly from the client would be a complete security failure, because a malicious user could easily figure out how it works and send a delete from table to kill your entire app.
Much worse, they might even be able to run create user ... to give themselves complete access to your entire database, get sensitive information, install malware, etc.
Instead you'll want to create a REST service in your application with methods such as
GET /table
GET /table?minId=10
GET /table?minId=20&maxId=30
Return as application/json or a similar data format and only return the information your angular app really needs.
Angular would then be responsible for selectively updating the display with your data.
Edit:
This is a guide I have found for creating a basic web app based on Spring Boot and Angular. Might be a good starting point for you:
https://www.baeldung.com/spring-boot-angular-web
The best way is to send only the parameters (minID and maxID in your case) from the client-side and then build the query dynamically on server-side using Spring JPA Specifications.

How to convert BI/reporting Request into SQL statements

I am trying to create a data analytics service that can be used by REST client. REST request needs to send a ANSI SQL queries. Challenge is client/UI team wants to create their own Tableau like drag and drop style user interface where User can see parts of their data and build reports with it. So to bridge the gap between such UI and Analytics service, someone needs to convert form data into SQL Statements (we ruled out json based descriptive rest payload as it doesn't scale for full fledge sql). Datasource Metadata (tables, columns, datatypes etc) is available via REST api to UI so UI can send them back with their API request to some another service which can do SQL transformation. This service can also access API that describe relationships between tables/datasources (join, start-schema etc). so such service has enough information on what kind of SQL queries to form based on user selection. It doesn't need to optimize the query as it will be done by backend data analytics service. Is this seems like a good approach? I wonder UI visualization tool connecting via JDBC to datasources taking same approach. Any other suggestions are welcome.
Also, I can see such middleware service can be a generic framework for development of analytics or cubing visualization tool.

Categories

Resources