@@ -7,6 +7,7 @@ use sqlx::PgPool;
77use crate :: schema_cache:: SchemaCacheItem ;
88
99#[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Default ) ]
10+ #[ cfg_attr( feature = "schema" , derive( schemars:: JsonSchema ) ) ]
1011pub enum ProcKind {
1112 #[ default]
1213 Function ,
@@ -35,6 +36,7 @@ impl From<i8> for ProcKind {
3536
3637/// `Behavior` describes the characteristics of the function. Is it deterministic? Does it changed due to side effects, and if so, when?
3738#[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , Default ) ]
39+ #[ cfg_attr( feature = "schema" , derive( schemars:: JsonSchema ) ) ]
3840pub enum Behavior {
3941 /// The function is a pure function (same input leads to same output.)
4042 Immutable ,
@@ -62,6 +64,7 @@ impl From<Option<String>> for Behavior {
6264}
6365
6466#[ derive( Debug , Clone , Default , Serialize , Deserialize ) ]
67+ #[ cfg_attr( feature = "schema" , derive( schemars:: JsonSchema ) ) ]
6568pub struct FunctionArg {
6669 /// `in`, `out`, or `inout`.
6770 pub mode : String ,
@@ -75,6 +78,7 @@ pub struct FunctionArg {
7578}
7679
7780#[ derive( Debug , Clone , Default , Serialize , Deserialize ) ]
81+ #[ cfg_attr( feature = "schema" , derive( schemars:: JsonSchema ) ) ]
7882pub struct FunctionArgs {
7983 pub args : Vec < FunctionArg > ,
8084}
@@ -88,6 +92,7 @@ impl From<Option<JsonValue>> for FunctionArgs {
8892}
8993
9094#[ derive( Debug , Default , Serialize , Deserialize ) ]
95+ #[ cfg_attr( feature = "schema" , derive( schemars:: JsonSchema ) ) ]
9196pub struct Function {
9297 /// The Id (`oid`).
9398 pub id : i64 ,
0 commit comments