Code Monkey home page Code Monkey logo

db-experiments's Introduction

db-experiments

Trying some stuff out interfacing with a database in fsharp

database setup

Create the local database with:

psql -d postgres -U [username] -f sql/create_db.sql

Set an environment variable named "CONNSTRING_GAMES_LOCAL".

TryHydra

Project to try out (new features of) sqlhydra with a Postgres database. Specifically, I am interested in using Postgres enum types and materialized views.

We use SqlHydra to automatically generate a "database types" module tryHydra/DbTypes.fs (in the repo). Regenerate the hydra file by running:

dotnet sqlhydra npgsql --project tryHydra/TryHydra.fsproj

The first time you do this, you will be promted for some input parameters. These parameters are then saved in a file called sqlhydra-npgsql.toml so you don't have to give the input every time. If you want to change the params, such as which database is being used, you can edit the .toml file directly.

Choose/fill in the following parameters when prompted:

> Enter a database Connection String: Server=localhost;Database=games;Username=<username>;Password=<password>
> Enter an Output Filename (...): tryHydra/DbTypes.fs
> Enter a Namespace (...): Games.DbTypes
> Select a use case: Sqlhydra.Query integration (default)

TryNpgsql

Trying to query the metadata on Postgres materialized views with Npgsql (used in the hydra code).

db-experiments's People

Contributors

janna112358 avatar isaacabraham avatar

Stargazers

arbernardo avatar

Watchers

 avatar  avatar

db-experiments's Issues

Enum columns in materilialized views missing in hydra types

The types generated by hydra include columns of type enum in tables, but not when that column is used in a materialized view.

Could be an issue with the type-name conversion as we encountered before when adding support for materialized views in the first place. Try experimenting with the queries in the tryNpgsql project?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.