facebook / flipper

A desktop debugging platform for mobile developers.
https://fbflipper.com/
MIT License
13.26k stars 951 forks source link

Pass DatabaseDescriptor to -executeSQL #5557

Open jparise opened 2 months ago

jparise commented 2 months ago

Summary

Unlike the other DatabaseDriver protocol methods, -executeSQL: wasn't passing the DatabaseDescriptor object. The database driver implementation needs that context in order to know which database connection to use.

This matches the Android DatabaseDriver interface:

https://github.com/facebook/flipper/blob/9053a6c2ef61f7033ef3c006b2c4c6edab7dc41d/android/src/main/java/com/facebook/flipper/plugins/databases/DatabaseDriver.java#L52-L53

I renamed this method to -executeSQLWithDatabaseDescriptor:sql: to match the convention used by the other methods.

Changelog

In DatabaseDriver, rename -executeSQL: to executeSQLWithDatabaseDescriptor:sql: and pass the DatabaseDescriptor object.

Test Plan

Verified the MockDatabaseDriver implementation continues to work as before, and verified that the execute command now receives the DatabaseDescriptor (in a local project).