Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/access for rdb resource #374

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5e2eb15
preparare doundation
aran-nakayama Sep 29, 2024
e25cfe9
working with mock data
aran-nakayama Sep 29, 2024
35b5eae
use vannna to make sql and pass to the dana agent through dbresource
aran-nakayama Oct 1, 2024
001f6d5
make file for making example table and data
aran-nakayama Oct 1, 2024
3c047f4
train vanna for generating SQL from prompt
aran-nakayama Oct 2, 2024
0d63e06
resource data is taple and it seems that openssa has difficulty to un…
aran-nakayama Oct 3, 2024
ffae625
make myvanna file to clean code
aran-nakayama Oct 3, 2024
47ecfe8
TypeError: Can't instantiate abstract class DbResource without an imp…
Oct 11, 2024
86c0840
change how to import from openssa to try to make it work (but it didn't)
Oct 18, 2024
4e9f648
nailcare
aran-nakayama Oct 22, 2024
27d9c37
nailcare
aran-nakayama Oct 22, 2024
39b218b
save tmp (need to be fixed)
aran-nakayama Oct 22, 2024
7227879
style: reformat code
phanhongan Oct 26, 2024
f27c9ed
refactor: replace random.choice by secrets.choice to avoid security r…
phanhongan Oct 26, 2024
2ade37a
Merge from `main`
phanhongan Oct 26, 2024
82432fb
style: add empty lines and space
phanhongan Oct 26, 2024
2ec3e3a
style: add empty lines
phanhongan Oct 26, 2024
5a93152
style: rearrange imports
phanhongan Oct 26, 2024
7f9f044
refactor: replace Exception by ValueError & RuntimeError
phanhongan Oct 26, 2024
08a2170
style: import 3rd party before 1st party
phanhongan Oct 26, 2024
4c51982
fix: add default db port
phanhongan Oct 26, 2024
654b8f7
fix: add default db port as string
phanhongan Oct 26, 2024
c255aa9
build: add pymysql
phanhongan Oct 26, 2024
9bf2495
fix: set default values for DB connection
phanhongan Oct 26, 2024
2030be4
ci: add MySQL to Mac
phanhongan Oct 26, 2024
16220cd
ci: install Docker for pulling MySQL
phanhongan Oct 26, 2024
a5a1a8a
ci: setup Docker Buildx
phanhongan Oct 26, 2024
4921af5
ci: setup MySQL on Ubuntu
phanhongan Oct 26, 2024
9fbf2ce
ci: wait for MySQL to be ready
phanhongan Oct 26, 2024
e9ee662
ci: use random root password for MySQL
phanhongan Oct 26, 2024
965881c
ci: remove MYSQL_USER="root"
phanhongan Oct 26, 2024
78f0789
ci: remove MYSQL_USER="root" in test env
phanhongan Oct 26, 2024
e44b6ab
ci: use empty password for MySQL
phanhongan Oct 26, 2024
0a0e048
ci: remove MYSQL_USER="root" if using MYSQL_ALLOW_EMPTY_PASSWORD
phanhongan Oct 26, 2024
35063d0
ci: run db migrations before testing
phanhongan Oct 26, 2024
7cdbeae
build: add alembic
phanhongan Oct 26, 2024
54135fe
test: add alembic
phanhongan Oct 26, 2024
ff1df64
ci: install alembic
phanhongan Oct 26, 2024
d042cf5
ci: init alembic
phanhongan Oct 26, 2024
e6e6426
ci: install MySQL driver
phanhongan Oct 26, 2024
a2edf10
ci: use pymysql when running db migration
phanhongan Oct 26, 2024
cff10f6
ci: no password in db connection
phanhongan Oct 26, 2024
ef5aa89
ci: add alembic.ini
phanhongan Oct 27, 2024
aaba05d
fix: put alembic.ini in `openssa`
phanhongan Oct 27, 2024
3ea10b7
fix: put alembic.ini in root
phanhongan Oct 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ci: add alembic.ini
phanhongan committed Oct 27, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit ef5aa89ab45969b526d310443ef737b61ff663a3
85 changes: 85 additions & 0 deletions .github/workflows/alembic.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# A generic, single database configuration.

[alembic]
# path to migration scripts
script_location = alembic

# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s

# timezone to use when rendering the date
# within the migration file as well as the filename.
# string value is passed to dateutil.tz.gettz()
# leave blank for localtime
# timezone =

# max length of characters to apply to the
# "slug" field
# truncate_slug_length = 40

# set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false

# set to 'true' to allow .pyc and .pyo files without
# a source .py file to be detected as revisions in the
# versions/ directory
# sourceless = false

# version location specification; this defaults
# to alembic/versions. When using multiple version
# directories, initial revisions must be specified with --version-path
# version_locations = %(here)s/bar %(here)s/bat alembic/versions

# the output encoding used when revision files
# are written from script.py.mako
# output_encoding = utf-8

sqlalchemy.url = mysql+pymysql://user:pass@localhost/dbname


[post_write_hooks]
# post_write_hooks defines scripts or Python functions that are run
# on newly generated revision scripts. See the documentation for further
# detail and examples

# format using "black" - use the console_scripts runner, against the "black" entrypoint
# hooks=black
# black.type=console_scripts
# black.entrypoint=black
# black.options=-l 79

# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = WARN
handlers = console
qualname =

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine

[logger_alembic]
level = INFO
handlers =
qualname = alembic

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S
8 changes: 3 additions & 5 deletions .github/workflows/install-lint-test-on-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -55,14 +55,12 @@ jobs:
sleep 5
done

- name: Install MySQL Driver
run: pip install pymysql

- name: Install Alembic
run: pip install alembic

- name: Initialize Alembic
run: alembic init alembic
- name: Set up Alembic Configuration
run: |
cp .github/workflows/alembic.ini .

- name: Run Migrations
run: |