Tuesday, 9 May 2023

A sqlite database explorer written in Prolog

Introduction

This post presents a simple explorer for sqlite databases. It can find out all table names of the sqlite file as well as the number of rows kept by each table. In addition, it can also disclose all column names of the tables and shows the data type for each column.

Notice that this script uses the predicate select_query to send a SQL command to sqlite for retreiving the table names of the given database.

As a demonstration, the prolog script below opens a sample sqlite file found on GitHub. Please refer to the link below for its setup.

Database Source: https://github.com/dtaivpp/car_company_database

Output

Source Code

No comments:

Post a Comment