-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Open
Labels
Description
Follow-up of #6300 to discuss the object-oriented API for the sql functions.
So there are two ways to interact with SQL databases:
- more simple, high-level functions:
read_sql_query
,read_sql_table
,to_sql
- "OO API" for more advanced functionality
The high-level functions are already quite polished (but there are still some issues with NaN, datetime, schema, ..), but the OO API should still be discussed and is not yet really public.
Current design:
PandasSQLAlchemy
object (withexecute
,read_sql
,read_table
,to_sql
,has_table
,drop_table
methods)PandasSQLTable
object to do the actual table reading/writing
Some questions remain:
- What is this 'more advanced' usage that we want to enable in the API?
- possibility to provide custom
MetaData
- the fact you don't recreate the object and metadata for each query (if you do multiple queries)
- other sqlalchemy features people would want? Possibility to provide your own
Table
description instead of generating automatically? - more like
HDF5Store
? (getitem/setitem support? egpandas_sql['table_name']
to read a table?)
- possibility to provide custom
- What do we regard as public API?
- Only
PandasSQLAlchemy
? Or alsoPandasSQLTable
? - which methods of
PandasSQLAlchemy
should be public?
- Only
- Naming:
- naming of
PandasSQLAlchemy
-> do we need a better name? ('SQLDatabase', 'SQLdb', 'SQLConnection', ...) - naming of the methods (
read_sql
->read_query
?)
- naming of
- How do we see
PandasSQLAlchemy
?- wrapper around an
Engine
? or wrapper aroundEngine
+MetaData
- do we want to support reading/writing to multiple schema's? Or do you need to create seperate objects for each schema?
- wrapper around an