I am building an Expo app using expo-sqlite and TypeOrm through DataSource to interact with the mobile device built-in sqlite DB.
I need to use a regex matching function in a database query.
Here is my TypeOrm DataSource:
import * as SQLite from 'expo-sqlite'
new DataSource({
database: 'db-name',
type: 'expo',
driver: SQLite,
entities: [...entities],
synchronize: true,
logging: 'all',
})
Whenever I use REGEXP function as follows
const dataSource = await getDataSource()
const usersRepository = dataSource.getRepository(User)
const query = usersRepository.createQueryBuilder('user')
query.where(`user.name REGEXP 'stringQuery'`)
I get the error:
Error code 1: no such function: REGEXP
How can I define the REGEXP function or any other regex matching functionality?
expo-sqlitei don't have an access tocreateFunctionorloadExtensionmethods to apply this