GithubHelp home page GithubHelp logo

workbench_alchemy's Introduction

Hi there ๐Ÿ‘‹

PiTiLeZarD's GitHub trophy

PiTiLeZarD's GitHub Stats

  • ๐Ÿ“ฆ JavaScript/Typescript: senior
  • ๐Ÿฆˆ Docker/Swarm: senior
  • ๐Ÿ Python: senior
  • ๐Ÿ”ญ Iโ€™m currently working on down-the-log
  • ๐ŸŒฑ Iโ€™m currently learning japanese and trying to manage my addiction to puzzles on codingame.com ;)
  • โšก Fun fact: Got my first computer thanks to a game I coded in a shop that kickstarted sales on previously ignored Amstrads. My mom was convinced I stole it and asked me to return it, I was 12! :)
  • ๐Ÿ’ฌ Ask me about anything
  • โ˜• If you feel like buying me a coffee

workbench_alchemy's People

Contributors

pitilezard avatar zuckonit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

workbench_alchemy's Issues

column default values produce invalid python code

Hi! Thx for that tool.
If i have in the MySQL create table following column definition:
mod_timestamp TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

I get following after running the script and python claims that this is invalid syntax:
mod_timestamp = Column(TIMESTAMP, default=CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP)

any idias how to fix this?

problem of "one to one relation" and "muti unique index"

firstly, thank you for this great tool, which save so much time of mine.
during my work, I found some problem about this tool:

    1. one to one relation, why not use:
      uselist = False
    1. multi unique index, this is inactive by using UniqueConstraint (mybe in some special sqlalchemy version or mysql version)
    UniqueConstraint('assailant_id', 'sample_id', 'sample_type', name='assailant_sample_uqe')
    

    instead below is active:

        __table_args__ = ({'mysql_engine': 'InnoDB', 'sqlite_autoincrement': True, 'mysql_charset': 'utf8'}
    , UniqueConstraint('assailant_id', 'sample_id', 'sample_type', name='assailant_sample_uqe'))
    

Primary key column renamed and aliased

When exporting this table from the database ...

CREATE TABLE IF NOT EXISTS ass_register.person (
idperson INT NOT NULL AUTO_INCREMENT,
lastname VARCHAR(45) NULL,
firstname VARCHAR(45) NULL,
PRIMARY KEY (idperson))
ENGINE = InnoDB

I get the idperson column renamed like so:

class Person(DECLARATIVE_BASE):

__tablename__ = 'person'
__table_args__ = (
    {'mysql_engine': 'InnoDB', 'sqlite_autoincrement': True, 'mysql_charset': 'utf8'}
)

id = Column(  # pylint: disable=invalid-name
    "idperson", INTEGER, autoincrement=True, primary_key=True, nullable=False
)
lastname = Column(VARCHAR(45))
firstname = Column(VARCHAR(45))

def __repr__(self):
    return self.__str__()

def __str__(self):
    return "<Person(%(id)s)>" % self.__dict__

As Professor Julius would say "Why is it so?"
P.S. Wonderful tool !

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.