blob: dba7cdf6b2c3e9b44252d5278b5e8e6048417fbd [file]
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// DO NOT EDIT IT MANUALLY. This file is generated by opendal/dev/src/generate/dotnet.rs.
using OpenDAL.ServiceConfig.Abstractions;
namespace OpenDAL.ServiceConfig
{
/// <summary>
/// Configuration for service sqlite.
/// </summary>
public sealed class SqliteServiceConfig : IServiceConfig
{
/// <summary>
/// Set the connection_string of the sqlite service. This connection string is used to connect to the sqlite service. The format of connect string resembles the url format of the sqlite client: - `sqlite::memory:` - `sqlite:data.db` - `sqlite://data.db` For more information, please visit &lt;https://docs.rs/sqlx/latest/sqlx/sqlite/struct.SqliteConnectOptions.html&gt;.
/// </summary>
public string? ConnectionString { get; init; }
/// <summary>
/// Set the key field name of the sqlite service to read/write. Default to `key` if not specified.
/// </summary>
public string? KeyField { get; init; }
/// <summary>
/// set the working directory, all operations will be performed under it. default: "/"
/// </summary>
public string? Root { get; init; }
/// <summary>
/// Set the table name of the sqlite service to read/write.
/// </summary>
public string? Table { get; init; }
/// <summary>
/// Set the value field name of the sqlite service to read/write. Default to `value` if not specified.
/// </summary>
public string? ValueField { get; init; }
public string Scheme => "sqlite";
public IReadOnlyDictionary<string, string> ToOptions()
{
var map = new Dictionary<string, string>();
if (ConnectionString is not null)
{
map["connection_string"] = Utilities.ToOptionString(ConnectionString);
}
if (KeyField is not null)
{
map["key_field"] = Utilities.ToOptionString(KeyField);
}
if (Root is not null)
{
map["root"] = Utilities.ToOptionString(Root);
}
if (Table is not null)
{
map["table"] = Utilities.ToOptionString(Table);
}
if (ValueField is not null)
{
map["value_field"] = Utilities.ToOptionString(ValueField);
}
return map;
}
}
}