1+ """
2+ Create the Typer cli.
3+ """
4+
15import sys
26import typing
37from typing import Annotated , Optional
@@ -85,7 +89,10 @@ def create(
8589 output_file : Optional [str ] = None ,
8690) -> bool :
8791 """
88- todo: docs
92+ Build the CREATE statements for one or more pydal/typedal tables.
93+
94+ Todo:
95+ more docs
8996
9097 Examples:
9198 pydal2sql create models.py
@@ -128,7 +135,10 @@ def alter(
128135 output_file : Optional [str ] = None ,
129136) -> bool :
130137 """
131- Todo: docs
138+ Create the migration statements from one state to the other, by writing CREATE, ALTER and DROP statements.
139+
140+ Todo:
141+ docs
132142
133143 Examples:
134144 > pydal2sql alter @b3f24091a9201d6 examples/magic.py
@@ -167,30 +177,6 @@ def alter(
167177 return False
168178
169179
170- """
171- todo:
172- - db type in config
173- - models.py with db import or define_tables method.
174- - `public.` prefix
175- """
176-
177- """
178- def pin:
179- pydal2sql pin 96de5b37b586e75b8ac053b9bef7647f544fe502 # -> default pin created
180- pydal2sql alter myfile.py # should compare between pin/@latest and @current
181- # replaces @current for Before, not for After in case of ALTER.
182- pydal2sql pin --remove # -> default pin removed
183-
184- pydal2sql pin 96de5b37b586e75b8ac053b9bef7647f544fe502 --name my_custom_name # -> pin '@my_custom_name' created
185- pydal2sql pin 96de5b37b586e75b8ac053b9bef7647f544fe503 --name my_custom_name #-> pin '@my_custom_name' overwritten
186- pydal2sql create myfile.py@my_custom_name
187- pydal2sql pin 96de5b37b586e75b8ac053b9bef7647f544fe502 --remove -> pin '@my_custom_name' removed
188-
189- pydal2sql pins
190- # lists hash with name
191- """
192-
193-
194180def show_config_callback () -> Never :
195181 """
196182 --show-config requested!
@@ -218,16 +204,7 @@ def main(
218204 version : bool = False ,
219205) -> None :
220206 """
221- Todo: docs
222-
223- Args:
224- _: context to determine if a subcommand is passed, etc
225- config: path to a different config toml file
226- verbosity: level of detail to print out (1 - 3)
227-
228- show_config: display current configuration?
229- version: display current version?
230-
207+ This script can be used to generate the create or alter sql from pydal or typedal.
231208 """
232209 if state .config :
233210 # if a config already exists, it's outdated, so we clear it.
@@ -241,7 +218,3 @@ def main(
241218 elif version :
242219 version_callback ()
243220 # else: just continue
244-
245-
246- # if __name__ == "__main__":
247- # app()
0 commit comments