Title
#general
AoS

AoS

11/05/2019, 9:44 AM
how do i query with the AND keyword using the sql:😒electfrom() function, all of the examples i found didn't include an AND keyword to the constraint expression
theopolis

theopolis

11/05/2019, 1:44 PM
Are you developing an extension? If you're developing a table (in core) I would suggest against using the
SQL::
APIs, they are fairly expensive. Is there another way to get the data you want? But to answer your question I'd recommend using
SQL::SQL
with a query and then going from there.
AoS

AoS

11/05/2019, 1:58 PM
yes i am developing an extension, and i am trying to grab the local ip of the machine, which is rather hard when not using the sql:: apis.
1:59 PM
and i would prefer not to send a dns query to google for resolving my main ip.
theopolis

theopolis

11/05/2019, 3:12 PM
That makes sense. I don't have a good answer off the top of my head. I'd recommend investigating the implementation of
::selectAllFrom
or using the default
select * from interface_addresses
then applying some filtering logic in the extension code.
AoS

AoS

11/05/2019, 5:23 PM
currently my query looks like this
5:23 PM
select address from interface_addresses where address like '%.%' and friendly_name like '%local%' and (type='manual' or type='dhcp')
5:24 PM
works pretty well from kolide and now trying to implement it into the extension
5:25 PM
would be really glad for any insight or help on how to use SQL::SQL correctly
5:26 PM
and in general if you need help with writing the core code api documentation ill be glad to help as i think it could get a slight revamp.
theopolis

theopolis

11/05/2019, 9:55 PM
core code api documentation
I agree. I think improving both the API and the documentation should be a prioritized goal for the next release. (could use help with it, as usual)