This demo application creates sets up and populates a postgresql database using various programming languages.
It loads the person table with random X number of random people with names from the census https://www.census.gov/topics/population/genealogy/data/2010_surnames.html.
The /data folder contains datasets used for random name generation. The /scripts folder has SQL and DDL.
The general flow of the application is as follows:
- Creates person table (drops if exists)
- Loads a few files into variables for sample data
- Call the person generator and pass in the variables from the files
- Insert the people into the person table
Take a look at the [OBSERVATIONS.md] to see a table of the performance of the various languages/frameworks.
- Connection to a PostgreSQL database
- Basic understanding of SQL
- First name and last name list
- I recommend downloading the three lists as csv at https://www.census.gov/topics/population/genealogy/data/1990_census/1990_census_namefiles.html
- VSCode
- Plugins
- markdownlint (David Anson)
- Markdown Preview Enhanced (Yiyi Wang)
- PostgreSQL (Chris Kolkman)
- Plugins
- Install python
- Install a package manager (pretty sure pip comes w/ python installer above by default)
- Install the PostgreSQL database adapter: psycopg2 (about)
- Open a command prompt and run
pip install psycopg2
- Open a command prompt and run
- d
- Open VSCode
- Open the driver.ps1 file
- Download and extract a few required DLLs from NuGet .nupkg files. (download, then rename the .nupkg to .zip and extract these files to the powershell folder)
- Run it by pressing F5
The files in the scripts/PowerShell folder
File | Description |
---|---|
database_setup.ps1 | Runs the create database scripts |
So far, it appears that there isn't a good way to connect to postgresql from powershell w/o usnig odbc. However, I imagine I should be able to import npgsql. Will explore