24 lines
637 B
C#
24 lines
637 B
C#
using Microsoft.Data.Sqlite;
|
|
namespace Project.Persistence;
|
|
|
|
public class SQLite
|
|
{
|
|
private string _dbPath = "C:/Users/lowns/Desktop/logins.db";
|
|
|
|
public void Init()
|
|
{
|
|
using var connection = new SqliteConnection($"Data Source={_dbPath}");
|
|
connection.Open();
|
|
|
|
var command = connection.CreateCommand();
|
|
command.CommandText =
|
|
@"
|
|
CREATE TABLE IF NOT EXISTS logins (
|
|
loginname STRING PRIMARY KEY NOT NULL,
|
|
loginpass STRING NOT NULL,
|
|
loginemail STRING NOT NULL
|
|
);
|
|
";
|
|
command.ExecuteNonQuery();
|
|
}
|
|
} |