Giter VIP home page Giter VIP logo

bdc-db's People

Contributors

fabianazioti avatar gqueiroz avatar raphaelrpl avatar

Watchers

 avatar  avatar  avatar  avatar

bdc-db's Issues

Add support for multiple schemas

The packages LCCS-DB and BDC-Catalog store tables in different schemas. Packages could register the name of the schemas used inside. Then the CLI could use this register to create the namespaces.

Command-Line Interface (CLI)

The db command group should have the following commands:

  • init - Initialize a database instance.

  • create-schema - Create database schema (tables).

  • drop-schema - Drop database schema (tables).

  • destroy - Destroy database instance.

Review libraries dependencies

We should review the package base libraries and their dependencies to help pip to solve dependency graph instead making alot downloads.

Add PostGIS spatial_ref_sys support

The table PostGIS spatial_ref_sys table can be used in different packages. The BDC-Catalog package has a model for this table and could move its definition to the BDC-DB package.

Cannot import name '_ColumnEntity' from 'sqlalchemy.orm.query'

File "/usr/local/lib/python3.7/site-packages/bdc_db/cli.py", line 15, in <module>
--
  File "/usr/local/lib/python3.7/site-packages/bdc_db/cli.py", line 15, in <module>
    from sqlalchemy_utils.functions import (create_database, database_exists,
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/__init__.py", line 1, in <module>
    from .aggregates import aggregated  # noqa
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/aggregates.py", line 372, in <module>
    from .functions.orm import get_column_key
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/functions/__init__.py", line 1, in <module>
    from .database import (  # noqa
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py", line 11, in <module>
    from .orm import quote
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/functions/orm.py", line 14, in <module>
    from sqlalchemy.orm.query import _ColumnEntity
ImportError: cannot import name '_ColumnEntity' from 'sqlalchemy.orm.query' 

Related with sqlalchemy/sqlalchemy#6000

Review the required dependency Flask-SQLAlchemy

We should consider to remove the Flask-SQLAlchemy and use SQLAlchemy directly. It allow us to extend our library on others frameworks like FastAPI.

Keep in mind to configure database model to support mult-threaded sessions.

Document CLI

  • command added to db command group

  • alembic command group for managing upgrade recipes

Review load-scripts command line: specify application only

The command line load-scripts should have an option to load specific module name scripts.

For example:
If we have bdc_collectors, myapp and myotherapp registered, and i would like to load only data from bdc_collectors and myapp:

bdc-db load-scripts --modules bdc_collectors,myapp

CLI command load-file got an unexpected keyword

When executing the CLI load-file command the following message appears:

click.echo(f'Loading file {file}...', bold=True, fg='yellow')
TypeError: echo() got an unexpected keyword argument 'bold'

Suggestion:

Change click.echo to click.secho.

Release Version 0.4.0

Tasks:

  • Inform the right version in: bdc_db/version.py
  • Run all the tests.
  • Review the CHANGES.rst.
  • Review links in the documentation for the stable version (README.rst).
  • Create a tag named: v0.4.0.
  • In the master branch increase version in bdc_db/version.py to 0.6.0a.
  • Notify to the community the release of a new version.

Use cache_ok=True for custom type bdc_db.sqltypes.JSONB to avoid Warnings on sqlalchemy 1.4+

The custom data type bdc_db.sqltypes.JSONB is giving a warning on SQLAlchemy 1.4+:

SAWarning: TypeDecorator JSONB(astext_type=Text()) will not produce a cache key because the cache_ok attribute is not set to True. This can have significant performance implications including some performance degradations in comparison to prior SQLAlchemy versions. Set this attribute to True if this type object's state is safe to use in a cache key, or False to disable this warning. (Background on this error at: https://sqlalche.me/e/14/cprf)

It should set the property cache_ok = True on class level to avoid performance degradation while comparing/set value to model.

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.