Skip to content

Commit 9a233a8

Browse files
author
Admin
committed
Fixed output of lines wider than the console.
Added support for a schema prefix and brackets around the object names.
1 parent 0cb4114 commit 9a233a8

File tree

3 files changed

+140
-49
lines changed

3 files changed

+140
-49
lines changed

Example/Example.sql

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ go
1818
** This table definition uses the C-style comment.
1919
**/
2020

21-
create table myschema.MyTable
21+
create table MyTable
2222
(
2323
/** This column definition uses the C-style comment. */
2424
MyColumn myschema.MyType not null primary key clustered,
@@ -63,12 +63,36 @@ create table MyFinalTable
6363
)
6464
go
6565

66+
/**
67+
** A table definition that has a schema and []'s in the names.
68+
**/
69+
70+
create table [dbo].[BracketsTable]
71+
(
72+
[BracketsColumn] [BracketsType] --!< A column with []'s in the name.
73+
)
74+
go
75+
6676
/*!
6777
* A function that takes no arguments.
6878
* NB: The signature is written on a single line.
6979
*/
7080

71-
create function myschema.MyNoArgsFunction() returns varchar(10)
81+
create function MyNoArgsFunction() returns varchar(10)
82+
as
83+
begin
84+
return '42';
85+
end
86+
go
87+
88+
/*!
89+
* A function that has a schema and []'s in the name.
90+
*/
91+
92+
create function [dbo].[BracketsFunction]
93+
(
94+
)
95+
returns [BracketType]
7296
as
7397
begin
7498
return '42';
@@ -79,7 +103,7 @@ go
79103
* A function that takes no arguments and spans multiple lines.
80104
*/
81105

82-
create function myschema.MyOtherNoArgsFunction
106+
create function MyOtherNoArgsFunction
83107
(
84108
)
85109
returns varchar(20)
@@ -94,7 +118,7 @@ go
94118
* specified on a separate line.
95119
*/
96120

97-
create function myschema.OneMoreNoArgsFunction()
121+
create function OneMoreNoArgsFunction()
98122
returns varchar(20)
99123
as
100124
begin
@@ -106,7 +130,7 @@ go
106130
* A function that takes one or more arguments.
107131
*/
108132

109-
create function myschema.MyFunction
133+
create function MyFunction
110134
(
111135
@value1 tinyint, --!< The 1st argument.
112136
@value2 smalldatetime /*!< The 2nd argument. */
@@ -127,7 +151,19 @@ go
127151
* A procedure that takes no arguments.
128152
*/
129153

130-
create procedure myschema.MyNoArgProcedure
154+
create procedure MyNoArgProcedure
155+
as
156+
set nocount on;
157+
go
158+
159+
/*!
160+
* A procedure that has a schema and []'s in the name.
161+
*/
162+
163+
create procedure [dbo].[BracketsProcedure]
164+
(
165+
@aParam [BracketType] --!< Parameter type with []'s
166+
)
131167
as
132168
set nocount on;
133169
go
@@ -136,7 +172,7 @@ go
136172
* A procedure that takes no arguments.
137173
*/
138174

139-
create procedure myschema.MyOneArgProcedure
175+
create procedure MyOneArgProcedure
140176
(
141177
@anArgument varchar(10) --!< The procedures' sole argument
142178
)

Example/Output.sql

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ struct MyFinalTable
5757
smalldatetime MyFinalColumn;
5858
};
5959
60+
/**
61+
** A table definition that has a schema and []'s in the names.
62+
**/
63+
64+
struct dbo::BracketsTable
65+
{
66+
BracketsType BracketsColumn; //!< A column with []'s in the name.
67+
};
68+
6069
/*!
6170
* A function that takes no arguments.
6271
* NB: The signature is written on a single line.
@@ -68,6 +77,18 @@ varchar[10] MyNoArgsFunction()
6877
return '42';
6978
}
7079
80+
/*!
81+
* A function that has a schema and []'s in the name.
82+
*/
83+
84+
BracketType dbo::BracketsFunction
85+
(
86+
)
87+
88+
{
89+
return '42';
90+
}
91+
7192
/*!
7293
* A function that takes no arguments and spans multiple lines.
7394
*/
@@ -121,6 +142,18 @@ void MyNoArgProcedure()
121142
set nocount on;
122143
}
123144

145+
/*!
146+
* A procedure that has a schema and []'s in the name.
147+
*/
148+
149+
void dbo::BracketsProcedure
150+
(
151+
BracketType @aParam //!< Parameter type with []'s
152+
)
153+
{
154+
set nocount on;
155+
}
156+
124157
/*!
125158
* A procedure that takes no arguments.
126159
*/

0 commit comments

Comments
 (0)