Is there a way to extract the DDL generated by the create_table
method?
#9699
-
I would like to manipulate some of the data types that import ibis
t = ibis.memtable({"a": [1.0,2,3], "b": ["x", "y", "zz"]})
conn = ibis.mssql.connect()
ddl_sql = t.schema().to_sql(
# dialect = "mssql", # either this or the backend as another argument
conn
)
print(ddl_sql) could give me CREATE TABLE [dbo].[<some name>]
(
[a] [bigint] NULL,
[b] [varchar(max)] NULL -- this is the one I would like to change to, let's say, `varchar(2)`
) and then maybe use I know, a method like this does not exist in the current version of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I think we could probably add a For example, we could likely easily get you the
|
Beta Was this translation helpful? Give feedback.
I think we could probably add a
.compile()
method to ourSchema
object, which would get you everything between the parentheses and would probably clean up a bunch of our internals in the variouscreate_table
methods.For example, we could likely easily get you the
expressions
list here: