It is not possible for a user to get your phone number through a name search without your permission.
You will get a notification when someone wants to contact you, after which you can choose to accept the invite or deny it.
This applies if you have selected ’Requests only’ in Truecaller > Menu > Settings > Privacy. If you are not a Truecaller user or if you are using a phone that does not support this feature, your setting is ’Requests only’ by default.
Screenshot for Android. Menu -> Settings > General.