File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,25 @@ def sqlite_verify(sql: str, rels: bool) -> str:
3838 cursor .execute (sql )
3939 conn .commit ()
4040
41- return gen_code_from_sqlite (str (sqlite_path ), rels )
41+ func_code = gen_code_from_sqlite (str (sqlite_path ), rels )
42+ short_arg_cli_code = _sqlite_cli (sqlite_path , rels , True )
43+ long_arg_cli_code = _sqlite_cli (sqlite_path , rels , False )
44+
45+ assert func_code == short_arg_cli_code
46+ assert func_code == long_arg_cli_code
47+
48+ return func_code
49+
50+ def _sqlite_cli (sqlite_path : Path , rels : bool , short_arg : bool = False ) -> str :
51+ args = [
52+ '-s' if short_arg else '--sqlite' ,
53+ str (sqlite_path ),
54+ ]
55+
56+ if rels :
57+ args .append ('-r' )
58+
59+ return launch_cli_in_tmpfile (args = args )
4260
4361def postgres_verify (sql : str , rels : bool , schema_name : str = 'public' ) -> str :
4462 with postgres_container () as pgc :
You can’t perform that action at this time.
0 commit comments