![]() |
VOOZH | about |
This article illustrates using LINQ to access tables within the Presto via the CData ADO.NET Data Provider for Presto. To achieve this, we will use LINQ to Entity Framework, which facilitates the generation of connections and can be seamlessly employed with any CData ADO.NET Data Providers to access data through LINQ.
Accessing and integrating live data from Trino and Presto SQL engines has never been easier with CData. Customers rely on CData connectivity to:
Presto and Trino allow users to access a variety of underlying data sources through a single endpoint. When paired with CData connectivity, users get pure, SQL-92 access to their instances, allowing them to integrate business data with a data warehouse or easily access live data directly from their preferred tools, like Power BI and Tableau.
In many cases, CData's live connectivity surpasses the native import functionality available in tools. One customer was unable to effectively use Power BI due to the size of the datasets needed for reporting. When the company implemented the CData Power BI Connector for Presto they were able to generate reports in real-time using the DirectQuery connection mode.
See the help documentation for a guide to setting up an EF 6 project to use the provider.
Enter your data source connection information.
Set the Server and Port connection properties to connect, in addition to any authentication properties that may be required.
To enable TLS/SSL, set UseSSL to true.
In order to authenticate with LDAP, set the following connection properties:
In order to authenticate with KERBEROS, set the following connection properties:
Below is a typical connection string:
Server=127.0.0.1;Port=8080;
Using the entity you created, you can now perform select , update, delete, and insert commands. For example:
PrestoEntities context = new PrestoEntities();
var customerQuery = from customer in context.Customer
select customer;
foreach (var result in customerQuery) {
Console.WriteLine("{0} {1} ", result.Id, result.FirstName);
}
See "LINQ and Entity Framework" chapter in the help documentation for example queries of the supported LINQ.
Download a free trial of the Presto Data Provider to get started:
Download NowLearn more:
👁 Presto IconRapidly create and deploy powerful .NET applications that integrate with Presto.