Copilot commented on code in PR #597:
URL: https://github.com/apache/fluss-rust/pull/597#discussion_r3366931574


##########
bindings/elixir/lib/fluss/admin.ex:
##########
@@ -65,10 +71,11 @@ defmodule Fluss.Admin do
     end
   end
 
-  @spec create_database(t(), String.t(), boolean()) :: :ok | {:error, 
Fluss.Error.t()}
-  def create_database(admin, name, ignore_if_exists \\ true) do
+  @spec create_database(t(), String.t(), Fluss.DatabaseDescriptor.t() | nil, 
boolean()) ::
+          :ok | {:error, Fluss.Error.t()}
+  def create_database(admin, name, descriptor \\ nil, ignore_if_exists \\ 
true) do
     admin
-    |> Native.admin_create_database(name, ignore_if_exists)
+    |> Native.admin_create_database(name, descriptor, ignore_if_exists)
     |> Native.await_nif()

Review Comment:
   create_database/3 is now ambiguous with the old API: existing callers that 
still pass a boolean as the 3rd positional arg (ignore_if_exists) will now send 
that boolean as the NIF `descriptor` argument, which will fail decoding 
(badarg) rather than behaving as before. You can preserve backward 
compatibility (and provide clearer argument validation) by adding function 
heads that detect a boolean 3rd argument and route it to ignore_if_exists, 
while keeping the new descriptor-based overloads.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to