
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@sqlitecloud/sqlc-react-search
Advanced tools
SQLite Cloud search headless component
You can install @sqlitecloud/sqlc-react-search
via the terminal by running:
npm i @sqlitecloud/sqlc-react-search
To use the search component, you need to initialize it by passing the URL of the edge function created from the dashboard. More details below.
import { useSqlcSearch } from "@sqlitecloud/sqlc-react-search";
function Search() {
const searchUrl = "https://myhost.sqlite.cloud:8090/v2/functions/search-js";
// Initialize the useSqlcSearch custom hook
const {
searchText, // Text to search for
searchRes, // Search results
searchError, // Error information if search fails
validSearchUrl,// Boolean indicating if the search URL is valid
handleSearch, // Function to handle search input changes
} = useSqlcSearch(searchUrl);
return (
<div>
<input
type="text"
value={searchText}
onChange={handleSearch}
placeholder="Type here..."
/>
<pre>{JSON.stringify(searchRes, null, 2)}</pre>
</div>
)
}
The following types can be imported and used:
import type { SearchResult, SearchError, SqlcSearchReturn } from "@sqlitecloud/sqlc-react-search";
The code for the edge function to be created is as follows (Edge Functions documentation):
const query = request.params.query;
const requestid = request.params.requestid;
return {
data: {
search: await connection.sql`SELECT url, replace(snippet(documentation, -1, '<b>', '</b>', '...', 10), x'0A', ' ') as 'snippet' FROM documentation WHERE content MATCH concat(${query}, '*') ORDER BY rank LIMIT 256;`,
requestid: requestid
}
}
documentation
with the name of your database.JavaScript
as the function type.We provide a simple example that shows how to use the component in the example folder.
To run the example, download the repo and follow these steps:
npm install
at the root directory level.npm run start
in the ./packages/sqlc-react-search/example
subdirectory.The example code will be executed at localhost:1234
FAQs
SQLite Cloud search headless component
We found that @sqlitecloud/sqlc-react-search demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.