This commit is contained in:
2025-11-30 08:59:38 +01:00
parent 0963910572
commit 5b2069c560
32 changed files with 60 additions and 59 deletions

View File

@@ -228,7 +228,7 @@ pub fn (mut client MeilisearchClient) similar_documents(uid string, args Similar
method: .post
data: json.encode(args)
}
res := client.enable_eperimental_feature(vector_store: true)! // Enable the feature first.
client.enable_eperimental_feature(vector_store: true)! // Enable the feature first.
mut http := client.httpclient()!
rsponse := http.post_json_str(req)!
println('rsponse: ${rsponse}')

View File

@@ -19,7 +19,7 @@ pub mut:
user string = 'root'
port int = 5432
host string = 'localhost'
password string = ''
password string
dbname string = 'postgres'
}
@@ -52,8 +52,7 @@ pub fn heroscript_dumps(obj PostgresqlClient) !string {
}
pub fn heroscript_loads(heroscript string) !PostgresqlClient {
mut obj := encoderhero.decode[PostgresqlClient](heroscript)!
return PostgresqlClient{
db_: pg.DB{}
}
mut client := encoderhero.decode[PostgresqlClient](heroscript)!
client.db_ = pg.DB{}
return client
}

View File

@@ -114,5 +114,5 @@ fn (q QueryBuilder) build_query(args BuildQueryArgs) string {
fn type_to_map[T](t T) !map[string]json2.Any {
encoded_input := json2.encode(t)
return json2.raw_decode(encoded_input)!.as_map()
return json2.decode[json2.Any](encoded_input)!.as_map()
}