Example #1
0
def cli():
    """Entry point for the application script"""
    parser = argparse.ArgumentParser(prog='ERAlchemy')
    parser.add_argument('-i', nargs='?', help='Database URI to process.')
    parser.add_argument('-o', nargs='?', help='Name of the file to write.')

    args = parser.parse_args()
    render_er(args.i, args.o)
Example #2
0
def cli():
    """Entry point for the application script"""
    parser = argparse.ArgumentParser(prog='ERAlchemy')
    parser.add_argument('-i', nargs='?', help='Database URI to process.')
    parser.add_argument('-o', nargs='?', help='Name of the file to write.')
    parser.add_argument('-x',
                        nargs='*',
                        help='Name of the table(s) to exclude.')

    args = parser.parse_args()
    render_er(args.i, args.o, exclude=args.x)
Example #3
0
def hello_world():
    a = request.get_json()
    print(type(transfer_table(a)))
    render_er(transfer_table(a), 'sss.png')
    print("生成缓存图片")
    with open(r'sss.png', 'rb') as image:
        res = base64.b64encode(image.read())
        print('转换为BASE64')
        os.remove('sss.png')
        print('移除图片')
        return res
Example #4
0
def cli():
    """Entry point for the application script"""
    parser = argparse.ArgumentParser(prog='ERAlchemy')
    parser.add_argument('-i', nargs='?', help='Database URI to process.')
    parser.add_argument('-o', nargs='?', help='Name of the file to write.')
    parser.add_argument('-s', nargs='?', help='Name of the schema.')
    parser.add_argument('-x', nargs='*', help='Name of the table(s) to exclude.')
    parser.add_argument('-v', help='Prints version number.', action='store_true')

    args = parser.parse_args()
    check_args(args)
    if args.v:
        print('ERAlchemy version {}.'.format(__version__))
        exit(0)
    render_er(args.i, args.o, exclude=args.x, schema=args.s)