Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions _data/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ docs:
url: "/tutorial/get-started-telemetry"
description: "Learn on how to start capturing and publishing RepoDB operation telemetry using RepoDb.Telemetry.Default."

- title: "Vertica"
url: "/tutorial/get-started-vertica"
description: "Learn on how to work with Vertica databases using RepoDB library."

# - title: "Installation"
# url: "/tutorial/installation"

Expand Down Expand Up @@ -1008,6 +1012,12 @@ docs:
- title: "Firebird (Bulk)"
url: "/release/firebirdbulk"

- title: "Vertica"
url: "/release/vertica"

- title: "Vertica (Bulk)"
url: "/release/verticabulk"

- title: "Telemetry (Core)"
url: "/release/telemetry-core"

Expand Down
51 changes: 51 additions & 0 deletions pages/attributes/vertica/sourcecolumn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
layout: default
title: SourceColumn
permalink: /attribute/vertica/sourcecolumn
tags: [repodb, attribute, sourcecolumn]
parent: "Vertica"
grand_parent: ATTRIBUTES
---

# SourceColumn

---

This attribute sets the `VerticaParameter.SourceColumn` property value via a class property.

### Attribute

Example usage:

```csharp
public class Person
{
public int Id { get; set; }

[SourceColumn("Name")]
public string Name { get; set; }
}
```

### Fluent Mapping

To configure via [FluentMapper](/mapper/fluentmapper):

```csharp
FluentMapper
.Entity<Person>()
.PropertyValueAttributes(e => e.Name, new SourceColumnAttribute("Name"));
```

### Retrieval

Retrieve the attribute via [PropertyValueAttributeCache](/cacher/propertyvalueattributecache):

```csharp
var attribute = PropertyValueAttributeCache
.Get<Person>(e => e.Name)?
.FirstOrDefault(e => e.GetType() == typeof(SourceColumnAttribute));
```

{: .important }
> We strongly recommend using [PropertyValueAttributeCache](/cacher/propertyvalueattributecache) for maximum performance.
51 changes: 51 additions & 0 deletions pages/attributes/vertica/sourcecolumnnullmapping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
layout: default
title: SourceColumnNullMapping
permalink: /attribute/vertica/sourcecolumnnullmapping
tags: [repodb, attribute, sourcecolumnnullmapping]
parent: "Vertica"
grand_parent: ATTRIBUTES
---

# SourceColumnNullMapping

---

This attribute sets the `VerticaParameter.SourceColumnNullMapping` property value via a class property.

### Attribute

Example usage:

```csharp
public class Person
{
public int Id { get; set; }

[SourceColumnNullMapping(true)]
public string Name { get; set; }
}
```

### Fluent Mapping

To configure via [FluentMapper](/mapper/fluentmapper):

```csharp
FluentMapper
.Entity<Person>()
.PropertyValueAttributes(e => e.Name, new SourceColumnNullMappingAttribute(true));
```

### Retrieval

Retrieve the attribute via [PropertyValueAttributeCache](/cacher/propertyvalueattributecache):

```csharp
var attribute = PropertyValueAttributeCache
.Get<Person>(e => e.Name)?
.FirstOrDefault(e => e.GetType() == typeof(SourceColumnNullMappingAttribute));
```

{: .important }
> We strongly recommend using [PropertyValueAttributeCache](/cacher/propertyvalueattributecache) for maximum performance.
51 changes: 51 additions & 0 deletions pages/attributes/vertica/sourceversion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
layout: default
title: SourceVersion
permalink: /attribute/vertica/sourceversion
tags: [repodb, attribute, sourceversion]
parent: "Vertica"
grand_parent: ATTRIBUTES
---

# SourceVersion

---

This attribute sets the `VerticaParameter.SourceVersion` property value via a class property.

### Attribute

Example usage:

```csharp
public class Person
{
public int Id { get; set; }

[SourceVersion(DataRowVersion.Current)]
public string Name { get; set; }
}
```

### Fluent Mapping

To configure via [FluentMapper](/mapper/fluentmapper):

```csharp
FluentMapper
.Entity<Person>()
.PropertyValueAttributes(e => e.Name, new SourceVersionAttribute(DataRowVersion.Current));
```

### Retrieval

Retrieve the attribute via [PropertyValueAttributeCache](/cacher/propertyvalueattributecache):

```csharp
var attribute = PropertyValueAttributeCache
.Get<Person>(e => e.Name)?
.FirstOrDefault(e => e.GetType() == typeof(SourceVersionAttribute));
```

{: .important }
> We strongly recommend using [PropertyValueAttributeCache](/cacher/propertyvalueattributecache) for maximum performance.
13 changes: 13 additions & 0 deletions pages/attributes/vertica/vertica.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: default
title: "Vertica"
has_children: true
permalink: /attribute/vertica
parent: ATTRIBUTES
---

# Attributes
{: .fs-9 }

Attributes for decorating VerticaParameter objects.
{: .fs-6 .fw-300 }
51 changes: 51 additions & 0 deletions pages/attributes/vertica/verticatype.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
layout: default
title: VerticaType
permalink: /attribute/vertica/verticatype
tags: [repodb, attribute, verticatype]
parent: "Vertica"
grand_parent: ATTRIBUTES
---

# VerticaType

---

This attribute sets the `VerticaParameter.Type` property value via a class property.

### Attribute

Example usage:

```csharp
public class Person
{
public int Id { get; set; }

[VerticaType(VerticaType.VarChar)]
public string Name { get; set; }
}
```

### Fluent Mapping

To configure via [FluentMapper](/mapper/fluentmapper):

```csharp
FluentMapper
.Entity<Person>()
.PropertyValueAttributes(e => e.Name, new VerticaTypeAttribute(VerticaType.VarChar));
```

### Retrieval

Retrieve the attribute via [PropertyValueAttributeCache](/cacher/propertyvalueattributecache):

```csharp
var attribute = PropertyValueAttributeCache
.Get<Person>(e => e.Name)?
.FirstOrDefault(e => e.GetType() == typeof(VerticaTypeAttribute));
```

{: .important }
> We strongly recommend using [PropertyValueAttributeCache](/cacher/propertyvalueattributecache) for maximum performance.
31 changes: 31 additions & 0 deletions pages/classes/vertica/dbtypenametocolumnnameresolver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
layout: default
sidebar: classes
title: "DbTypeNameToColumnNameResolver"
description: "A class used to resolve a Vertica database type name into its equivalent base Vertica column type keyword."
permalink: /class/vertica/dbtypenametocolumnnameresolver
tags: [repodb, dbtypenametocolumnnameresolver, vertica]
parent: "Vertica"
grand_parent: CLASSES
---

# DbTypeNameToColumnNameResolver

---

This [IResolver](/interface/iresolver)`<string, string>` implementation converts a Vertica database type name — e.g. a [DbField](/class/dbfield)'s `DatabaseType` — into its equivalent *base* Vertica column type keyword (e.g. `numeric` → `NUMERIC`, `varchar` → `VARCHAR`). Sized types (`numeric`, `decimal`, `char`, `varchar`, `binary`, `varbinary`) are returned without their `(precision,scale)`/`(size)` portion — the caller is expected to append that using the field's own precision/scale/size. An unrecognized database type falls back to `LONG VARCHAR`, Vertica's large-text type.

It is used internally by [RepoDb.Vertica.BulkOperations](https://www.nuget.org/packages/RepoDb.Vertica.BulkOperations) to generate the column definitions of the pseudo (staging) table backing `BulkMerge`, `BulkUpdate`, `BulkDelete`, `BulkDeleteByKey`, and `BulkInsert` with [VerticaBulkImportIdentityBehavior.ReturnIdentity](/enumeration/vertica/verticabulkimportidentitybehavior).

{: .note }
> This class shares its unqualified name with Firebird's own [DbTypeNameToColumnNameResolver](/class/firebird/dbtypenametocolumnnameresolver) — the two live in separate assemblies/namespaced provider folders, so there is no compile-time conflict, but the same name resolves differently depending on which provider package is referenced.

## Usability

```csharp
var resolver = new DbTypeNameToColumnNameResolver();
var baseType = resolver.Resolve("decimal"); // "DECIMAL"

// The caller appends sizing itself, e.g.:
var columnType = $"{baseType}({field.Precision ?? 18},{field.Scale ?? 0})"; // "DECIMAL(18,2)"
```
23 changes: 23 additions & 0 deletions pages/classes/vertica/dbtypetoverticastringnameresolver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
layout: default
sidebar: classes
title: "DbTypeToVerticaStringNameResolver"
description: "A class used to resolve a DbType into its equivalent Vertica database string name."
permalink: /class/vertica/dbtypetoverticastringnameresolver
tags: [repodb, dbtypetoverticastringnameresolver, vertica]
parent: "Vertica"
grand_parent: CLASSES
---

# DbTypeToVerticaStringNameResolver

---

This [IResolver](/interface/iresolver)`<DbType, string>` implementation converts a .NET `DbType` into its equivalent Vertica SQL type name (e.g. `DbType.String` → `VARCHAR(8191)`, `DbType.Guid` → `UUID`, `DbType.Binary` → `VARBINARY(65000)`). It is used internally by [VerticaConvertFieldResolver](/class/vertica/verticaconvertfieldresolver) to build `CAST(...)` expressions.

## Usability

```csharp
var resolver = new DbTypeToVerticaStringNameResolver();
var typeName = resolver.Resolve(DbType.Int64); // "BIGINT"
```
28 changes: 28 additions & 0 deletions pages/classes/vertica/timetodatetimepropertyhandler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
layout: default
sidebar: classes
title: "TimeToDateTimePropertyHandler"
description: "A property handler that re-bases the date component of a value read back from a Vertica TIME column."
permalink: /class/vertica/timetodatetimepropertyhandler
tags: [repodb, timetodatetimepropertyhandler, vertica]
parent: "Vertica"
grand_parent: CLASSES
---

# TimeToDateTimePropertyHandler

---

Vertica's driver returns a `TIME` column's value combined with today's date rather than a fixed placeholder date. This [IPropertyHandler](/interface/ipropertyhandler) re-bases the date component of a value read back from a `TIME` column onto `DateTime`'s default (`0001-01-01`) date, keeping only its time-of-day. `Set` passes the value through unchanged — Vertica only stores the time-of-day portion of a bound value in a `TIME` column regardless of its date component.

{: .important }
> This class lives in the `RepoDb.PropertyHandlers.Vertica` namespace. A second, near-identical class named `VerticaTimeToDateTimePropertyHandler` also exists in the plain `RepoDb.PropertyHandlers` namespace — it is not referenced anywhere in the library or its test suite and appears to be leftover duplicate code from a refactor. Prefer `TimeToDateTimePropertyHandler` (this class), which is the one the library's own integration tests register.

## Usability

Register it explicitly, scoped to the specific entity property that maps to a `TIME` column.

```csharp
PropertyHandlerMapper.Add<Person, DateTime>(
e => e.StartTime, new RepoDb.PropertyHandlers.Vertica.TimeToDateTimePropertyHandler(), true);
```
15 changes: 15 additions & 0 deletions pages/classes/vertica/vertica.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
layout: default
title: "Vertica"
has_children: true
permalink: /class/vertica
parent: CLASSES
---

# Classes (Vertica)

---

Classes specific to the Vertica data provider ([RepoDb.Vertica](https://www.nuget.org/packages/RepoDb.Vertica), built on [Vertica.Data](https://www.nuget.org/packages/Vertica.Data)). These cover connection bootstrapping and configuration ([VerticaBootstrap](/class/vertica/verticabootstrap), [VerticaConfiguration](/class/vertica/verticaconfiguration)), schema discovery ([VerticaDbHelper](/class/vertica/verticadbhelper)), SQL generation ([VerticaStatementBuilder](/class/vertica/verticastatementbuilder)), provider settings ([VerticaDbSetting](/class/vertica/verticadbsetting)), type resolution between .NET, `DbType` and Vertica types ([DbTypeToVerticaStringNameResolver](/class/vertica/dbtypetoverticastringnameresolver), [VerticaDbTypeNameToClientTypeResolver](/class/vertica/verticadbtypenametoclienttyperesolver), [VerticaConvertFieldResolver](/class/vertica/verticaconvertfieldresolver), [DbTypeNameToColumnNameResolver](/class/vertica/dbtypenametocolumnnameresolver)), and a property handler for a CLR type mismatch with no native Vertica equivalent ([TimeToDateTimePropertyHandler](/class/vertica/timetodatetimepropertyhandler)).

Also included are the support classes used by the [Vertica bulk operations](/operation/vertica) ([VerticaBulkInsertMapItem](/class/vertica/verticabulkinsertmapitem), [VerticaTraceKeys](/class/vertica/verticatracekeys)), part of the separate [RepoDb.Vertica.BulkOperations](https://www.nuget.org/packages/RepoDb.Vertica.BulkOperations) package.
38 changes: 38 additions & 0 deletions pages/classes/vertica/verticabootstrap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
layout: default
sidebar: classes
title: "VerticaBootstrap"
description: "A class that is being used to initialize the necessary settings for the VerticaConnection object."
permalink: /class/vertica/verticabootstrap
tags: [repodb, verticabootstrap, vertica]
parent: "Vertica"
grand_parent: CLASSES
---

# VerticaBootstrap

---

This class initializes the necessary dependencies for the `VerticaConnection` object — the [DbSetting](/class/vertica/verticadbsetting), [DbHelper](/class/vertica/verticadbhelper) and [StatementBuilder](/class/vertica/verticastatementbuilder) — and registers them via their respective mappers.

## Properties

| Name | Description |
|:-----|:------------|
| IsInitialized | Returns `true` once the initialization has completed. |

## Usability

Call [VerticaConfiguration.UseVertica()](/class/vertica/verticaconfiguration) during application start-up; it triggers this class internally.

```csharp
GlobalConfiguration
.Setup()
.UseVertica();
```

{: .note }
> Initialization is a one-time, idempotent operation — calling `UseVertica()` more than once has no additional effect.

{: .important }
> Initialization also forces `CultureInfo.CurrentCulture` to `CultureInfo.InvariantCulture` for the calling thread, and for every subsequently-created thread in the process, working around `Vertica.Data` formatting date-like parameter values using the ambient thread culture instead of the invariant one.
Loading
Loading