Title: Provide poetry based script to initialise the database · Issue #24 · anomaly/lab-python-server · GitHub
Open Graph Title: Provide poetry based script to initialise the database · Issue #24 · anomaly/lab-python-server
X Title: Provide poetry based script to initialise the database · Issue #24 · anomaly/lab-python-server
Description: While initialising my first project from the template I had to do the following to initialise the database using the following steps: root@af3b478425ca:/opt# python Python 3.10.4 (main, May 11 2022, 10:32:02) [GCC 8.3.0] on linux Type "h...
Open Graph Description: While initialising my first project from the template I had to do the following to initialise the database using the following steps: root@af3b478425ca:/opt# python Python 3.10.4 (main, May 11 2022...
X Description: While initialising my first project from the template I had to do the following to initialise the database using the following steps: root@af3b478425ca:/opt# python Python 3.10.4 (main, May 11 2022...
Opengraph URL: https://github.com/anomaly/lab-python-server/issues/24
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Provide poetry based script to initialise the database","articleBody":"While initialising my first project from the template I had to do the following to initialise the database using the following steps:\r\n\r\n```python\r\nroot@af3b478425ca:/opt# python\r\nPython 3.10.4 (main, May 11 2022, 10:32:02) [GCC 8.3.0] on linux\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> from acacia import db, models\r\n>>> db.init_models()\r\n\u003ccoroutine object init_models at 0xffff993e5a10>\r\n>>> init = db.init_models()\r\n>>> init()\r\nTraceback (most recent call last):\r\n File \"\u003cstdin>\", line 1, in \u003cmodule>\r\nTypeError: 'coroutine' object is not callable\r\n>>> import asyncio\r\n>>> asyncio.run(init)\r\n2022-07-23 01:35:04,927 INFO sqlalchemy.engine.Engine select pg_catalog.version()\r\n2022-07-23 01:35:04,927 INFO sqlalchemy.engine.Engine [raw sql] ()\r\n2022-07-23 01:35:04,928 INFO sqlalchemy.engine.Engine select current_schema()\r\n2022-07-23 01:35:04,928 INFO sqlalchemy.engine.Engine [raw sql] ()\r\n2022-07-23 01:35:04,929 INFO sqlalchemy.engine.Engine show standard_conforming_strings\r\n2022-07-23 01:35:04,929 INFO sqlalchemy.engine.Engine [raw sql] ()\r\n2022-07-23 01:35:04,930 INFO sqlalchemy.engine.Engine BEGIN (implicit)\r\n2022-07-23 01:35:04,931 INFO sqlalchemy.engine.Engine select relname from pg_class c join pg_namespace n on n.oid=c.relnamespace where pg_catalog.pg_table_is_visible(c.oid) and relname=%s\r\n2022-07-23 01:35:04,931 INFO sqlalchemy.engine.Engine [generated in 0.00014s] ('user',)\r\n2022-07-23 01:35:04,932 INFO sqlalchemy.engine.Engine select relname from pg_class c join pg_namespace n on n.oid=c.relnamespace where pg_catalog.pg_table_is_visible(c.oid) and relname=%s\r\n2022-07-23 01:35:04,932 INFO sqlalchemy.engine.Engine [cached since 0.001741s ago] ('user',)\r\n2022-07-23 01:35:04,933 INFO sqlalchemy.engine.Engine \r\nCREATE TABLE \"user\" (\r\n\tid UUID DEFAULT gen_random_uuid() NOT NULL, \r\n\tcreated_at TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL, \r\n\tupdated_at TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL, \r\n\temail VARCHAR, \r\n\tpassword VARCHAR, \r\n\tverified BOOLEAN DEFAULT false NOT NULL, \r\n\tmobile_number VARCHAR, \r\n\tfirst_name VARCHAR, \r\n\tlast_name VARCHAR, \r\n\tis_admin BOOLEAN DEFAULT false NOT NULL, \r\n\totp_secret VARCHAR, \r\n\tPRIMARY KEY (id), \r\n\tUNIQUE (email)\r\n)\r\n\r\n\r\n2022-07-23 01:35:04,933 INFO sqlalchemy.engine.Engine [no key 0.00007s] ()\r\n2022-07-23 01:35:04,939 INFO sqlalchemy.engine.Engine COMMIT\r\n```\r\n\r\nwhich was essentially me running the `init_db` async method to create the tables. It would be preferable to wrap this up into a poetry script and made available as a task, so the user could do something \r\n\r\n```\r\ntask db:init\r\n```\r\n\r\nand the initial database schema would be present. This would go hand in hand with #23 and could possible combine the two steps.","author":{"url":"https://github.com/devraj","@type":"Person","name":"devraj"},"datePublished":"2022-07-23T01:38:43Z","url":"https://github.com/anomaly/lab-python-server/issues/24"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:01bee36b-83bf-3281-b29a-d1d2e82a5057 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CC28:9F575:11699:1690E:6B047CC4 |
| html-safe-nonce | 8f265e4360786041b2319f55df2fe811f687553eb90bb9795d20a8c9be91dbbe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzI4OjlGNTc1OjExNjk5OjE2OTBFOjZCMDQ3Q0M0IiwidmlzaXRvcl9pZCI6IjM3MTg4Mzk3NjYyMzQ3MjU1NzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cc0aa82ed421b30e49db5d9de13bb33e8e95f83d93c732883ec7f9559eae5a5b |
| hovercard-subject-tag | issue:1315523538 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/anomaly/lab-python-server/24/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9067bae452149edfbaeaf4c11c37e0cdcafd56bebb418432d10789eb98c23464/anomaly/lab-python-server/issues/24 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9067bae452149edfbaeaf4c11c37e0cdcafd56bebb418432d10789eb98c23464/anomaly/lab-python-server/issues/24 |
| og:image:alt | While initialising my first project from the template I had to do the following to initialise the database using the following steps: root@af3b478425ca:/opt# python Python 3.10.4 (main, May 11 2022... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | devraj |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511 |
| turbo-cache-control | no-preview |
| go-import | github.com/anomaly/lab-python-server git https://github.com/anomaly/lab-python-server.git |
| octolytics-dimension-user_id | 3654837 |
| octolytics-dimension-user_login | anomaly |
| octolytics-dimension-repository_id | 491764445 |
| octolytics-dimension-repository_nwo | anomaly/lab-python-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 491764445 |
| octolytics-dimension-repository_network_root_nwo | anomaly/lab-python-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ed3f2e01f6b7672780c586c8af0e72726374d7b6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width