using System;
using Microsoft.Data.Sqlite;
using Database.Dto;
using Team1;        // Team 1
using Team2;        // Team 2
using Team3;        // Team 3
using Team4;        // Team 4


public class Program
{
    public static void Main()
    {
        string db = "Database.sqlite";
        string connectionString = "Data Source=" + db;

        try
        {
            using (var connection = new SqliteConnection(connectionString))
            {
                connection.Open();
                try
                {
                    Database.Database.CreateDatabaseQuery(connection);
                }
                catch
                {
                    Console.WriteLine("Database already exists.");
                }


                using (var command = connection.CreateCommand())
                {
                    // implment stuff here idc
                    AuthorDto author = Team2.Team2.AddAuthor(connection, "John", "Doe", new DateTime(1990, 1, 1));
                    AuthorDto getAuthor = Team4.Team4.GetAuthorById(connection, author.Id);

                    

                }

            }
        }
        catch (SqliteException ex)
        {
            Console.WriteLine($"{ex.Source}: {ex.Message}");
        }
    }
}
