...
This commit is contained in:
@@ -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}')
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user