Skip to content

Instantly share code, notes, and snippets.

View anehir's full-sized avatar

Abdullah Nehir anehir

View GitHub Profile
@anehir
anehir / podman_postgres
Last active February 12, 2024 20:34
start postgresql server and pgadmin on the same pod with podman
# create pod
podman pod create --name postgrespod -p 9876:80 -p 5432:5432
# add pgadmin container
podman run --pod=postgrespod --name pgadmin12 -e 'PGADMIN_DEFAULT_EMAIL=postgres@postgres.me' -e 'PGADMIN_DEFAULT_PASSWORD=postgres' -d docker.io/dpage/pgadmin4:latest
# run below line only once
# podman pull docker.io/library/postgres:latest
# add postgres container
mkdir ~/src/db/dev
podman run --pod=postgrespod --name db -v ~/src/db/dev:/var/lib/postgresql/data:Z -d -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres docker.io/library/postgres:latest
@anehir
anehir / EfPocoGenerator.sql
Last active December 20, 2016 11:49
Generates POCO classes for entity framework for all the tables in current database. Considers primary keys, foreign keys, and writes object descriptions saved as extended properties to the comments of classes.
set nocount on
declare @namespace varchar(500)
declare @schemaName varchar(50)
set @namespace = 'ConsoleApplication3.Data'
set @schemaName = 'dbo'
declare @typeMap table(sqlName varchar(50), dotNetName varchar(50), isNullable bit)