GithubHelp home page GithubHelp logo

ground's Introduction

Ground

Ground is a ground-setup library for creating new Go service projects. The creation of ground has a story which is better described here

ground's People

Contributors

vaibhav-kaushal avatar bhagatvansh avatar theankitbhardwaj avatar itishrishikesh avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ground's Issues

Code Generator: Create a check for config validator

Currently, some parts of the code generator might try to work with wrong config (like a missing package name for DB or network files that get generated) or the path where they are stored or checking for permissions. We need to fix all that. We need to have those checks in place.

Code Generator: Fix the duplicate function name issue in case of single table multiple fkey to another table

If we have two tables where table A is being referenced by table B twice using foreign key, then the reverse-reference functions being generated by the generator for table A to load something from table B have duplicate function names.

For Example in a schema like this:

public.followers.follower_id -> public.users.id
public.followers.following_id -> public.users.id

The code generator will create two functions with the name GetConnectedFollowerListFromDbByUserId for struct PublicUsers struct (the struct corresponding to the public.users table).

One of the functions will have the following query line:

query := `SELECT * FROM public.followers WHERE follower_id = $1;`

while the other one would have this:

query := `SELECT * FROM public.followers WHERE following_id = $1;`

While the code is correct, the duplicate function names won't let the program compile. We need to fix that!

Code Generator: Single schema code generation

Right now, the code generator will create SQL queries which contain the schema name in front of the table name. Like this:

SELECT * FROM "public.users" WHERE "email" = $1

This looks ugly when there is just one schema in the database, which would usually be the case. We have to create the option to generate SQL queries without the schema name in front of tables when only one schema is present so that the query looks more like:

SELECT * FROM "users" WHERE "email" = $1

Code Generator: Add option to control the reader DB instance code generation

Right now, the code generator builds code which can handle both a writer DB connection and a reader DB connection. In most standard cases, the user would probably be wanting to use only one DB connection which is both reader and writer, thus making the reader DB connection redundant.

We should update the code generator to make sure that the redundant code is not being generated by default.

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.