-
Notifications
You must be signed in to change notification settings - Fork 0
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
Paste into existing table #3
Comments
I wrote this code earlier: @hookimpl
def table_actions(datasette, actor, database, table):
async def inner():
if not await can_paste(datasette, actor, database, table):
return []
return [
{
"href": datasette.urls.table(database, table) + "/-/paste",
"label": "Paste data into this table",
"description": "Paste in JSON, CSV or TSV data (e.g. from Google Sheets)",
}
]
return inner And for (r"^/(?P<database>[^/]+)/(?P<table>[^/]+)/-/paste$", paste_to_table), |
There may be a bunch of extra complexity around this:
|
Super advanced: ability to reformat data to populate columns correctly, for example reformatting dates to match. This is likely to be a separate feature, there's a lot of depth to this one and it affects how imports work too. Might also need a bit of persistence around this in order to remember what those conversions were for future loads into the same table. |
Split from:
The text was updated successfully, but these errors were encountered: