0

I am making an app with Xamarin. I try to use database, recommendation (first and only options when Googling) is to use SQLite.

I created Database class:

public class Database
    {
        private readonly SQLiteAsyncConnection db;

        public Database(string dbPath)
        {
            db = new SQLiteAsyncConnection(dbPath);
            db.CreateTableAsync<Patient>();
        }

        public Task<List<Patient>> ReadPatients()
        {
            return db.Table<Patient>().ToListAsync();
        }

        // returns number of updated records
        public Task <int> UpdatePatient(Patient patient)
        {
            return db.UpdateAsync(patient);
        }
    }

I try to use ReadPatients() but there is no point in that because I havent created any tables, I dont know how to see them and where to find them? How can I create tables, configure fields and foreign keys for them and see their content? I am using Visual Studio 2019.

UPDATE To be clear I would like to see table not in a console, or just to know theoretically that it existcs, but I want to see a list of tables (like in PL SQL developer, PHPMYADMIN) where youcan press on a table, select from it and see nice clear view: enter image description here I am starting to think its not really possible with SQLite? What else could I use then?

vytaute
  • 1,260
  • 4
  • 16
  • 36
  • Does this answer your question? [Create SQLite Database and table](https://stackoverflow.com/questions/15292880/create-sqlite-database-and-table) – YungDeiza Feb 28 '23 at 09:15
  • Maybe. As I understand its impossible to see something like a normal table when queried? I added a picture of what I want in my question – vytaute Feb 28 '23 at 11:16
  • 1
    There are numerous tools you can use to view and manage SQLite dbs. Google “SQLite manager” – Jason Feb 28 '23 at 11:44
  • Yes, you can try the database tools such as the SQLiteManger, SQLiteStudio and so on. – Liyun Zhang - MSFT Mar 15 '23 at 08:22

1 Answers1

1

Seems like what you want is some database administration software. SQLite is a library for performing operations on an database - it won't provide a visual view of any databases.

You should have a look at something like MSSQL Management Studio MSSQL Studio Documentation if you want a GUI where you can view and manage databases.

YungDeiza
  • 3,128
  • 1
  • 7
  • 32