Skip to content

Commit

Permalink
feat: omitExtensionCreation is added to PostgresVectorDatabase.cs (#33)
Browse files Browse the repository at this point in the history
* Option to omit Extension creation

Since not all DB admins like to share SU roles to access applications.

* omitExtensionCreation filed added to PostgresVectorDB file

Making sure that the parameter can be passed from the actual creation point.

* Update PostgresVectorDatabase.cs
  • Loading branch information
vibeeshan025 authored Aug 29, 2024
1 parent 2acb027 commit cee4a5c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Postgres/src/PostgresVectorDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ namespace LangChain.Databases.Postgres;
[RequiresUnreferencedCode("Requires unreferenced code.")]
public class PostgresVectorDatabase(
string connectionString,
string schema = PostgresVectorDatabase.DefaultSchema)
string schema = PostgresVectorDatabase.DefaultSchema,
bool omitExtensionCreation = false)
: IVectorDatabase
{
private const string DefaultSchema = "public";

private readonly PostgresDbClient _client = new(connectionString, schema);
private readonly PostgresDbClient _client = new(connectionString, schema, omitExtensionCreation);

/// <inheritdoc />
public async Task<IVectorCollection> GetCollectionAsync(string collectionName, CancellationToken cancellationToken = default)
Expand Down Expand Up @@ -67,4 +68,4 @@ public Task<IReadOnlyList<string>> ListCollectionsAsync(CancellationToken cancel
{
return _client.ListTablesAsync(cancellationToken);
}
}
}

0 comments on commit cee4a5c

Please sign in to comment.