GithubHelp home page GithubHelp logo

crud's Introduction

crud

Create, Read, Update, Delete project for Listings table.

directory structure

root
|
|
----> db
|      |
|      -----> create.sql: table creation sql file
|             crud.db: sqlite database file
|             seed.sql: listings table data population (insert) file  
|             sess_prv.py: session provider, which export dbSessionProvider gloval var as a factory instance for session.  
|             tables.py: sqlalchemy table definition file
|
----> logs
|      |
|      -----> main.log: log file. definition is in resources/logging.conf
|       
----> main.py: application entry file
----> test_empty.py:placeholder for pytest
----> README.md:this file
----> requirements.txt:required packages for pip
|
|
----> models
|      |
|      -----> list_mdl.py: Presetation layer input-output model 
|
----> resources  
|      |
|      ----->logging.conf: conficuration file for logging. for details please refer to logging documents
|            settings.py: environment varaibles expected from environment
|
----> services
|      |
|      -----> list_serv.py: service for listing table
|
----> test (pytest is used: all test files should be in this directory)
       |
       -----> test_main.py: tests for main.py 

usage

FastAPI is used for detailed description please refer to the FastApi documents
In order to run use one of the following methods:
1. uvicorn main:router
2. python -m main

In order to test:
pytest

assumptions

If environment variables are not provided or all variables provided and MOCK_DB=='true' then mock_db environment variable is set to true.
  In this case:
    1. sqlite is used as mock_db 
    2. db/crud.db created.
    3. listings table created 
    4. seed.sql is populated
otherwise: It is assumed that connection information for an existing PostgreSQL database is provided.
In that case the following environment parameters should be populated:
    MOCK_DB: 'true'|'false' (if true sqlite is used) 
    DB_HOST: database host name
    DB_NAME: database name
    DB_USER: db user
    DB_PASSWORD: password
    DB_PORT: port

crud's People

Contributors

leventg avatar leventgenc-ai avatar

Watchers

 avatar

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.