Is it possible to script schema of the entire database (SQL Server or Postgres) using datagrip?
I know I can get DDL for table and view and source for each stored procedure / function on it's own.
Can I get one script for all objects in database at once?
Alternatively, is there a way to search through code of all routines at once, say I need to find which ones are using #table
temp table?
Show and hide schemas In the Database Explorer (View | Tool Windows | Database Explorer), right-click a data source and navigate to Database Tools | Manage Shown Schemas. Select or clear checkboxes of schemas that you want to enable or disable. Press Enter .
DDL statement for any object To do this, press Ctrl+Alt+G or choose Context menu → SQL Scripts → SQL Generator… and get the generated DDL of any kind of object (table, schema, procedure, whatever).
In the Database Explorer (View | Tool Windows | Database Explorer), right-click a schema or a table and select Import/Export | Import Data from File(s). Navigate to the files that contain delimiter-separated values, select them, and click Open.
For now only dumping tables works. In 2016.3 EAP which will be available in the end of August there will be an integration with mysqldump and pg_dump.
I was looking for this today and just found it. If you right click the schema you want to copy and choose "Copy DDL" this will copy the create script to the clipboard.
To answer your second part of the question: quick and easy way to search for #table
in all of your procedures you can do the following query
SELECT *
FROM information_schema.routines
WHERE routine_definition LIKE '%#table%'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With