All Projects → jhartwell → Plsm

jhartwell / Plsm

Licence: mit
Generates Ecto models from already existing tables

Labels

Projects that are alternatives of or similar to Plsm

Pghero.sql
Postgres insights made easy
Stars: ✭ 155 (-29.86%)
Mutual labels:  plpgsql
Sql Battleships
Play Battleships on PostgreSQL
Stars: ✭ 174 (-21.27%)
Mutual labels:  plpgsql
3dcitydb
3D City Database - The Open Source CityGML Database
Stars: ✭ 210 (-4.98%)
Mutual labels:  plpgsql
Postgresdbsamples
Sample databases for postgres
Stars: ✭ 161 (-27.15%)
Mutual labels:  plpgsql
Dox
A Document Database API extension for Postgres
Stars: ✭ 168 (-23.98%)
Mutual labels:  plpgsql
Pagila
PostgreSQL Sample Database
Stars: ✭ 190 (-14.03%)
Mutual labels:  plpgsql
Chicago Atlas
View citywide information about health trends and take action near you to improve your own health.
Stars: ✭ 152 (-31.22%)
Mutual labels:  plpgsql
Freedom
capstone based disassembler for extracting to binnavi
Stars: ✭ 214 (-3.17%)
Mutual labels:  plpgsql
Colpivot
Dynamic row to column pivotation/transpose in Postgres made simple.
Stars: ✭ 173 (-21.72%)
Mutual labels:  plpgsql
Schemaverse
The Schemaverse is a space-based strategy game implemented entirely within a PostgreSQL database. Compete against other players using raw SQL commands to command your fleet. Or, if your PL/pgSQL-foo is strong, wield it to write AI and have your fleet command itself!
Stars: ✭ 207 (-6.33%)
Mutual labels:  plpgsql
Docker Compose
一些基础服务的docker-compose配置文件,方便在一台新电脑上快速开始工作
Stars: ✭ 163 (-26.24%)
Mutual labels:  plpgsql
Learn Sql The Hard Way
http://sql.learncodethehardway.org/book/
Stars: ✭ 168 (-23.98%)
Mutual labels:  plpgsql
Amazon Redshift Udfs
A collection of example UDFs for Amazon Redshift.
Stars: ✭ 194 (-12.22%)
Mutual labels:  plpgsql
Wikipedia Mirror
🌐 Guide and tools to run a full offline mirror of Wikipedia.org with three different approaches: Nginx caching proxy, Kimix + ZIM dump, and MediaWiki/XOWA + XML dump
Stars: ✭ 160 (-27.6%)
Mutual labels:  plpgsql
Store
PostgreSQL shopping cart
Stars: ✭ 213 (-3.62%)
Mutual labels:  plpgsql
Cisl
Columnstore Indexes Scripts Library
Stars: ✭ 155 (-29.86%)
Mutual labels:  plpgsql
Postgis coordinate transform
一个在postgis中结合中国国情,批量对数据进行加偏到百度坐标,高德谷歌的火星坐标,或者逆向纠偏
Stars: ✭ 182 (-17.65%)
Mutual labels:  plpgsql
Postgis Vt Util
postgres helper functions for making vector tiles
Stars: ✭ 216 (-2.26%)
Mutual labels:  plpgsql
Dbt Utils
Utility functions for dbt projects.
Stars: ✭ 212 (-4.07%)
Mutual labels:  plpgsql
Pgjwt
PostgreSQL implementation of JWT (JSON Web Tokens)
Stars: ✭ 198 (-10.41%)
Mutual labels:  plpgsql

Plsm (Formerly Plasm)- Ecto model generation

Plsm generates Ecto models based on existing database tables in your database. Currently, Ecto only allows the ability to create migrations that creates new tables/schemas. If you have an existing project that you want to add Ecto support for you would have to hand code the models. This can be tedious for tables that have many columns.

Getting Plsm

You can add

{:plsm, "~> 2.3.2"}

to deps in your mix.exs and that will download the package for you

Running Plsm

First, in order to run plsm, you need to generate a config file. You do this by running

mix plsm.config --config-file <name>

This will create a skeleton config file to the given config file. If you don't specify a config.exs file the config will then be appended to the "config/config.exs" file. If you are using another structure, such as Phoenix, then you need to pass in your dev.exs, since this is a dev only process. You will need to make changes to the generated Plsm configs in the config file in order to allow Plsm to function correctly.

Once you have your config file generated then you are ready to run plsm. You do this by running

mix plsm

You are able to change the location of the model file output in the configuration file

Configuration Options

  • module_name -> This is the name of the module that the models will be placed under
  • destination -> The output location for the generated models. If this is not provided then the models will go in the directory that you ran plsm in
  • server -> this is the name of the server that you are connecting to. It can be a DNS name or an IP Address. This needs to be filled in as there are no defaults
  • port -> The port that the database server is listening on. This needs to be provided as there may not be a default for your server
  • database_name -> the name of the database that you are connecting to. This is required.
  • username -> The username that is used to connect. Make sure that there is sufficient privileges to be able to connect, query tables as well as query information schemas on the database. The schema information is used to find the index/keys on each table
  • password -> This is necessary as there is no default nor is there any handling of a blank password currently.
  • type -> This dictates which database vendor you are using. We currently support PostgreSQL and MySQL. If no value is entered then it will default to MySQL. Accepted values: :mysql or :postgres. Do note that this is an atom and not a string

Supported Databases

We currently support the following databases:

  • MySQL
  • PostgreSQL

We may add support to other databases based on demand. Please reach out and if you want a specific database supported. Please feel free to contribute commits that add different database vendor support!

If you have any questions you can reach me via email at [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].