Aerospike for LINQPad
Tags: linqpad, aerospike, linq, dotnet
Published: 2023-04-20 17:35:06


<div className="text--center">

![](https://developer-hub.s3.us-west-1.amazonaws.com/78458717/aerospikeLinqpad_1681249300211.png)

</div>

This blog explores the new Aerospike driver for LINQPad and its available features. Aerospike for LINQPad 7 is a data context dynamic driver for interactively querying and updating an [Aerospike ](https://aerospike.com/) database using "[LINQPad](https://www.linqpad.net/)". LINQPad is a Graphical Development Tool designed for rapid prototyping, data modeling, data mining, drag-and-drop execution, interactive debugging/testing, quickly learn new frameworks/APIs (e.g., [Aerospike API](https://developer.aerospike.com/client/csharp) ), etc. The Aerospike driver for LINQPad is designed to support all LINQPad features.
<!--truncate-->
Here is a subset of what you can perform using the driver:

- Query any [Aerospike Set](https://docs.aerospike.com/server/architecture/data-model) or [Secondary Index](https://docs.aerospike.com/server/architecture/secondary-index) using any [LINQ ](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/) command (including joins), interactively.

- Use the driver’s extension methods to perform operations like [Aerospike Expression](https://docs.aerospike.com/server/guide/expressions) , CRUD operations, etc. without understanding the underlying Aerospike API.

- Serialize and deserialize any C# object via the Object-Mapper (POCO). The driver supports all C# data types, nested classes, and collections.

- Full JSON support using [Json.NET](https://www.newtonsoft.com/json).

- Execute [UDF](https://docs.aerospike.com/server/guide/udf)s directly and display their underlying code. UDFs are treated like C# methods with intellisense and code completion.

- Export or import sets directly or with an [Aerospike Filter](https://docs.aerospike.com/server/operations/configure/cross-datacenter/filters) .

- Provides metadata about the cluster, including active/inactive nodes, Aerospike server version, etc.

- Use the [Aerospike API](https://developer.aerospike.com/client/csharp) directly to perform advance operations or instantly test snippets used in your application code.

The driver can, also, dynamically detect the structure of records within an Aerospike Set resulting in an easy-to-understand view much like a relational table with enhanced capabilities. Some of these capabilities are:

- detection of [Bins](https://docs.aerospike.com/server/architecture/data-model) with the same name but have different data types between records within a Set

- records with different Bin structures within a Set

- implicit data type conversion without the need to cast or check a Bin's data type for quick data operations

- enhanced [Aerospike CDT](https://docs.aerospike.com/server/guide/data-types/cdt) handling

- driver extension methods to programmatically interrogate Namespaces, Sets, records, Bins, Bin data types, etc.

The screenshot below show how Aerospike Sets and Bins are represented in LinqPad:

<div className="text--center">

![](https://developer-hub.s3.us-west-1.amazonaws.com/1196964679/DupBinTypeInRecordDialog_1680555132209.png)

_Aerospike Namespaces, Sets, Bins, etc. Representation in LINQPad_

</div>

The LINQPad connection pane displays the different Aerospike components in an hierarchical manner where namespace is under Aerospike cluster connection. Aerospike sets are under namespaces, and bins are under sets. Below screenshot shows the relationship between these components:

<div className="text--center">

![](https://developer-hub.s3.us-west-1.amazonaws.com/1196964679/ClusterNamespaceSetBinsDialog_1680555260863.png)

</div>

You can drag-and-drop each component onto the LINQPad Query pane to be executed by LINQPad. The execution behavior depends on the component. For example, a set or secondary index will present the records within that component. For other components, the properties are displayed. In all cases, you can always execute the driver’s extension methods. These extension methods, greatly simplify Aerospike API commands like `get`, `put`, `query`, `operate`, etc.  You can also import or export data. Of course, you can always use LINQ against Aerospike sets or secondary indexes. An example of some of the driver extensions follows:

<div className="text--center">

![](https://developer-hub.s3.us-west-1.amazonaws.com/1196964679/NamespaceShowMethods_1680555316745.png)

_IntelliSense Showing Some of the Extension Methods and Properties on a Set Object_

</div>

For detailed information about the Aerospike LINQPad driver, see the [ReadMe file in GitHub](https://github.com/aerospike-community/aerospike-linqpad-driver) .

## Installation

You can install the Aerospike Driver directly from the [LINQPad NuGet Manager](https://www.linqpad.net/CodeSnippetIDE.aspx) or from the [GitHub Repo](https://github.com/aerospike-community/aerospike-linqpad-driver).

### LINQPad NuGet Manager

1. Open LINQPad.

2. Click Add Connection Link.

3. Select  **View more drivers…**.

4. Select **Show all drivers**, and then type **Aerospike**.

5. Click **Install**.

### Manual (GitHub)

1. Obtain the latest driver (.LPX6 file) from the [Driver folder](https://github.com/aerospike-community/aerospike-linqpad-driver/tree/main/Driver) in GitHub and download it to your computer.

2. Open LINQPad.

3. Click **Add Connection Link**.

4. Click **View more drivers…**

5. Click **Install driver from .LPX6 file…** and select downloaded lpx6 file.